forked from Mirrors/wine-wine
ntdll: Actually return an NT path in wine_unix_to_nt_file_name() for relative paths.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>master
parent
cee48cc789
commit
a2c890c1e1
|
@ -986,24 +986,15 @@ NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRIN
|
||||||
if (path[0] != '/') /* relative path name */
|
if (path[0] != '/') /* relative path name */
|
||||||
{
|
{
|
||||||
WCHAR *tmp;
|
WCHAR *tmp;
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
path++;
|
|
||||||
lenA--;
|
|
||||||
if (!(tmp = RtlAllocateHeap( GetProcessHeap(), 0, (lenA + 1) * sizeof(WCHAR) )))
|
if (!(tmp = RtlAllocateHeap( GetProcessHeap(), 0, (lenA + 1) * sizeof(WCHAR) )))
|
||||||
return STATUS_NO_MEMORY;
|
return STATUS_NO_MEMORY;
|
||||||
lenW = ntdll_umbstowcs( path, lenA, tmp, lenA );
|
lenW = ntdll_umbstowcs( path, lenA, tmp, lenA );
|
||||||
tmp[lenW] = 0;
|
tmp[lenW] = 0;
|
||||||
lenW = RtlGetFullPathName_U( tmp, 0, NULL, NULL );
|
status = RtlDosPathNameToNtPathName_U_WithStatus( tmp, nt, NULL, NULL );
|
||||||
if (!lenW || !(nt->Buffer = RtlAllocateHeap( GetProcessHeap(), 0, lenW )))
|
|
||||||
{
|
|
||||||
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 );
|
RtlFreeHeap( GetProcessHeap(), 0, tmp );
|
||||||
return STATUS_SUCCESS;
|
return status;
|
||||||
}
|
}
|
||||||
return unix_funcs->unix_to_nt_file_name( name, nt );
|
return unix_funcs->unix_to_nt_file_name( name, nt );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue