"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "dlls/ntdll/path.c" between
wine-5.12.tar.xz and wine-5.13.tar.xz

About: Wine is an Open Source implementation of the MS Windows API on top of X, OpenGL, and Unix. Think of Wine as a compatibility layer for running Windows programs. Development release.

path.c  (wine-5.12.tar.xz):path.c  (wine-5.13.tar.xz)
skipping to change at line 545 skipping to change at line 545
ptr = skip_unc_prefix( cd->Buffer ); ptr = skip_unc_prefix( cd->Buffer );
mark = ptr - cd->Buffer; mark = ptr - cd->Buffer;
} }
else mark = 3; else mark = 3;
break; break;
case ABSOLUTE_PATH: /* \xxx */ case ABSOLUTE_PATH: /* \xxx */
if (name[0] == '/') /* may be a Unix path */ if (name[0] == '/') /* may be a Unix path */
{ {
char *unix_name; char *unix_name;
ANSI_STRING unix_str; WCHAR *nt_str;
UNICODE_STRING nt_str; SIZE_T buflen;
NTSTATUS status;
unix_name = RtlAllocateHeap( GetProcessHeap(), 0, 3 * wcslen(name) + 1 ); unix_name = RtlAllocateHeap( GetProcessHeap(), 0, 3 * wcslen(name) + 1 );
ntdll_wcstoumbs( name, wcslen(name) + 1, unix_name, 3 * wcslen(name) + 1, FALSE ); ntdll_wcstoumbs( name, wcslen(name) + 1, unix_name, 3 * wcslen(name) + 1, FALSE );
RtlInitAnsiString( &unix_str, unix_name ); buflen = strlen(unix_name) + 10;
unix_funcs->unix_to_nt_file_name( &unix_str, &nt_str ); for (;;)
RtlFreeAnsiString( &unix_str );
if (nt_str.Length > 5 * sizeof(WCHAR) && nt_str.Buffer[5] == ':')
{ {
reqsize = nt_str.Length - 3 * sizeof(WCHAR); if (!(nt_str = RtlAllocateHeap( GetProcessHeap(), 0, buflen * si
zeof(WCHAR) ))) break;
status = unix_funcs->unix_to_nt_file_name( unix_name, nt_str, &b
uflen );
if (status != STATUS_BUFFER_TOO_SMALL) break;
RtlFreeHeap( GetProcessHeap(), 0, nt_str );
}
RtlFreeHeap( GetProcessHeap(), 0, unix_name );
if (!status && buflen > 6 && nt_str[5] == ':')
{
reqsize = (buflen - 4) * sizeof(WCHAR);
if (reqsize <= size) if (reqsize <= size)
{ {
memcpy( buffer, nt_str.Buffer + 4, reqsize ); memcpy( buffer, nt_str + 4, reqsize );
collapse_path( buffer, 3 ); collapse_path( buffer, 3 );
reqsize -= sizeof(WCHAR); reqsize -= sizeof(WCHAR);
} }
RtlFreeUnicodeString( &nt_str ); RtlFreeHeap( GetProcessHeap(), 0, nt_str );
goto done; goto done;
} }
RtlFreeHeap( GetProcessHeap(), 0, nt_str );
} }
if (cd->Buffer[1] == ':') if (cd->Buffer[1] == ':')
{ {
reqsize = 2 * sizeof(WCHAR); reqsize = 2 * sizeof(WCHAR);
tmp[0] = cd->Buffer[0]; tmp[0] = cd->Buffer[0];
tmp[1] = ':'; tmp[1] = ':';
ins_str = tmp; ins_str = tmp;
mark = 3; mark = 3;
} }
else else
skipping to change at line 888 skipping to change at line 896
out: out:
RtlFreeUnicodeString( &newdir ); RtlFreeUnicodeString( &newdir );
RtlReleasePebLock(); RtlReleasePebLock();
return nts; return nts;
} }
/****************************************************************** /******************************************************************
* wine_unix_to_nt_file_name (NTDLL.@) Not a Windows API * wine_unix_to_nt_file_name (NTDLL.@) Not a Windows API
*/ */
NTSTATUS CDECL wine_unix_to_nt_file_name( const ANSI_STRING *name, UNICODE_STRIN G *nt ) NTSTATUS CDECL wine_unix_to_nt_file_name( const char *name, WCHAR *buffer, SIZE_ T *size )
{ {
unsigned int lenW, lenA = name->Length; return unix_funcs->unix_to_nt_file_name( name, buffer, size );
const char *path = name->Buffer;
if (!lenA) return STATUS_INVALID_PARAMETER;
if (path[0] != '/') /* relative path name */
{
WCHAR *tmp;
NTSTATUS status;
if (!(tmp = RtlAllocateHeap( GetProcessHeap(), 0, (lenA + 1) * sizeof(WC
HAR) )))
return STATUS_NO_MEMORY;
lenW = ntdll_umbstowcs( path, lenA, tmp, lenA );
tmp[lenW] = 0;
status = RtlDosPathNameToNtPathName_U_WithStatus( tmp, nt, NULL, NULL );
RtlFreeHeap( GetProcessHeap(), 0, tmp );
return status;
}
return unix_funcs->unix_to_nt_file_name( name, nt );
} }
 End of changes. 8 change blocks. 
30 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)