Note also that a “drive letter” may not map to a partition on the disk,
but could be a random sbudirectory, and most commonly might be a
subdirectory of a remote server. So don’t think that every drive letter
maps 1:1 to physical drives or even partitions. You first have to figure
out the mappnig, and then figure out what to do with that information.
For example, on many of my systems
I: = \server5\x
J: = \server5\x
at one time, I had two RAID-5 arrays on my server (\server, and the next
server became \server2, etc.), and files could be on one bank or the
other. As disk prices dropped, I consolidated all my files on one single
RAID-5 array (of 1TB disks, currently). But I had lots of scripts that
used J: so I just mapped both. \server5\x is not a physical volume, but
a subdirectory, C:\xfiles, on the server. On the first server, there was
a separate boot drive (not in the RAID-5 array) and two banks of hot-swap
2GB drives (and those were BIG disks in those days). The current server
just has one bank of hot-swap 1TB drives, and no separate boot drive.
(Actually, it also has a NAS array of four 2TB drives as well, currently
known as “Y:”, which maps to \server5\DroboY).
So don’t base your assumptions on the configuration of one machine. The
reality can be vastly more complex.
joe
@ Kenny
>First, remember that a volume can span multiple physical devices, so you
> may
>need to identify multiple devices per volume (i.e. C:).
Yes, thanks for the reminder. I only need to know that a specific device
belongs to a specific drive letter, thats all. That Multipath stuff is not
of interest at this moment. Anyway thank you for reminding me that.
WMI is very powerful and one fine thing, but its pretty difficult to
relate the classes to each other even with those things like
Win32_LogicalDiskToPartition. Yesterday i already found out, that some of
the classes look as if they where strongly connected to another class, but
on a closer look, its very difficult to glue them together, at least in my
case 
@Don Burn
Yes, the "\GLOBAL??" directory looks promising. I remember this can be
done with NtOpenDirectoryObject, NtQueryDirectoryObject,
NtOpenSymbolicLinkObject and NtQuerySymbolicLinkObject.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer