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@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2018-08-23 17:14:18 +03:00 committed by Alexandre Julliard
parent 702e4a4ca1
commit 3acc0b0968
1 changed files with 8 additions and 0 deletions

View File

@ -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);