The CM_Setup_DevNode function restarts a device instance that is not running because there is a problem with the device configuration.
CMAPI CONFIGRET CM_Setup_DevNode( DEVINST dnDevInst, ULONG ulFlags );
A device instance handle that is bound to the local system.
One of the following flag values:
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.
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.
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.
|Minimum supported client||Available in Microsoft Windows 2000 and later versions of Windows.|
|Header||cfgmgr32.h (include Cfgmgr32.h)|
|Library||Cfgmgr32.lib; OneCoreUAP.lib on Windows 10|