From 35cb8f13931bb41dc51b38fb3370145f119fdb5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 4 Mar 2020 23:43:30 +0100 Subject: [PATCH] [SETUPAPI] Implement StopDevice() --- dll/win32/setupapi/cfgmgr.c | 2 +- dll/win32/setupapi/devinst.c | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/dll/win32/setupapi/cfgmgr.c b/dll/win32/setupapi/cfgmgr.c index d1a46745b8b..859b0e45b58 100644 --- a/dll/win32/setupapi/cfgmgr.c +++ b/dll/win32/setupapi/cfgmgr.c @@ -1796,7 +1796,7 @@ CM_Disable_DevNode_Ex( LPWSTR lpDevInst; CONFIGRET ret; - FIXME("CM_Disable_DevNode_Ex(%p %lx %p)\n", + TRACE("CM_Disable_DevNode_Ex(%p %lx %p)\n", dnDevInst, ulFlags, hMachine); if (!pSetupIsUserAdmin()) diff --git a/dll/win32/setupapi/devinst.c b/dll/win32/setupapi/devinst.c index 14a9a5faa10..de4080bcf20 100644 --- a/dll/win32/setupapi/devinst.c +++ b/dll/win32/setupapi/devinst.c @@ -5045,12 +5045,28 @@ ResetDevice( #endif } -static BOOL StopDevice( +static BOOL +StopDevice( IN HDEVINFO DeviceInfoSet, IN PSP_DEVINFO_DATA DeviceInfoData) { +#ifndef __WINESRC__ + struct DeviceInfoSet *set = (struct DeviceInfoSet *)DeviceInfoSet; + struct DeviceInfo *deviceInfo = (struct DeviceInfo *)DeviceInfoData->Reserved; + CONFIGRET cr; + + cr = CM_Disable_DevNode_Ex(deviceInfo->dnDevInst, 0, set->hMachine); + if (cr != CR_SUCCESS) + { + SetLastError(GetErrorCodeFromCrCode(cr)); + return FALSE; + } + + return TRUE; +#else FIXME("Stub: StopDevice(%p %p)\n", DeviceInfoSet, DeviceInfoData); return TRUE; +#endif } /***********************************************************************