How to get the PhysicalDrive number which the logical drive located?
> Like how to get the PhysicalDrive number of "C:" logical drive?
> Thanks a lot!
Open your //.//C:, then issue IOCTL_STORAGE_GET_DEVICE_NUMBER, this returns
a number. Append the decimal representation of this number to
//.//PhysicalDrive, and you should be all set. This method will not work
with volumes that span multiple harddrives, but your question does not make
sense in that case, either. If you do want to handle that case, check out
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS.
The QueryDosDevice() method mentioned by Eugene is no longer practicable
without using undocumented symlink manipulation API.
The only other way I know of is to use the PnP/setup API to walk the device
tree, but this is too much work for such a small function.
从逻辑盘符获得物理驱动号
最新推荐文章于 2022-01-28 11:40:07 发布
本文介绍了一种方法来获取特定逻辑驱动器(如C:)所对应的物理磁盘编号。通过使用 IOCTL_STORAGE_GET_DEVICE_NUMBER 方法可以得到这个编号,并将其附加到 //.//PhysicalDrive 后面来确定具体的物理磁盘。对于跨越多个硬盘的卷,则需要使用 IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS 方法。
482

被折叠的 条评论
为什么被折叠?



