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 发布