diff options
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() { |