Export (0) Print
Expand All
Expand Minimize

SetupDiDeleteDevRegKey function

The SetupDiDeleteDevRegKey function deletes specified user-accessible registry keys that are associated with a device information element.

Syntax


BOOL SetupDiDeleteDevRegKey(
  _In_  HDEVINFO DeviceInfoSet,
  _In_  PSP_DEVINFO_DATA DeviceInfoData,
  _In_  DWORD Scope,
  _In_  DWORD HwProfile,
  _In_  DWORD KeyType
);

Parameters

DeviceInfoSet [in]

A handle to the device information set that contains a device information element that represents the device for which to delete registry keys. The device information set must not contain remote elements.

DeviceInfoData [in]

A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet.

Scope [in]

The scope of the registry key to delete. The scope indicates where the information is located. The key can be global or hardware profile-specific. Can be one of the following values:

DICS_FLAG_GLOBAL

Delete the key that stores global configuration information.

DICS_FLAG_CONFIGSPECIFIC

Delete the key that stores hardware profile-specific configuration information.

HwProfile [in]

If Scope is set to DICS_FLAG_CONFIGSPECIFIC, the HwProfile parameter specifies the hardware profile for which to delete the registry key. If HwProfile is 0, the key for the current hardware profile is deleted. If HwProfile is 0xFFFFFFFF, the registry key for all hardware profiles is deleted.

KeyType [in]

The type of registry storage key to delete. Can be one of the following values:

DIREG_DEV

Delete the device's hardware key.

DIREG_DRV

Delete the device's software key.

DIREG_BOTH

Delete both the hardware and software keys for the device.

Return value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved with a call to GetLastError.

Remarks

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

The DeviceInfoSet must only contain elements on the local computer.

Requirements

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Setupapi.h (include Setupapi.h)

Library

Setupapi.lib

See also

SetupDiCreateDevRegKey
SetupDiGetHwProfileList

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft