The SetupDiOpenDeviceInterfaceRegKey function opens the registry subkey that is used by applications and drivers to store information that is specific to a device interface.
WINSETUPAPI HKEY SetupDiOpenDeviceInterfaceRegKey( HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, DWORD Reserved, REGSAM samDesired );
A pointer to a device information set that contains the device interface for which to open a registry subkey.
Reserved. Must be zero.
The requested registry security access to the registry subkey. For information about registry security access values of type REGSAM, see the Microsoft Windows SDK documentation.
SetupDiOpenDeviceInterfaceRegKey returns a handle to the opened registry key. If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
Depending on the value that is passed in the samDesired parameter, it might be necessary for the caller of this function to be a member of the Administrators group.
Close the handle returned from by function by calling RegCloseKey.
|Windows version||Available in Microsoft Windows 2000 and later versions of Windows.|
|Target Platform||DesktopFor universal, call CM_Open_Device_Interface_Key|
|Header||setupapi.h (include Setupapi.h)|