Checking device PID / VID from WDM driver

Hello all,

Does the driver have access to its device’s PID and VID as reported in Device Manager? I’d actually like to get this information to use in the driver’s AddDevice function to set things up differently depending on the product ID. A single driver will be associated with multiple devices, and this is why we need to get the PID to know how to set things up.

If the PID can be obtained from a WDM driver, how do I get this information?

Thanks!

–M

Can you postpone until start device / preparehw? If so, you can query for the device descriptor which has the pid. Otherwise, you can update your inf to have a unique install section per pod and write out the pid value in the devnode and then query it on add device. If it were mr, I would just defer to start time

d

debt from my phone


From: xxxxx@gmail.com
Sent: 8/27/2012 1:55 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Checking device PID / VID from WDM driver

Hello all,

Does the driver have access to its device’s PID and VID as reported in Device Manager? I’d actually like to get this information to use in the driver’s AddDevice function to set things up differently depending on the product ID. A single driver will be associated with multiple devices, and this is why we need to get the PID to know how to set things up.

If the PID can be obtained from a WDM driver, how do I get this information?

Thanks!

–M


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

Also, for a WDM driver (not KMDF yet), this may work:
IoGetDeviceProperty(PDO, DevicePropertyHardwareID …)
where PDO is the 2nd arg of your AddDevice

– pa

And then you are both parsing strings and dependent on the order of reported ids.

d

debt from my phone


From: Pavel A
Sent: 8/27/2012 3:08 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Checking device PID / VID from WDM driver

Also, for a WDM driver (not KMDF yet), this may work:
IoGetDeviceProperty(PDO, DevicePropertyHardwareID …)
where PDO is the 2nd arg of your AddDevice

– pa


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