CM_Uninstall_DevNode function

The CM_Uninstall_DevNode function removes all persistent state associated with a device instance.

Syntax


CMAPI
CONFIGRET
WINAPI CM_Uninstall_DevNode(
  _In_ DEVNODE dnDevInst,
  _In_ ULONG   ulFlags
);

Parameters

dnDevInst [in]

Device instance handle that is bound to the local machine.

ulFlags [in]

Reserved. Must be set to zero.

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.

Remarks

This function uninstalls the device without sending an IRP_MN_QUERY_REMOVE_DEVICE request or calling class installers or co-installers. If your application will run only on a Target Platform of Desktop, instead of calling CM_Uninstall_DevNode, the application should uninstall the device by calling SetupDiCallClassInstaller with the DIF_REMOVE code, or by calling DiUninstallDevice.

Use the following sequence to call this function:

  1. Check if CM_Get_DevNode_Status returns success. This means that the device is present.
  2. If the device is present, call CM_Query_And_Remove_SubTree.
  3. Call CM_Uninstall_DevNode.

Requirements

Target platform

Universal

Version

Available in Microsoft Windows 2000 and later versions of Windows.

Header

Cfgmgr32.h (include Cfgmgr32.h)

Library

Cfgmgr32.lib;
OneCoreUAP.lib on Windows 10

DLL

CfgMgr32.dll

See also

SetupDiCallClassInstaller

 

 

Send comments about this topic to Microsoft

Show: