Platform SDK: Hardware

SetupDiCreateDeviceInterfaceRegKey

The SetupDiCreateDeviceInterfaceRegKey function creates a registry key for storing information about a device interface instance.

HKEY SetupDiCreateDeviceInterfaceRegKey(
  HDEVINFO DeviceInfoSet,
  PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData,
  DWORD Reserved,
  REGSAM samDesired,
  HINF InfHandle, 
  PCTSTR InfSectionName 
);

Parameters

DeviceInfoSet
[in] Pointer to a device information set containing the interface and its underlying device. The device information set must not contain remote devices.
DeviceInterfaceData
[in] Pointer to an SP_DEVICE_INTERFACE_DATA structure that identifies the device interface.
Reserved
Reserved; must be zero.
samDesired
[in] Specifies the registry access to the key to be created.
InfHandle
[in] Optionally specifies the handle to an open .inf file that contains an Install section to be executed for the newly created key. If this parameter is not NULL, the InfSectionName parameter must be specified as well.
InfSectionName
[in] An optional pointer to the name of an Install section in the .inf file specified by the InfHandle parameter. This section is executed for the newly created key. If this parameter is not NULL, InfHandle must be specified as well.

Return Values

If the function succeeds, it returns a handle to the newly created registry key.

If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.

Remarks

The SetupDiCreateDeviceInterfaceRegKey function creates a nonvolatile subkey of the registry key for the specified device interface. This subkey is used to store private configuration data for the device interface.

To close the handle returned from 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, SetupDiDeleteDeviceInterfaceRegKey, SetupDiOpenDeviceInterfaceRegKey, SP_DEVICE_INTERFACE_DATA