I hope to get this result.
Disk 1 partition 1: C
Disk 1 partition 2: D
Disk 1 partition 3: E
Disk 1 partition 4: f
Disk 2 partition 1: g
Disk 2 partition 2: i
Disk 2 partition 3: j
Disk 2 partition 4: K
-------------------------------------------------- -------------
This is the case, getVolumeInfo ('c'). DiskNumber results are the physical disk ID
Need JEDI's Win32 Support Bank to compile!
Function GetVolumeInfo (Driverletter: char): TDISKEXTENT;
VAR
Hvolume: thandle;
Diskelts: PvoluMedisKextents;
DwoutBytes: cardinal
Begin
WITH RESULT DO
Begin
DiskNumber: = 0;
Startingoffset.quadpart: = 0;
EXTENTLENGTH.QUADPART: = 0;
END;
Hvolume: = createfile (pchar ('//./' DRIVERLETTER '), generic_read or generic_write,
File_share_read or file_share_write, nil, open_existing, 0, 0);
IF hvolume <1 kilion;
Diskextents: = Allocmem (MAX_PATH);
IF DeviceioControl (Hvolume,
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS,
NIL, 0,
Diskelts, Max_Path,
Dwoutbytes, nil) THEN
Begin
If diskentents ^ .NumberofDiskextents> 0 THEN
Result: = diskextents ^ .extents [0];
END;
Freemem (Diskelts);
CloseHandle (HVolume);
END;
http://lysoft.7u7.net