[PATCH v34 0/1] MR10192: kernelbase: Handle extended length path prefix in GetLongPathNameW
``` Support the \\?\ prefix by skipping it during path resolution while preserving it in the output. Added specific handling for extended UNC paths (\\?\UNC\) to mirror standard UNC behavior, ensuring these paths are treated as network shares and not local devices. Some paths that use the extended length path were filtered out as UNC paths - but not all of them are UNC. There can be UNC path that use extended length path but not all extended length paths are UNC paths. ``` Signed-off-by: Vishnunithyasoundhar S svishnunithyasoundhar@gmail.com -- v34: kernelbase: Handle extended length path prefix in GetLongPathNameW https://gitlab.winehq.org/wine/wine/-/merge_requests/10192
From: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> Support the \\?\ prefix by skipping it during path resolution while preserving it in the output. Added specific handling for extended UNC paths (\\?\UNC\) to mirror standard UNC behavior, ensuring these paths are treated as network shares and not local devices. Some paths that use the extended length path were filtered out as UNC paths - but not all of them are UNC. There can be UNC path that use extended length path but not all extended length paths are UNC paths. Signed-off-by: Vishnunithyasoundhar S <svishnunithyasoundhar@gmail.com> --- dlls/kernelbase/file.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/kernelbase/file.c b/dlls/kernelbase/file.c index 83977a2c40b..a4d85133909 100644 --- a/dlls/kernelbase/file.c +++ b/dlls/kernelbase/file.c @@ -2116,6 +2116,21 @@ 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] == '\\') { + /* Filter out entended UNC */ + if (_wcsnicmp(shortpath + 4, L"UNC\\", 4) == 0) { + lstrcatW(tmplongpath, L"UNC\\"); + lp = sp = 8; + FIXME("UNC Extended pathname %s\n", debugstr_w(shortpath)); + } + else if (shortpath[4] && shortpath[5] == ':') { + tmplongpath[lp++] = shortpath[sp++]; + tmplongpath[lp++] = shortpath[sp++]; + } + } + if (shortpath[0] == '\\' && shortpath[1] == '\\') { FIXME( "UNC pathname %s\n", debugstr_w(shortpath) ); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10192
On Fri Mar 20 21:44:58 2026 +0000, Akihiro Sagawa wrote:
It looks like a test case was dropped somewhere during your Git operations. To make the intent clearer, could you add a todo_wine-style test in addition to the fix. Also, please use a module name prefix in your commit subject. I rebased it - hopefully should have fixed the `test case dropped` that you witnessed.
todo_wine-style test - I will add it. I have edited the commit subject to `kernelbase: Handle extended length path prefix in GetLongPathNameW`. I hope kernelbase is the module name. Thanks -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10192#note_133170
participants (2)
-
Vishnunithyasoundhar S -
Vishnunithyasoundhar S (@svishnunithyasoundhar)