From 91bbc46c99dd850fad8c07e42c88ba36cc1df9ce Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 24 Jun 2019 10:30:51 +0200 Subject: [PATCH] ntdll: Try to use the name of the PE file also when loading .so builtin. Signed-off-by: Alexandre Julliard --- dlls/kernel32/tests/actctx.c | 1 - dlls/ntdll/loader.c | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index b7242afcf4c..9f2a401d2ce 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -3481,7 +3481,6 @@ static void test_builtin_sxs(void) GetModuleFileNameA(module_msvcp, path_msvcp, sizeof(path_msvcp)); GetModuleFileNameA(module_msvcr, path_msvcr, sizeof(path_msvcr)); ok(strnicmp(expected_path, path_msvcp, strlen(expected_path)) == 0, "Expected path to start with %s, got %s\n", expected_path, path_msvcp); - todo_wine ok(strnicmp(expected_path, path_msvcr, strlen(expected_path)) == 0, "Expected path to start with %s, got %s\n", expected_path, path_msvcr); DeactivateActCtx(0, cookie); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 43ca7c5d403..8b427214c88 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2427,7 +2427,7 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, } info.load_path = load_path; - info.filename = so_name ? NULL : nt_name; + info.filename = nt_name; info.status = STATUS_SUCCESS; info.wm = NULL; @@ -2528,7 +2528,9 @@ static NTSTATUS load_builtin_dll( LPCWSTR load_path, const UNICODE_STRING *nt_na return load_native_dll( load_path, nt_name, module_ptr, &image_info, flags, pwm, &st ); } - return load_so_dll( load_path, nt_name, so_name, pwm ); + status = load_so_dll( load_path, nt_name, so_name, pwm ); + RtlFreeHeap( GetProcessHeap(), 0, so_name ); + return status; }