CM_Delete_DevNode_Key function (cfgmgr32.h)

The CM_Delete_DevNode_Key function deletes the specified user-accessible registry keys that are associated with a device.

Syntax

CMAPI CONFIGRET CM_Delete_DevNode_Key(
  [in] DEVNODE dnDevNode,
  [in] ULONG   ulHardwareProfile,
  [in] ULONG   ulFlags
);

Parameters

[in] dnDevNode

Device instance handle that is bound to the local machine.

[in] ulHardwareProfile

The hardware profile to delete if ulFlags includes CM_REGISTRY_CONFIG. If this value is zero, the key for the current hardware profile is deleted. If this value is 0xFFFFFFFF, the registry keys for all hardware profiles are deleted.

[in] ulFlags

Delete device node key flags. Indicates the scope and type of registry storage key to delete. Can be a combination of the following flags:

CM_REGISTRY_HARDWARE

Delete the device’s hardware key. Do not combine with CM_REGISTRY_SOFTWARE.

CM_REGISTRY_SOFTWARE

Delete the device’s software key. Do not combine with CM_REGISTRY_HARDWARE.

CM_REGISTRY_USER

Delete the per-user key for the current user. Do not combine with CM_REGISTRY_CONFIG.

CM_REGISTRY_CONFIG

Delete the key that stores hardware profile-specific configuration information. Do not combine with CM_REGISTRY_USER.

Return value

If the operation succeeds, the function returns CR_SUCCESS. Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.

Requirements

Requirement Value
Minimum supported client Available in Microsoft Windows 2000 and later versions of Windows.
Target Platform Universal
Header cfgmgr32.h (include Cfgmgr32.h)
Library Cfgmgr32.lib; OneCoreUAP.lib on Windows 10
DLL CfgMgr32.dll

See also

CM_Open_DevNode_Key

SetupDiDeleteDevRegKey