Fabian Maurer : ntdll: Check the activation context before looking for the module basename.
Alexandre Julliard
julliard at winehq.org
Mon Jun 24 16:06:22 CDT 2019
Module: wine
Branch: master
Commit: 6525a1667311988258c9cb47b695930eef811c70
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6525a1667311988258c9cb47b695930eef811c70
Author: Fabian Maurer <dark.shadow4 at web.de>
Date: Thu Jun 20 17:50:32 2019 +0200
ntdll: Check the activation context before looking for the module basename.
Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/actctx.c | 5 -----
dlls/ntdll/loader.c | 14 ++++++++++----
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c
index 9f2a401..4dede37 100644
--- a/dlls/kernel32/tests/actctx.c
+++ b/dlls/kernel32/tests/actctx.c
@@ -3300,12 +3300,10 @@ static void test_two_dlls_at_same_time(void)
if (!fill_sxs_info(&dll_2, "2", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
goto cleanup;
- todo_wine
ok(dll_1.module != dll_2.module, "Libraries are the same\n");
dll_1.get_path(path1, sizeof(path1));
ok(strcmp(path1, dll_1.path_dll) == 0, "Got '%s', expected '%s'\n", path1, dll_1.path_dll);
dll_2.get_path(path2, sizeof(path2));
- todo_wine
ok(strcmp(path2, dll_2.path_dll) == 0, "Got '%s', expected '%s'\n", path2, dll_2.path_dll);
cleanup:
@@ -3338,10 +3336,8 @@ static void test_one_sxs_and_one_local_1(void)
if (!fill_sxs_info(&dll, "1", "dummy.dll", two_dll_manifest_exe, two_dll_manifest_dll, TRUE))
goto cleanup;
- todo_wine
ok(dll.module != module, "Libraries are the same\n");
dll.get_path(path1, sizeof(path1));
- todo_wine
ok(strcmp(path1, dll.path_dll) == 0, "Got '%s', expected '%s'\n", path1, dll.path_dll);
get_path(path2, sizeof(path2));
ok(strcmp(path2, path_dll_local) == 0, "Got '%s', expected '%s'\n", path2, path_dll_local);
@@ -3417,7 +3413,6 @@ static void test_one_with_sxs_and_GetModuleHandleA(void)
ok(success, "ActivateActCtx failed: %d\n", GetLastError());
module_temp = GetModuleHandleA("sxs_dll.dll");
- todo_wine
ok (module_temp == 0, "Expected 0, got %p\n", module_temp);
DeactivateActCtx(0, dll.cookie);
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 8b42721..67efcaf 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -2693,7 +2693,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
void **module, pe_image_info_t *image_info, struct stat *st )
{
WCHAR *ext, *dllname;
- NTSTATUS status = STATUS_SUCCESS;
+ NTSTATUS status;
/* first append .dll if needed */
@@ -2716,8 +2716,6 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
{
WCHAR *fullname = NULL;
- if ((*pwm = find_basename_module( libname )) != NULL) goto done;
-
status = find_actctx_dll( libname, &fullname );
if (status == STATUS_SUCCESS)
{
@@ -2725,7 +2723,15 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname,
RtlFreeHeap( GetProcessHeap(), 0, dllname );
libname = dllname = fullname;
}
- else if (status != STATUS_SXS_KEY_NOT_FOUND) goto done;
+ else
+ {
+ if (status != STATUS_SXS_KEY_NOT_FOUND) goto done;
+ if ((*pwm = find_basename_module( libname )) != NULL)
+ {
+ status = STATUS_SUCCESS;
+ goto done;
+ }
+ }
}
if (RtlDetermineDosPathNameType_U( libname ) == RELATIVE_PATH)
More information about the wine-cvs
mailing list