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 CM_Setup_DevNode(
  DEVINST dnDevInst,
  ULONG   ulFlags
);

Parameters

dnDevInst

A device instance handle that is bound to the local system.

ulFlags

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

   
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_Get_DevNode_Status

CM_Get_DevNode_Status_Ex

CM_Query_And_Remove_SubTree

CM_Query_And_Remove_SubTree_Ex

DIF_PROPERTYCHANGE