CM_Setup_DevNode function
The CM_Setup_DevNode function restarts a device instance that is not running because there is a problem with the device configuration.
Syntax
CMAPI CONFIGRET WINAPI CM_Setup_DevNode( _In_ DEVINST dnDevInst, _In_ ULONG ulFlags );
Parameters
- dnDevInst [in]
-
A device instance handle that is bound to the local system.
- ulFlags [in]
-
One of the following flag values:
- CM_SETUP_DEVNODE_READY
-
Restarts a device instance that is not running because of a problem with the device configuration.
- CM_SETUP_DEVNODE_RESET (Windows XP and later versions of Windows)
-
Resets a device instance that has the no restart device status flag set. The no restart device status flag is set if a device is removed by calling CM_Query_And_Remove_SubTree or CM_Query_And_Remove_SubTree_Ex and specifying the CM_REMOVE_NO_RESTART flag.
Return value
If the operation succeeds, the function returns CR_SUCCESS. Otherwise it returns one of the error codes with "CR_" prefix that are defined in Cfgmgr32.h.
Remarks
Device installation applications should use the DIF_PROPERTYCHANGE request to restart a device instead of using this function. The DIF_PROPERTYCHANGE request can be used to enable, disable, restart, stop, or change the properties of a device.
If a device instance does not have a problem and is already started, CM_Setup_DevNode returns without changing the status of the device instance.
Call CM_Get_DevNode_Status or CM_Get_DevNode_Status_Ex to determine the status and problem code for a device instance.
Requirements
|
Target platform | |
|---|---|
|
Version |
Available in Microsoft Windows 2000 and later versions of Windows. |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- CM_Get_DevNode_Status
- CM_Get_DevNode_Status_Ex
- DIF_PROPERTYCHANGE
- CM_Query_And_Remove_SubTree
- CM_Query_And_Remove_SubTree_Ex