SetupDiDeleteDeviceInterfaceRegKey function

The SetupDiDeleteDeviceInterfaceRegKey function deletes the registry subkey that is used by applications and drivers to store interface-specific information.


WINSETUPAPI BOOL SetupDiDeleteDeviceInterfaceRegKey(
  HDEVINFO                  DeviceInfoSet,
  DWORD                     Reserved



A pointer to a device information set that contains the interface for which to delete interface-specific information in the registry. The device information set must not contain remote elements.


A pointer to an SP_DEVICE_INTERFACE_DATA structure that specifies the device interface in DeviceInfoSet. This pointer is possibly returned by SetupDiCreateDeviceInterface or SetupDiEnumDeviceInterfaces.


Reserved. Must be zero.

Return Value

SetupDiDeleteDeviceInterfaceRegKey returns TRUE if it is successful; otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.


The caller of this function must be a member of the Administrators group.

SetupDiDeleteDeviceInterfaceRegKey deletes the subkey used by drivers and applications to store information about the device interface instance. This subkey was created by SetupDiCreateDeviceInterfaceRegKey or by the driver's call to an associated I/O manager routine. SetupDiDeleteDeviceInterfaceRegKey does not affect the main registry key for the device interface instance nor any other subkeys that may have been created.

The DeviceInfoSet must only contain elements on the local computer.


Windows version Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Desktop
Header setupapi.h (include Setupapi.h)
Library Setupapi.lib
DLL Setupapi.dll

See Also