Open .inf files in directory specified in SP_DEVINSTALL_PARAMS (if any)
authorHervé Poussineau <hpoussin@reactos.org>
Wed, 26 Oct 2005 20:14:15 +0000 (20:14 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Wed, 26 Oct 2005 20:14:15 +0000 (20:14 +0000)
svn path=/trunk/; revision=18779

reactos/lib/setupapi/devinst.c

index 880a5ad..8a7d130 100644 (file)
@@ -4325,19 +4325,33 @@ SetupDiBuildDriverInfoList(
         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)
                 {