Commit 3acc0b09 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

ntdll: Properly set the current directory for UNC paths.

parent 702e4a4c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment