PnP Device Instance IDs

How can a driver determine the full Device Instance ID for one of it’s
own devices?

I want to use this in WMI data to provide a link between a driver’s
custom WMI classes and the CIMv2 Win32_PnPEntity class. As this is an
WDF/KMDF driver each WMI instance exposed by the driver already includes
the device instance ID, up to a point, in the auto-generated
InstanceName property. The InstanceName is in fact the device instance
ID suffixed with an underscore and a numeric ID starting at 0. For example:

Hardware ID: PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01
Device Instance ID:
PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008
WMI Instance Names:
PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_0

PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_1

PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_2
etc.

I’d prefer not to rely upon an implementation detail of WDF (which may
change in future) and force users of my driver’s WMI classes from having
to parse the WMI InstanceName and strip off the “_xxx”. The full device
instance ID isn’t available via
WdfDeviceQueryProperty()/IoGetDeviceProperty() but that does give me the
hardware ID. How can a driver determine the instance ID? or even just
the instance suffix information (4&26a7f3f5&0&0008 in the example above)
to append to the hardware ID to yield the full instance ID?

Best regards,

Andrew


Andrew Lee Solarflare Communications
mailto:xxxxx@solarflare.com http://www.solarflare.com/

the full pnp instance ID is not exposed to KM drivers (WDM, KMDF), you
can’t get at it.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Andrew Lee
Sent: Thursday, July 26, 2007 9:31 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] PnP Device Instance IDs

How can a driver determine the full Device Instance ID for one of it’s
own devices?

I want to use this in WMI data to provide a link between a driver’s
custom WMI classes and the CIMv2 Win32_PnPEntity class. As this is an
WDF/KMDF driver each WMI instance exposed by the driver already includes

the device instance ID, up to a point, in the auto-generated
InstanceName property. The InstanceName is in fact the device instance
ID suffixed with an underscore and a numeric ID starting at 0. For
example:

Hardware ID: PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01
Device Instance ID:
PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008
WMI Instance Names:
PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_0

PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_1

PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_2
etc.

I’d prefer not to rely upon an implementation detail of WDF (which may
change in future) and force users of my driver’s WMI classes from having

to parse the WMI InstanceName and strip off the “_xxx”. The full device

instance ID isn’t available via
WdfDeviceQueryProperty()/IoGetDeviceProperty() but that does give me the

hardware ID. How can a driver determine the instance ID? or even just
the instance suffix information (4&26a7f3f5&0&0008 in the example above)

to append to the hardware ID to yield the full instance ID?

Best regards,

Andrew


Andrew Lee Solarflare Communications
mailto:xxxxx@solarflare.com http://www.solarflare.com/


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

Doron Holan wrote:

the full pnp instance ID is not exposed to KM drivers (WDM, KMDF), you
can’t get at it.

Thanks for the prompt reply. Since the instance ID is not available to
kernel-mode drivers are there any other device details that I could use
to provide a reference from a driver’s custom WMI information into the
CIMv2 Win32_* instances associated with my device? I would like a user
to be able to query a driver exposed WMI instance and then use some
details from that result to be able to perform a query such as
“ASSOCIATORS OF
{Win32_PnPEntity.DeviceID=“PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&
26A7F3F5&0&0008”}” to return other WMI data associated with the device
(such as Win32_Bus, Win32_SystemDriver, Win32_IRQResource, etc.)

Best regards,

Andrew


Andrew Lee Solarflare Communications
mailto:xxxxx@solarflare.com http://www.solarflare.com/

Register some device interface to your driver, then use its symlink name
string.

It is fine. The Disk/CdRom drivers use these names as MountDev IDs.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

“Andrew Lee” wrote in message news:xxxxx@ntdev…
> How can a driver determine the full Device Instance ID for one of it’s
> own devices?
>
> I want to use this in WMI data to provide a link between a driver’s
> custom WMI classes and the CIMv2 Win32_PnPEntity class. As this is an
> WDF/KMDF driver each WMI instance exposed by the driver already includes
> the device instance ID, up to a point, in the auto-generated
> InstanceName property. The InstanceName is in fact the device instance
> ID suffixed with an underscore and a numeric ID starting at 0. For example:
>
> Hardware ID: PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01
> Device Instance ID:
> PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008
> WMI Instance Names:
> PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_0
>
> PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_1
>
> PCI\VEN_1924&DEV_0703&SUBSYS_00011924&REV_01\4&26a7f3f5&0&0008_2
> etc.
>
> I’d prefer not to rely upon an implementation detail of WDF (which may
> change in future) and force users of my driver’s WMI classes from having
> to parse the WMI InstanceName and strip off the “_xxx”. The full device
> instance ID isn’t available via
> WdfDeviceQueryProperty()/IoGetDeviceProperty() but that does give me the
> hardware ID. How can a driver determine the instance ID? or even just
> the instance suffix information (4&26a7f3f5&0&0008 in the example above)
> to append to the hardware ID to yield the full instance ID?
>
> Best regards,
>
>
> Andrew
>
> –
> Andrew Lee Solarflare Communications
> mailto:xxxxx@solarflare.com http://www.solarflare.com/
>
>
>