Thanks for trying.
IRP_MN_QUERY_ID can get the device ID
(SCSI\DISK&VEN_SEAGATE&PROD_ST118273_CLAR18&REV_351B) and the instance
ID (000). The DDK documents that these two together, and possibly some
other information, make up the unique device instance ID. The reason
for the “other information” is that the instance ID retrieved via
IRP_MN_QUERY_ID is not guaranteed to be unique across all busses on the
system. Windows does not necessarily expect a bus driver to be able to
generate an instance ID that is different from IDs generated for devices
on other buses, which the particular bus driver may or may not control
or be aware of. The bus driver reports whether it can do this or not
via the UniqueID flag in the DEVICE_CAPABILITIES struct returned for
IRP_MN_QUERY_CAPABILITIES.
For these reasons, I do not believe PnP Mgr uses the documented IRPs
alone to query the strings used in configuration manager APIs, though
it must use them to assemble the full instance ID initially.
I have determined that the PDO’s DEVOBJ_EXTENSION contains, in the
opaque part, a pointer to a devnode structure (completely undocumented
as far as I can tell) which contains a UNICODE_STRING, which is the
fully-qualified instance-specific ID. I imagine that the user-mode
portion of PnP Mgr has access to this. Sure would be nice if I did.
I am determining what the device instance ID string *should* be by
walking the devnode tree in user-mode and querying & displaying all
their ID strings. While there are many devnodes, there is only one
SCSI disk of the type I’ve mentioned in the system, so it is easy
enough to find.
I’ll attach the code for anyone who is interested. I don’t guarantee
it will compile as-is; I’ve stripped out stuff that is specific to our
product, including main().
Dave Cox
Hewlett-Packard Co.
HPSO/SSMO (Santa Barbara)
https://ecardfile.com/id/Dave+Cox
-----Original Message-----
From: Matt A. [mailto:xxxxx@motu.com]
Sent: Monday, May 01, 2000 6:02 PM
To: NT Developers Interest List
Subject: [ntdev] Re: PDO to device instance ID?
I’m sorry, you are right. IoGetDeviceProperty() can only get you a
“hardware ID” (non-instance specific). You’re after an instance-specific
“device ID”.
AFAIK, the device ID can be obtained by sending a IRP_MN_QUERY_ID to the
PDO – which is presumably the same way the Plug and Play Manager does it.
Why this method isn’t retrieving the “whole” ID for you, I don’t know.
How are you determining what your “corresponding device instance ID” (that
you’ve shown below) should be? That is, how do you know this is the
expected ID? – where is it showing up?
----- Original Message -----
From: “COX,DAVID (HP-Roseville,ex1)” <david_cox2>
Sent: Monday, May 01, 2000 5:05 PM
> Which DeviceProperty do you propose I query? I’ve tried
>
> DevicePropertyCompatibleIDs,
> DevicePropertyHardwareID(s),
> DevicePropertyFriendlyName and
> DevicePropertyPhysicalDeviceObjectName.
>
> None of these return the entire device instance (node) ID string, or
> the particular piece that I am missing (“3&5CE303&1&” in my previous
> example).
>
> DevicePropertyHardwareID returns strings like
>
> SCSI\DiskSEAGATE_ST118273_CLAR18_351B
>
> whereas the corresponding device instance ID is
>
> SCSI\DISK&VEN_SEAGATE&PROD_ST118273_CLAR18&REV_351B\3&5CE303&1&000.
[snip]
—
You are currently subscribed to ntdev as: david_cox2@hp.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)</david_cox2>