ntdll: Actually return an NT path in wine_unix_to_nt_file_name() for relative paths.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-06-19 18:34:19 +02:00
parent cee48cc789
commit a2c890c1e1
1 changed files with 3 additions and 12 deletions

View File

@ -986,24 +986,15 @@ NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRIN
if (path[0] != '/') /* relative path name */
{
WCHAR *tmp;
NTSTATUS status;
path++;
lenA--;
if (!(tmp = RtlAllocateHeap( GetProcessHeap(), 0, (lenA + 1) * sizeof(WCHAR) )))
return STATUS_NO_MEMORY;
lenW = ntdll_umbstowcs( path, lenA, tmp, lenA );
tmp[lenW] = 0;
lenW = RtlGetFullPathName_U( tmp, 0, NULL, NULL );
if (!lenW || !(nt->Buffer = RtlAllocateHeap( GetProcessHeap(), 0, lenW )))
{
status = RtlDosPathNameToNtPathName_U_WithStatus( tmp, nt, NULL, NULL );
RtlFreeHeap( GetProcessHeap(), 0, tmp );
return STATUS_NO_MEMORY;
}
lenW = RtlGetFullPathName_U( tmp, lenW, nt->Buffer, NULL );
nt->Length = lenW;
nt->MaximumLength = lenW + sizeof(WCHAR);
RtlFreeHeap( GetProcessHeap(), 0, tmp );
return STATUS_SUCCESS;
return status;
}
return unix_funcs->unix_to_nt_file_name( name, nt );
}