I have a question about IoOpenDeviceInterfaceRegistryKey(). In the WDK
document it syas “The *IoOpenDeviceInterfaceRegistryKey* routine returns a
handle to a registry key for storing information about a particular device
interface instance.”. My question is exactly which registry key this API
opens. The key in HKLM\SYSTEM\CurrentControlSet\Control\Class,
HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses,
HKLM\SYSTEM\CurrentControlSet\Enum or HKLM\SYSTEM\CurrentControlSet\Hardware
Profiles?
If I want to get/set the “CSConfigFlags” value for a specific device
instance under HKLM\SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Enum in my driver, can I use this
*IoOpenDeviceInterfaceRegistryKey* or not? If I couldn’t , which one I
should use? Or I have to manually assemble the registry path for the device
instance and call ZwOpenKey()?
There is no way, or at least no reasonable way, to enable/disable a device
instance in kernel mode, right?
Michael Zhu wrote:
I have a question about IoOpenDeviceInterfaceRegistryKey(). In the WDK
document it syas “The *IoOpenDeviceInterfaceRegistryKey* routine returns
a handle to a registry key for storing information about a particular
device interface instance.”. My question is exactly which registry key
this API opens. The key in HKLM\SYSTEM\CurrentControlSet\Control\Class,
HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses,
HKLM\SYSTEM\CurrentControlSet\Enum or
HKLM\SYSTEM\CurrentControlSet\Hardware Profiles?
If I want to get/set the “CSConfigFlags” value for a specific device
instance under HKLM\SYSTEM\CurrentControlSet\Hardware
Profiles\Current\System\CurrentControlSet\Enum in my driver, can I use
this *IoOpenDeviceInterfaceRegistryKey* or not? If I couldn’t , which
one I should use? Or I have to manually assemble the registry path for
the device instance and call ZwOpenKey()?
If you want “CSConfigFlags”, use *IoOpenDeviceRegistryKey*
with DevInstKeyType =
PLUGPLAY_REGKEY_DEVICE|PLUGPLAY_REGKEY_CURRENT_HWPROFILE
There is no way, or at least no reasonable way, to enable/disable a
device instance in kernel mode, right?
Maybe this is possible thru WMI, though I’m not sure.
Regards,
–PA
You are not supposed to touch this value (besides, its meaning and semantics can and does change from release to release). None of the public (nor private for that matter) APIs will give you the key which contains this value, it is private to the pnp manager. If you are trying to disable a device in kernel mode, forget about it (disable is much more complicated than touching this reg value). Just have a user mode app or service do it.
d
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Michael Zhu
Sent: Thursday, August 21, 2008 7:32 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] About IoOpenDeviceInterfaceRegistryKey()
I have a question about IoOpenDeviceInterfaceRegistryKey(). In the WDK document it syas “The IoOpenDeviceInterfaceRegistryKey routine returns a handle to a registry key for storing information about a particular device interface instance.”. My question is exactly which registry key this API opens. The key in HKLM\SYSTEM\CurrentControlSet\Control\Class, HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses, HKLM\SYSTEM\CurrentControlSet\Enum or HKLM\SYSTEM\CurrentControlSet\Hardware Profiles?
If I want to get/set the “CSConfigFlags” value for a specific device instance under HKLM\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum in my driver, can I use this IoOpenDeviceInterfaceRegistryKey or not? If I couldn’t , which one I should use? Or I have to manually assemble the registry path for the device instance and call ZwOpenKey()?
There is no way, or at least no reasonable way, to enable/disable a device instance in kernel mode, right?
— 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