]> git.ipfire.org Git - thirdparty/pciutils.git/commitdiff
libpci: win32-cfgmgr32: Fix handling of "\\??\\C:\\..." driver paths master
authorPali Rohár <pali@kernel.org>
Sat, 20 Dec 2025 19:56:27 +0000 (20:56 +0100)
committerMartin Mareš <mj@ucw.cz>
Sun, 28 Dec 2025 20:49:06 +0000 (21:49 +0100)
lib/win32-cfgmgr32.c

index 40065f4db424d66c700a1d6d3c82e795f8c87017..11d05e918f3b4045cfa827b603649c4efdf87c82 100644 (file)
@@ -464,7 +464,7 @@ retry_service_config:
   else if (wcsncmp(service_config->lpBinaryPathName, L"\\??\\", sizeof("\\??\\")-1) == 0 &&
            ((service_config->lpBinaryPathName[4] >= L'A' && service_config->lpBinaryPathName[4] <= L'Z') ||
             (service_config->lpBinaryPathName[4] >= L'a' && service_config->lpBinaryPathName[4] <= L'z')) &&
   else if (wcsncmp(service_config->lpBinaryPathName, L"\\??\\", sizeof("\\??\\")-1) == 0 &&
            ((service_config->lpBinaryPathName[4] >= L'A' && service_config->lpBinaryPathName[4] <= L'Z') ||
             (service_config->lpBinaryPathName[4] >= L'a' && service_config->lpBinaryPathName[4] <= L'z')) &&
-           service_config->lpBinaryPathName[5] == L'\\')
+           service_config->lpBinaryPathName[5] == L':' && service_config->lpBinaryPathName[6] == L'\\')
     {
       /* ImagePath is in NT GLOBAL?? namespace with drive letter, so just remove "\\??\\" prefix to get Win32 path. */
       service_image_path = pci_malloc(a, sizeof(WCHAR) * (wcslen(service_config->lpBinaryPathName) - (sizeof("\\??\\")-1) + 1));
     {
       /* ImagePath is in NT GLOBAL?? namespace with drive letter, so just remove "\\??\\" prefix to get Win32 path. */
       service_image_path = pci_malloc(a, sizeof(WCHAR) * (wcslen(service_config->lpBinaryPathName) - (sizeof("\\??\\")-1) + 1));