https://git.reactos.org/?p=reactos.git;a=commitdiff;h=35cb8f13931bb41dc51b3…
commit 35cb8f13931bb41dc51b38fb3370145f119fdb5d
Author: Hervé Poussineau <hpoussin(a)reactos.org>
AuthorDate: Wed Mar 4 23:43:30 2020 +0100
Commit: Hervé Poussineau <hpoussin(a)reactos.org>
CommitDate: Thu Mar 5 22:47:15 2020 +0100
[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
}
/***********************************************************************