Discussion:
PNP device id
(too old to reply)
pacchij
2010-05-12 02:21:01 UTC
Permalink
I am looking a way to get PNP device Id for USB, CDRom, and hard disks,
mapped network drives.

I know we can get through WMI calls.

My project requires not to use WMI and I am looking ways to get the PNP
device id through windows native API calls.

I figured out that PNP device ids are listed in windows registry
"HKLM\SYSTEM\CurrentControlSet\services\{service}\Enum.

Where {service} could be CDROM, disk, USBSTOR etc....

I have following questions on this.

1. How can I link back this "PNP device id" to the mounted volume letter?

2. Not finding a way to get "PNP device id" for network mapped drives?

3. Is there any IOCTL call to get the "PNP device id" for any volume or drive?

4. Is there any way I can get PNP device id by giving volume letter?

Thanks in advance
Jeff the Tall [MSFT]
2010-05-13 16:38:01 UTC
Permalink
use CM_Locate_DevNode(NULL)
(http://msdn.microsoft.com/en-us/library/ff538742(v=VS.85).aspx ) to find the
root devnode, then call CM_Get_Child and CM_Get_Sibling to get all of the
devnodes.

you can use CM_Get_Device_ID to get the HWID
(http://msdn.microsoft.com/en-us/library/ff538405(v=VS.85).aspx)
NOTE: this is the full Device Instance ID; the term Device ID can mean
eitehr the HWID or the Device Instance ID.
Post by pacchij
I am looking a way to get PNP device Id for USB, CDRom, and hard disks,
mapped network drives.
I know we can get through WMI calls.
My project requires not to use WMI and I am looking ways to get the PNP
device id through windows native API calls.
I figured out that PNP device ids are listed in windows registry
"HKLM\SYSTEM\CurrentControlSet\services\{service}\Enum.
Where {service} could be CDROM, disk, USBSTOR etc....
I have following questions on this.
1. How can I link back this "PNP device id" to the mounted volume letter?
2. Not finding a way to get "PNP device id" for network mapped drives?
3. Is there any IOCTL call to get the "PNP device id" for any volume or drive?
4. Is there any way I can get PNP device id by giving volume letter?
Thanks in advance
Continue reading on narkive:
Loading...