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:
- Check if CM_Get_DevNode_Status returns success. This means that the device is present.
- If the device is present, call CM_Query_And_Remove_SubTree.
- Call CM_Uninstall_DevNode.
Requirements
|
Target platform | |
|---|---|
|
Version |
Available in Microsoft Windows 2000 and later versions of Windows. |
|
Header |
|
|
Library |
|
|
DLL |
|
See also