From 7dd5d44a29facabcb9015b0e7aa17deea97555f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Wed, 26 Oct 2005 20:14:15 +0000 Subject: [PATCH] Open .inf files in directory specified in SP_DEVINSTALL_PARAMS (if any) svn path=/trunk/; revision=18779 --- reactos/lib/setupapi/devinst.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/reactos/lib/setupapi/devinst.c b/reactos/lib/setupapi/devinst.c index 880a5ad0637..8a7d1301a60 100644 --- a/reactos/lib/setupapi/devinst.c +++ b/reactos/lib/setupapi/devinst.c @@ -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) {