From: Pali Rohár Date: Sat, 20 Dec 2025 19:56:27 +0000 (+0100) Subject: libpci: win32-cfgmgr32: Fix handling of "\\??\\C:\\..." driver paths X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;ds=inline;p=thirdparty%2Fpciutils.git libpci: win32-cfgmgr32: Fix handling of "\\??\\C:\\..." driver paths --- diff --git a/lib/win32-cfgmgr32.c b/lib/win32-cfgmgr32.c index 40065f4..11d05e9 100644 --- a/lib/win32-cfgmgr32.c +++ b/lib/win32-cfgmgr32.c @@ -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')) && - 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));