Open .inf files in directory specified in SP_DEVINSTALL_PARAMS (if any)
Modified: trunk/reactos/lib/setupapi/devinst.c

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-10-26 19:00:08 UTC (rev 18778)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-10-26 20:14:15 UTC (rev 18779)
@@ -4325,19 +4325,33 @@
         if (Result)
         {
             LPCWSTR filename;
+            WCHAR FullInfFileName[MAX_PATH];
+            LPWSTR pFullFilename;
 
+            if (*InstallParams.DriverPath)
+            {
+                GetFullPathNameW(InstallParams.DriverPath, MAX_PATH, FullInfFileName, &pFullFilename);
+                if (*FullInfFileName && FullInfFileName[wcslen(FullInfFileName) - 1] != '\\')
+                    wcscat(FullInfFileName, L"\\");
+                pFullFilename = &FullInfFileName[wcslen(FullInfFileName)];
+            }
+            else
+                pFullFilename = &FullInfFileName[0];
+
             for (filename = (LPCWSTR)Buffer; *filename; filename += wcslen(filename) + 1)
             {
                 INFCONTEXT ContextManufacturer, ContextDevice;
                 GUID ClassGuid;
-                TRACE("Opening file %S\n", filename);
 
+                wcscpy(pFullFilename, filename);
+                TRACE("Opening file %S\n", FullInfFileName);
+
                 currentInfFileDetails = HeapAlloc(GetProcessHeap(), 0, sizeof(struct InfFileDetails));
                 if (!currentInfFileDetails)
                     continue;
                 memset(currentInfFileDetails, 0, sizeof(struct InfFileDetails));
 
-                currentInfFileDetails->hInf = SetupOpenInfFileW(filename, NULL, INF_STYLE_WIN4, NULL);
+                currentInfFileDetails->hInf = SetupOpenInfFileW(FullInfFileName, NULL, INF_STYLE_WIN4, NULL);
                 ReferenceInfFile(currentInfFileDetails);
                 if (currentInfFileDetails->hInf == INVALID_HANDLE_VALUE)
                 {