From a226e2b7a9651f2d19a953267d3d8ff98d3783e8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 19 Jun 2019 11:47:34 +0200 Subject: [PATCH] ntdll: Use .so builtin if found instead of falling back to the installed PE file. Signed-off-by: Alexandre Julliard --- dlls/ntdll/loader.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 3d747edaba3..43ca7c5d403 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2304,6 +2304,7 @@ static NTSTATUS open_builtin_file( char *name, WINE_MODREF **pwm, void **module, { WARN( "%s found in WINEDLLPATH but not a builtin, ignoring\n", debugstr_a(name) ); NtUnmapViewOfSection( NtCurrentProcess(), *module ); + *module = NULL; status = STATUS_DLL_NOT_FOUND; } @@ -2318,6 +2319,8 @@ static NTSTATUS open_builtin_file( char *name, WINE_MODREF **pwm, void **module, { if ((*so_name = RtlAllocateHeap( GetProcessHeap(), 0, strlen(name) + 1 ))) strcpy( *so_name, name ); + NtUnmapViewOfSection( NtCurrentProcess(), *module ); + *module = NULL; status = STATUS_SUCCESS; } else status = STATUS_IMAGE_MACHINE_TYPE_MISMATCH; @@ -2505,7 +2508,7 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na if (status == STATUS_DLL_NOT_FOUND && *module_ptr) { /* builtin not found, load the module we got previously */ - TRACE( "loading %s from PE builtin %s\n", debugstr_w(name), debugstr_us(nt_name) ); + TRACE( "loading %s from PE file %s\n", debugstr_w(name), debugstr_us(nt_name) ); return load_native_dll( load_path, nt_name, module_ptr, &image_info, flags, pwm, &st ); } if (status) return status;