CM_Delete_Class_Key function (cfgmgr32.h)

The CM_Delete_Class_Key function removes the specified installed device class from the system.

Syntax

CMAPI CONFIGRET CM_Delete_Class_Key(
  [in] LPGUID ClassGuid,
  [in] ULONG  ulFlags
);

Parameters

[in] ClassGuid

Pointer to the GUID of the device class to remove.

[in] ulFlags

Delete class key flags:

CM_DELETE_CLASS_ONLY

Delete the class only if it does not contain any subkeys.

CM_DELETE_CLASS_SUBKEYS

Delete the class and all of its subkeys.

CM_DELETE_CLASS_INTERFACE (available only in Windows Vista and later)

Indicates that ClassGuid specifies a device interface class and not a device setup class.

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_Class_Key