Alexandre Julliard : ntdll: Only pass the NT path name to open_dll_file().
Alexandre Julliard
julliard at winehq.org
Mon Apr 22 16:30:38 CDT 2019
Module: wine
Branch: master
Commit: ea9cc97e2ef3133d2da7b48d8c11786fe61abbbe
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ea9cc97e2ef3133d2da7b48d8c11786fe61abbbe
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Apr 22 11:36:39 2019 +0200
ntdll: Only pass the NT path name to open_dll_file().
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/loader.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index fa8d1f8..de218c7 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1991,7 +1991,7 @@ static BOOL is_valid_binary( HMODULE module, const pe_image_info_t *info )
*
* Open a file for a new dll. Helper for find_dll_file.
*/
-static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_MODREF **pwm,
+static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm,
void **module, pe_image_info_t *image_info, struct stat *st )
{
FILE_BASIC_INFORMATION info;
@@ -2003,9 +2003,6 @@ static NTSTATUS open_dll_file( const WCHAR *name, UNICODE_STRING *nt_name, WINE_
HANDLE handle, mapping;
int fd, needs_close;
- nt_name->Buffer = NULL;
- if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) return status;
-
if ((*pwm = find_fullname_module( nt_name ))) return STATUS_SUCCESS;
attr.Length = sizeof(attr);
@@ -2397,7 +2394,11 @@ static NTSTATUS search_dll_file( LPCWSTR paths, LPCWSTR search, UNICODE_STRING *
memcpy( name, paths, len * sizeof(WCHAR) );
if (len && name[len - 1] != '\\') name[len++] = '\\';
strcpyW( name + len, search );
- status = open_dll_file( name, nt_name, pwm, module, image_info, st );
+
+ nt_name->Buffer = NULL;
+ if ((status = RtlDosPathNameToNtPathName_U_WithStatus( name, nt_name, NULL, NULL ))) goto done;
+
+ status = open_dll_file( nt_name, pwm, module, image_info, st );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) found_image = TRUE;
else if (status != STATUS_DLL_NOT_FOUND) goto done;
RtlFreeUnicodeString( nt_name );
@@ -2466,8 +2467,8 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH)
status = search_dll_file( load_path, libname, nt_name, pwm, module, image_info, st );
- else
- status = open_dll_file( libname, nt_name, pwm, module, image_info, st );
+ else if (!(status = RtlDosPathNameToNtPathName_U_WithStatus( libname, nt_name, NULL, NULL )))
+ status = open_dll_file( nt_name, pwm, module, image_info, st );
if (status == STATUS_IMAGE_MACHINE_TYPE_MISMATCH) status = STATUS_INVALID_IMAGE_FORMAT;
More information about the wine-cvs
mailing list