[PATCH v20 0/1] MR10192: kernelbase: Handle \\?\ prefix in GetLongPathNameW
The current implementation of GetLongPathNameW triggers a FIXME and returns the original path when it encounters a UNC prefix. While true network UNC paths remain unimplemented, this change allows extended-length local paths (starting with \\\\?) to be resolved by stripping the prefix and processing the underlying local path. This fixes issues where applications (such as xalia) passing absolute paths with the extended-length prefix would fail to receive a normalized or resolved long path. ``` 881.036:00d4:00d8:fixme:file:GetLongPathNameW UNC pathname L"\\\\?\\Z:\\home\\vishnunithyasoundhars\\.steam\\debian-installation\\compatibilitytools.d\\debug_build\\files\\share\\wine/../xalia/xalia.exe" ``` Tested: After change with added debug log ``` 22272.558:00d4:00d8:fixme:file:GetLongPathNameW DEBUG: Success! Returning path: L"Z:\\home\\vishnunithyasoundhars\\.steam\\debian-installation\\compatibilitytools.d\\debug_build\\files\\share\\wine/../xalia/xalia.exe" (Length: 125) ``` Signed-off-by: Vishnunithyasoundhar S svishnunithyasoundhar@gmail.com -- v20: fix: extended-file-name support https://gitlab.winehq.org/wine/wine/-/merge_requests/10192
From: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> Signed-off-by: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> --- dlls/kernelbase/file.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index c206e2f9cc2..c9e46ab6f5b 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2117,6 +2117,14 @@ DWORD WINAPI DECLSPEC_HOTPATCH GetLongPathNameW( LPCWSTR shortpath, LPWSTR longp return 0; } + /* Handle \\?\ prefix (Extended Length Path) */ + if (shortpath[0] == '\\' && shortpath[1] == '\\' && shortpath[2] == '?' && + shortpath[3] == '\\') + { + if (iswalpha(shortpath[4]) && shortpath[5] == ':' && shortpath[6] == '\\') + return GetLongPathNameW(shortpath + 4, longpath, longlen); + } + if (shortpath[0] == '\\' && shortpath[1] == '\\') { FIXME( "UNC pathname %s\n", debugstr_w(shortpath) ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10192
participants (2)
-
Vishnunithyasoundhar S -
Vishnunithyasoundhar S (ï¼ svishnunithyasoundhar)