The SetupDiDeleteDevRegKey function deletes specified user-accessible registry keys that are associated with a device information element.
WINSETUPAPI BOOL SetupDiDeleteDevRegKey( HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, DWORD Scope, DWORD HwProfile, DWORD KeyType );
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.
A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet.
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:
Delete the key that stores global configuration information.
Delete the key that stores hardware profile-specific configuration information.
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.
The type of registry storage key to delete. Can be one of the following values:
Delete the device's hardware key.
Delete the device's software key.
Delete both the hardware and software keys for the device.
The function 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.
The DeviceInfoSet must only contain elements on the local computer.
|Windows version||Available in Microsoft Windows 2000 and later versions of Windows.|
|Header||setupapi.h (include Setupapi.h)|