From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/kernel32/tests/actctx.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index fa67d37138c..b6b34be87f6 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -3849,7 +3849,7 @@ static void test_one_sxs_and_one_local_2(void) }
-/* Test if we can get a module handle from loaded normal dll while context is active */ +/* Test GetModuleHandleA() with DLL base names in different context states */ static void test_one_with_sxs_and_GetModuleHandleA(void) { sxs_info dll; @@ -3869,13 +3869,32 @@ static void test_one_with_sxs_and_GetModuleHandleA(void) success = ActivateActCtx(dll.handle_context, &dll.cookie); ok(success, "ActivateActCtx failed: %ld\n", GetLastError());
+ /* Loaded normal dll can't be found while context is active */ module_temp = GetModuleHandleA("sxs_dll.dll"); ok (module_temp == 0, "Expected 0, got %p\n", module_temp);
+ dll.module = LoadLibraryA("sxs_dll.dll"); + ok(dll.module != NULL && dll.module != module, "LoadLibrary failed\n"); + + /* Loaded SxS dll should be found while context is active */ + module_temp = GetModuleHandleA("sxs_dll.dll"); + ok(module_temp == dll.module, "Got unexpected module.\n"); + DeactivateActCtx(0, dll.cookie);
+ /* Normal loaded dll should be found while context is inactive */ + module_temp = GetModuleHandleA("sxs_dll.dll"); + todo_wine + ok(module_temp == module, "Got unexpected module.\n"); + if (module) FreeLibrary(module); + + /* Loaded SxS dll can't be found while context is inactive */ + module_temp = GetModuleHandleA("sxs_dll.dll"); + todo_wine + ok(module_temp == NULL, "Got unexpected module.\n"); + if (dll.module) FreeLibrary(dll.module); if (*path_dll_local)