- I need valid drive letters...
- Posted by keandi on October 17th, 2007
Hi.
I need driver letter and the order..
Look at this. (this is my HDDs)
Disk1
C: - '\Device\HardDiskVolume1'
E: - '\Device\HardDiskVolume2'
F: - '\Device\HardDiskVolume3'
G: - '\Device\HardDiskVolume4'
Disk3
Y: - '\Device\HardDiskVolume9'
H: - '\Device\HardDiskVolume8'
I: - '\Device\HardDiskVolume7'
J: - '\Device\HardDiskVolume6'
K: - '\Device\HardDiskVolume5'
D: - '\Device\HardDiskVolume10'
I can get HardDiskVolumes by disk letter (like C:\ D:\)
Now I read NTFS Partition table. But I don't know how I get partition
table's drive letter.
In case I read Partition table, Disk1's order is valid. So I can know
C, E, F, G
But Disk3's order is not valid. (just desc..)
So I cann't read disk letter by volume order.
How can I get disk letter when I read partition table(NTFS)?
- Posted by J de Boyne Pollard on October 17th, 2007
k> I need driver letter and the order.. [...]
k> How can I get disk letter when I read partition table(NTFS)?
Put down that chocolate-covered banana and step away from the European
currency systems. Partition tables don't hold drive letter
assignments. Drive letter assignments are not necessarily even static
from one system invocation to the next, or across multiple sessions.
<URL:http://homepages.tesco.net./~J.deBoy.../put-down-the-
chocolate-covered-banana.html>
- Posted by Maxim S. Shatskih on October 17th, 2007
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS will return you the physical disk number
on which each partition is located.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by Uwe Sieber on October 17th, 2007
A storage volume's partition number can be determined by
IOCTL_STORAGE_GET_DEVICE_NUMBER.
With IOCTL_DISK_GET_DRIVE_LAYOUT (W2K) and
IOCTL_DISK_GET_DRIVE_LAYOUT_EX (XP+) you get the numbers
of the partitions.
These can be matched.
Uwe
keandi wrote:
- Posted by Uwe Sieber on October 18th, 2007
Maxim S. Shatskih wrote:
It returns a STORAGE_DEVICE_NUMBER struct which contains
DeviceType, DeviceNumber and PartitionNumber.
Uwe
- Posted by Maxim S. Shatskih on October 18th, 2007
No.
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returns an array of DISK_EXTENT, and
DISK_EXTENT has DiskNumber in it.
It is the same number as can be queried using IOCTL_STORAGE_GET_DEVICE_NUMBER,
which is STORAGE_DEVICE_NUMBER:
eviceNumber
The number in the symlink name of \\.\PhysicalDrive%d is the same number.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by Uwe Sieber on October 18th, 2007
Maxim S. Shatskih wrote:
Yes, you are right. I though you wrote about
IOCTL_STORAGE_GET_DEVICE_NUMBER. When I saw my
fault a minute later I canceled the message but
some server doesn't care.
Uwe