diff options
| author | MoonEyes <ducoinbenjamin@yahoo.fr> | 2026-11-28 18:51:52 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-28 18:51:52 +0100 |
| commit | cd124a402ecff17e4da6f7e35942d261d55401b0 (patch) | |
| tree | e47278c6f13ea86d3692db38686a0706daa1ab86 /runtime/test/loader_test.cpp | |
| parent | 4fd360e1ca51cfda629a6f0fa0fc597e463afef3 (diff) | |
| parent | 1a49f137576cc2051a0ee49f3f3731506054e1ce (diff) | |
Merge pull request #2499 from Tyrannys/rt-loader-runtime-scope-and-tls-slot
loader: wide run-time loads are dynamic; set tls_ga_slot before publishing (RT-LOADER-RUNTIME-SCOPE-AND-TLS-SLOT)
Diffstat (limited to 'runtime/test/loader_test.cpp')
| -rw-r--r-- | runtime/test/loader_test.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/runtime/test/loader_test.cpp b/runtime/test/loader_test.cpp index 79e78e32d..aa2dce9d4 100644 --- a/runtime/test/loader_test.cpp +++ b/runtime/test/loader_test.cpp | |||
| @@ -990,6 +990,23 @@ void test_attach_reserved() { | |||
| 990 | } catch (const std::exception& e) { | 990 | } catch (const std::exception& e) { |
| 991 | failed("a run-time load's DllMain gets a NULL lpvReserved", e.what()); | 991 | failed("a run-time load's DllMain gets a NULL lpvReserved", e.what()); |
| 992 | } | 992 | } |
| 993 | |||
| 994 | // The same load through the wide path (LoadLibraryW / LoadLibraryExW). It had no RuntimeLoadScope, so its DllMain | ||
| 995 | // got the static load's non-NULL lpvReserved (RT-LOADER-RUNTIME-SCOPE-AND-TLS-SLOT, @kevincommits on #1608). | ||
| 996 | reset_notifications(); | ||
| 997 | try { | ||
| 998 | write_image_as(make_lifecycle_image(), "attach_reserved_dynamic_w.dll"); | ||
| 999 | rt::Loader loader(g_dir); | ||
| 1000 | bool handled = false; | ||
| 1001 | void* h = loader.load_runtime_module_w(L"attach_reserved_dynamic_w.dll", 0, handled); | ||
| 1002 | const char* what = "a wide run-time load's DllMain gets a NULL lpvReserved"; | ||
| 1003 | if (!handled || !h) failed(what, "the run-time load failed"); | ||
| 1004 | else if (!g_attach_seen) failed(what, "DllMain was not called"); | ||
| 1005 | else if (g_attach_reserved) failed(what, "lpvReserved was non-NULL"); | ||
| 1006 | else pass(what); | ||
| 1007 | } catch (const std::exception& e) { | ||
| 1008 | failed("a wide run-time load's DllMain gets a NULL lpvReserved", e.what()); | ||
| 1009 | } | ||
| 993 | } | 1010 | } |
| 994 | 1011 | ||
| 995 | void test_process_detach_dependencies() { | 1012 | void test_process_detach_dependencies() { |