Hello,
I would like to retrieve this correspondence in a kernel-mode driver. Any idea ?
Thanks.
Hello,
I would like to retrieve this correspondence in a kernel-mode driver. Any idea ?
Thanks.
What is “volume number”?
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> Hello,
>
> I would like to retrieve this correspondence in a kernel-mode driver. Any idea ?
>
> Thanks.
>
The correspondence X -> Y I’m looking for is:
partition X -> \Device\HarddiskVolumeY
At 11:21 21/04/2009, xxxxx@club-internet.fr wrote:
The correspondence X -> Y I’m looking for is:
partition X -> \Device\HarddiskVolumeY
There is no strict correspondence.
In the default case it might appear there is one because of the way
in which the system builds the device names during boot.
However, when you start adding and deleting partitions the Y value
will increment each time a partition/volume is created.
You will need to run naming discovery routines each time you want to
find this association. It’s probably easier if you work with the
volume guids, then you can avoid thinking about correspondence trap.
Mark.
Open \Device\HarddiskVolumeY and send IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
Then open partition X, send IOCTL_STORAGE_GET_DEVICE_NUMBER to get DiskNumber, and IOCTL_DISK_GET_PARTITION_INFO to get the offset. Then match them with the result of IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com
wrote in message news:xxxxx@ntdev…
> The correspondence X -> Y I’m looking for is:
>
> partition X -> \Device\HarddiskVolumeY
>
>
>
Thank you guys !