=?UTF-8?Q?Gabriel=20Iv=C4=83ncescu=20?=: ntdll: Properly set the current directory for UNC paths.

Alexandre Julliard julliard at winehq.org
Fri Aug 24 13:59:14 CDT 2018


Module: wine
Branch: master
Commit: 3acc0b0968fc2fd92220708f6a6629d2dfd28815
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=3acc0b0968fc2fd92220708f6a6629d2dfd28815

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>

---

 dlls/ntdll/path.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 9794b67..11483fa 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -1048,6 +1048,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