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)?

I need valid drive letters... by J

J
Wed Oct 17 04:15:22 PDT 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.deBoynePollard/FGA/put-down-the-
chocolate-covered-banana.html>


Re: I need valid drive letters... by Uwe

Uwe
Wed Oct 17 09:22:57 PDT 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:
> 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)?
>

Re: I need valid drive letters... by Maxim

Maxim
Wed Oct 17 09:02:45 PDT 2007

> With IOCTL_DISK_GET_DRIVE_LAYOUT (W2K) and
> IOCTL_DISK_GET_DRIVE_LAYOUT_EX (XP+) you get the numbers
> of the partitions.

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


Re: I need valid drive letters... by Uwe

Uwe
Thu Oct 18 00:04:46 PDT 2007

Maxim S. Shatskih wrote:
>> With IOCTL_DISK_GET_DRIVE_LAYOUT (W2K) and
>> IOCTL_DISK_GET_DRIVE_LAYOUT_EX (XP+) you get the numbers
>> of the partitions.
>
> IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS will return you the physical disk number
> on which each partition is located.

It returns a STORAGE_DEVICE_NUMBER struct which contains
DeviceType, DeviceNumber and PartitionNumber.


Uwe


Re: I need valid drive letters... by Maxim

Maxim
Thu Oct 18 01:56:26 PDT 2007

> > IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS will return you the
>physical disk number
> > on which each partition is located.
>
> It returns a STORAGE_DEVICE_NUMBER struct which contains
> DeviceType, DeviceNumber and PartitionNumber.

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::DeviceNumber

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


Re: I need valid drive letters... by Uwe

Uwe
Thu Oct 18 03:59:34 PDT 2007

Maxim S. Shatskih wrote:
>>> IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS will return you the
>> physical disk number
>>> on which each partition is located.
>> It returns a STORAGE_DEVICE_NUMBER struct which contains
>> DeviceType, DeviceNumber and PartitionNumber.
>
> 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::DeviceNumber
>
> The number in the symlink name of \\.\PhysicalDrive%d is the same number.
>

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