Zebediah Figura : setupapi: Implement SetupDiSetDeviceInstallParams().

Alexandre Julliard julliard at winehq.org
Thu May 16 16:26:57 CDT 2019


Module: wine
Branch: master
Commit: 14a354e5756c3c25cf6d8402d1458d5182102451
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=14a354e5756c3c25cf6d8402d1458d5182102451

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed May 15 22:56:07 2019 -0500

setupapi: Implement SetupDiSetDeviceInstallParams().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Aric Stewart <aric at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/setupapi/devinst.c | 48 +++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 37 insertions(+), 11 deletions(-)

diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index 8c91960..48b6ca3 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -3559,25 +3559,51 @@ BOOL WINAPI SetupDiGetDeviceInstallParamsA(HDEVINFO devinfo,
 /***********************************************************************
  *              SetupDiSetDeviceInstallParamsA  (SETUPAPI.@)
  */
-BOOL WINAPI SetupDiSetDeviceInstallParamsA(
-       HDEVINFO DeviceInfoSet,
-       PSP_DEVINFO_DATA DeviceInfoData,
-       PSP_DEVINSTALL_PARAMS_A DeviceInstallParams)
+BOOL WINAPI SetupDiSetDeviceInstallParamsA(HDEVINFO devinfo,
+        SP_DEVINFO_DATA *device_data, SP_DEVINSTALL_PARAMS_A *params)
 {
-    FIXME("(%p, %p, %p) stub\n", DeviceInfoSet, DeviceInfoData, DeviceInstallParams);
+    SP_DEVINSTALL_PARAMS_W paramsW;
 
-    return TRUE;
+    if (params->cbSize != sizeof(SP_DEVINSTALL_PARAMS_A))
+    {
+        SetLastError(ERROR_INVALID_USER_BUFFER);
+        return FALSE;
+    }
+
+    paramsW.cbSize = sizeof(paramsW);
+    paramsW.Flags = params->Flags;
+    paramsW.FlagsEx = params->FlagsEx;
+    paramsW.hwndParent = params->hwndParent;
+    paramsW.InstallMsgHandler = params->InstallMsgHandler;
+    paramsW.InstallMsgHandlerContext = params->InstallMsgHandlerContext;
+    paramsW.FileQueue = params->FileQueue;
+    paramsW.ClassInstallReserved = params->ClassInstallReserved;
+    paramsW.Reserved = params->Reserved;
+    MultiByteToWideChar(CP_ACP, 0, params->DriverPath, -1, paramsW.DriverPath, sizeof(paramsW.DriverPath));
+
+    return SetupDiSetDeviceInstallParamsW(devinfo, device_data, &paramsW);
 }
 
 /***********************************************************************
  *              SetupDiSetDeviceInstallParamsW  (SETUPAPI.@)
  */
-BOOL WINAPI SetupDiSetDeviceInstallParamsW(
-       HDEVINFO DeviceInfoSet,
-       PSP_DEVINFO_DATA DeviceInfoData,
-       PSP_DEVINSTALL_PARAMS_W DeviceInstallParams)
+BOOL WINAPI SetupDiSetDeviceInstallParamsW(HDEVINFO devinfo,
+        SP_DEVINFO_DATA *device_data, SP_DEVINSTALL_PARAMS_W *params)
 {
-    FIXME("(%p, %p, %p) stub\n", DeviceInfoSet, DeviceInfoData, DeviceInstallParams);
+    struct device *device;
+
+    TRACE("devinfo %p, device_data %p, params %p.\n", devinfo, device_data, params);
+
+    if (params->cbSize != sizeof(SP_DEVINSTALL_PARAMS_W))
+    {
+        SetLastError(ERROR_INVALID_USER_BUFFER);
+        return FALSE;
+    }
+
+    if (!(device = get_device(devinfo, device_data)))
+        return FALSE;
+
+    device->params = *params;
 
     return TRUE;
 }




More information about the wine-cvs mailing list