Does anyone know how to determine the volume associated with a given device
instance from user mode? For example, given a 1394 storage device, I can
walk the device tree using SetupDi or CM_ functions and get as far as the
SBP2 device instance. However, there are no children below that instance
even though there are volumes.
In looking at the output from DeviceTree (view system from PnP perspective)
I see that DeviceTree does indeed show a continuing child relationship
which leads to an entry like:
\device\Harddisk2\DR7
which in turn leads to device object for individual volumes.
The Windows “device removal applet” also knows how to enumerate the
relationship between physical devices and their logical volumes.
I’m guessing that the key might be to use functions like
IRP_MN_QUERY_DEVICE_RELATIONS, but I’m at a loss as to how to issue such a
request from user mode. Or, is there a different approach?
TIA for any help.
Regards,
-Robert