Discussion:
How to get device key (hardware key) path in kernel mode ?
(too old to reply)
Kid
2010-08-15 09:33:03 UTC
Permalink
Hi

I want to get the hardware key path as the instance ID for my WMI event .

Here is some WDM function IoOpenDeviceRegistryKey to open hardware key,
but I can not get the hardware key path name in the tree of
HKLM\SYSTEM\CurrentControlSet\Enum .

Is there some way to get device key (hardware key) path in kernel mode ?

Thank you .
Maxim S. Shatskih
2010-08-15 10:36:33 UTC
Permalink
Post by Kid
Is there some way to get device key (hardware key) path in kernel mode ?
No ways.

For instance IDs, create a device interface on your device and use its string as an ID, this is the classic way.
--
Maxim S. Shatskih
Windows DDK MVP
***@storagecraft.com
http://www.storagecraft.com
Kid
2010-08-15 11:41:03 UTC
Permalink
But I found root\wmi Monitor Brightness event use hardware key path based
name as its instance
ID, do you know how can they approach it ?

What do you mean create an interface , which function can I use ?

I would like to use the software key as my instance ID, it is unique too and
we can get it by
WdfDeviceAllocAndQueryProperty function with
property=DevicePropertyDriverKeyName .

How do you think about software key ?
Post by Maxim S. Shatskih
Post by Kid
Is there some way to get device key (hardware key) path in kernel mode ?
No ways.
For instance IDs, create a device interface on your device and use its string as an ID, this is the classic way.
--
Maxim S. Shatskih
Windows DDK MVP
http://www.storagecraft.com
.
Doron Holan [MSFT]
2010-08-16 03:56:02 UTC
Permalink
WMI lets you do this without knowing the key by specifying
WMIREG_FLAG_INSTANCE_PDO when you register the instance with wmi

d

"Kid" wrote in message news:BD52F2E4-99C0-4CD0-AE27-***@microsoft.com...

But I found root\wmi Monitor Brightness event use hardware key path based
name as its instance
ID, do you know how can they approach it ?

What do you mean create an interface , which function can I use ?

I would like to use the software key as my instance ID, it is unique too and
we can get it by
WdfDeviceAllocAndQueryProperty function with
property=DevicePropertyDriverKeyName .

How do you think about software key ?
Post by Maxim S. Shatskih
Post by Kid
Is there some way to get device key (hardware key) path in kernel mode ?
No ways.
For instance IDs, create a device interface on your device and use its
string as an ID, this is the classic way.
--
Maxim S. Shatskih
Windows DDK MVP
http://www.storagecraft.com
.
Pavel A.
2010-08-16 01:07:24 UTC
Permalink
Post by Kid
Hi
I want to get the hardware key path as the instance ID for my WMI event .
Here is some WDM function IoOpenDeviceRegistryKey to open hardware key,
but I can not get the hardware key path name in the tree of
HKLM\SYSTEM\CurrentControlSet\Enum .
Is there some way to get device key (hardware key) path in kernel mode ?
To get the key name, use ZwQueryKey( ... KEY_NAME_INFORMATION.. )

-- pa
Loading...