upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test/loader_test.cpp
diff options
context:
space:
mode:
authorMoonEyes <ducoinbenjamin@yahoo.fr>2026-11-28 18:51:52 +0100
committerGitHub <noreply@github.com>2026-11-28 18:51:52 +0100
commitcd124a402ecff17e4da6f7e35942d261d55401b0 (patch)
treee47278c6f13ea86d3692db38686a0706daa1ab86 /runtime/test/loader_test.cpp
parent4fd360e1ca51cfda629a6f0fa0fc597e463afef3 (diff)
parent1a49f137576cc2051a0ee49f3f3731506054e1ce (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.cpp17
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
995void test_process_detach_dependencies() { 1012void test_process_detach_dependencies() {