The CM_Disable_DevNode function disables a device.
Syntax
CMAPI CONFIGRET CM_Disable_DevNode(
[in] DEVINST dnDevInst,
[in] ULONG ulFlags
);
Parameters
[in] dnDevInst
ローカル コンピューターにバインドされているデバイス インスタンス ハンドル。
[in] ulFlags
Disable flags:
CM_DISABLE_UI_NOT_OK
デバイスの無効化が失敗した場合は、ユーザーにインターフェイスを表示しないでください。
CM_DISABLE_PERSIST (Windows 10 以降のバージョンの Windows)
再起動の間にデバイスを無効にします。
Return value
操作が成功した場合、関数はCR_SUCCESSを返します。 Otherwise, it returns one of the CR_-prefixed error codes defined in Cfgmgr32.h.
Remarks
By default, CM_Disable_DevNode disables a device at one time, but after reboot the device is enabled again. Starting in Windows 10, you can specify the CM_DISABLE_PERSIST flag to disable the device across reboots.
Requirements
| Requirement | Value |
|---|---|
| サポートされる最小クライアント | Microsoft Windows 2000 以降のバージョンの Windows で使用できます。 |
| Target Platform | Universal |
| Header | cfgmgr32.h (Cfgmgr32.h を含む) |
| Library | Cfgmgr32.lib;Windows 10 の OneCoreUAP.lib |
| DLL | CfgMgr32.dll |