Quantcast
Channel: File Services and Storage Forum
Viewing all articles
Browse latest Browse all 1766

How to get from \\PhysicalDriveN to a list of Drive Letters associated with the partitions (as Disk Management does)

$
0
0

I need to be able to return a list of drive letters given a PhysicalDrive name. I can see how to enumerate the partitions on a physical drive (via IOCTL_DISK_GET_DRIVE_LAYOUT_EX) , but after spending half a day trying to find how to get from a partition to a drive letter, I am lost. I understand that there's not a 1-->1 correspondence or anything; but I want to provide that same piece of functionality that Disk Management does, where it says what drive letter each (mounted) partition is associated with.

A related question is, in forming the symbolic names \Device\HardDiskVolumeN, are the "N"'s the same as the PartitionNumber field from the PARTITION_INFORMATION_EX structure?

All of this is probably staring at me from my small mountain of printouts of these structures, etc., and laughing, but I can't see it! Thanks for any/all help.


Viewing all articles
Browse latest Browse all 1766

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>