[ros-diffs] [mjmartin] 38494: - Implement SetupDiSetDeviceInstallParamsA.

mjmartin at svn.reactos.org mjmartin at svn.reactos.org
Wed Dec 31 23:01:59 CET 2008


Author: mjmartin
Date: Wed Dec 31 16:01:58 2008
New Revision: 38494

URL: http://svn.reactos.org/svn/reactos?rev=38494&view=rev
Log:
- Implement SetupDiSetDeviceInstallParamsA.

Modified:
    trunk/reactos/dll/win32/setupapi/devinst.c
    trunk/reactos/dll/win32/setupapi/setupapi.spec

Modified: trunk/reactos/dll/win32/setupapi/devinst.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/devinst.c?rev=38494&r1=38493&r2=38494&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/devinst.c [iso-8859-1] Wed Dec 31 16:01:58 2008
@@ -4242,6 +4242,42 @@
     return ret;
 }
 
+BOOL WINAPI SetupDiSetDeviceInstallParamsA(
+       HDEVINFO DeviceInfoSet,
+       PSP_DEVINFO_DATA DeviceInfoData,
+       PSP_DEVINSTALL_PARAMS_A DeviceInstallParams)
+{
+    SP_DEVINSTALL_PARAMS_W deviceInstallParamsW;
+    int len = 0;
+    BOOL ret = FALSE;
+
+    TRACE("%p %p %p\n", DeviceInfoSet, DeviceInfoData, DeviceInstallParams);
+
+    if (DeviceInstallParams == NULL)
+        SetLastError(ERROR_INVALID_PARAMETER);
+    else if (DeviceInstallParams->cbSize < sizeof(SP_DEVINSTALL_PARAMS_A))
+        SetLastError(ERROR_INVALID_USER_BUFFER);
+    else
+    {
+        memcpy(&deviceInstallParamsW, DeviceInstallParams, FIELD_OFFSET(SP_DEVINSTALL_PARAMS_A, DriverPath));
+        deviceInstallParamsW.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
+        len = MultiByteToWideChar(CP_ACP, 0, DeviceInstallParams->DriverPath, -1, NULL, 0);
+        if (!len)
+        {
+            ERR("DrivePath is NULL\n");
+            ret = FALSE;
+        }
+        else
+        {
+            MultiByteToWideChar(CP_ACP, 0, DeviceInstallParams->DriverPath, -1, deviceInstallParamsW.DriverPath, len);
+            ret = SetupDiSetDeviceInstallParamsW(DeviceInfoSet, DeviceInfoData, &deviceInstallParamsW);
+        }
+    }
+
+    TRACE("Returning %d\n", ret);
+    return ret;
+}
+
 static HKEY
 OpenHardwareProfileKey(
     IN HKEY HKLM,

Modified: trunk/reactos/dll/win32/setupapi/setupapi.spec
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/setupapi/setupapi.spec?rev=38494&r1=38493&r2=38494&view=diff
==============================================================================
--- trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/setupapi/setupapi.spec [iso-8859-1] Wed Dec 31 16:01:58 2008
@@ -382,7 +382,7 @@
 @ stub SetupDiSelectOEMDrv
 @ stdcall SetupDiSetClassInstallParamsA(ptr ptr ptr long)
 @ stdcall SetupDiSetClassInstallParamsW(ptr ptr ptr long)
-@ stub SetupDiSetDeviceInstallParamsA
+@ stdcall SetupDiSetDeviceInstallParamsA(ptr ptr ptr)
 @ stdcall SetupDiSetDeviceInstallParamsW(ptr ptr ptr)
 @ stdcall SetupDiSetDeviceRegistryPropertyA(ptr ptr long ptr long)
 @ stdcall SetupDiSetDeviceRegistryPropertyW(ptr ptr long ptr long)



More information about the Ros-diffs mailing list