=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: ntdll: Properly set the current directory for UNC paths.
Alexandre Julliard
julliard at winehq.org
Thu Nov 29 15:09:37 CST 2018
Module: wine
Branch: stable
Commit: 2ac5c5de0faeabfe368f51172e00ed198c4bd843
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2ac5c5de0faeabfe368f51172e00ed198c4bd843
Author: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Date: Thu Aug 23 17:14:18 2018 +0300
ntdll: Properly set the current directory for UNC paths.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=37834
Signed-off-by: Gabriel Ivăncescu <gabrielopcode at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 3acc0b0968fc2fd92220708f6a6629d2dfd28815)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/ntdll/path.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 3062787..89662d8 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -1018,6 +1018,14 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
size -= 4;
if (size && ptr[size - 1] != '\\') ptr[size++] = '\\';
+ /* convert \??\UNC\ path to \\ prefix */
+ if (size >= 4 && !strncmpiW(ptr, UncPfxW, 4))
+ {
+ ptr += 2;
+ size -= 2;
+ *ptr = '\\';
+ }
+
memcpy( curdir->DosPath.Buffer, ptr, size * sizeof(WCHAR));
curdir->DosPath.Buffer[size] = 0;
curdir->DosPath.Length = size * sizeof(WCHAR);
More information about the wine-cvs
mailing list