DiOpenDevRegKey

RETERR DiOpenDevRegKey(LPDEVICE_INFO lpdi, LPHKEY lphk, int iFlags)
 

This API will open either of the registry keys associated with a device.

lpdi
A device info struct for device who's registry key is being opened.
lphk
Buffer to receive the opened registry key.
iFlags
Flags indicating which type of regkey to create.
DIREG_DEV Open the hardware registry key for the device. This is a key that exists in the \ENUM\ROOT branch.
DIREG_DRV Open the software, or Driver, registry key for the device. This is a key that is in the HKLM\System\CurrentControlSet\Services\Class registry subkey.

Note that it is the callers responsibility to close the returned registry key when it is finished with it.