Platform SDK: Hardware

SetupDiOpenDeviceInterfaceRegKey

The SetupDiOpenDeviceInterfaceRegKey function opens the registry subkey that applications and drivers use to store information specific to a device interface instance. The function returns a handle to the key.

HKEY SetupDiOpenDeviceInterfaceRegKey(
  HDEVINFO DeviceInfoSet,
  PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  DWORD Reserved,
  REGSAM samDesired
);

Parameters

DeviceInfoSet
[in] Pointer to a device information set containing the specified interface and its underlying device.
DeviceInterfaceData
[in] Pointer to a structure that identifies the device interface. This structure is typically returned by the SetupDiEnumDeviceInterfaces function.
Reserved
Reserved; must be zero.
samDesired
[in] Specifies the required access to the registry key.

Return Values

If the function succeeds, the return value is a handle to the opened registry key.

If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

To close the handle returned by this function, call the RegCloseKey function.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 98.
  Header: Declared in Setupapi.h.
  Library: Use Setupapi.lib.

See Also

Device Management Overview, Device Management Functions, SetupDiCreateDeviceInterfaceRegKey, SetupDiEnumDeviceInterfaces