Skip to content
Snippets Groups Projects
Commit 664ce4e0 authored by Lois Gomez's avatar Lois Gomez
Browse files

kernelbase: Workaound for SetCurrentDirectoryW misuse

parent 5bfbeb67
No related branches found
No related tags found
No related merge requests found
Pipeline #35926 canceled
......@@ -966,6 +966,13 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
ptr = newdir.Buffer;
ptr += 4; /* skip \??\ prefix */
size -= 4;
/* remove trailing '.' if present */
if (size && ptr[size - 1] == '.' && (size == 1 || ptr[size - 2] == '\\'))
{
size--;
}
if (size && ptr[size - 1] != '\\') ptr[size++] = '\\';
/* convert \??\UNC\ path to \\ prefix */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment