upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/test/fixtures/tiny_bundled_load.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/test/fixtures/tiny_bundled_load.cpp')
-rw-r--r--runtime/test/fixtures/tiny_bundled_load.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/runtime/test/fixtures/tiny_bundled_load.cpp b/runtime/test/fixtures/tiny_bundled_load.cpp
index 51fbaac72..f2a3b7f36 100644
--- a/runtime/test/fixtures/tiny_bundled_load.cpp
+++ b/runtime/test/fixtures/tiny_bundled_load.cpp
@@ -27,6 +27,15 @@ int main() {
27 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr) 27 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr)
28 return fail("GetModuleHandleW before LoadLibrary should be NULL", 0); 28 return fail("GetModuleHandleW before LoadLibrary should be NULL", 0);
29 29
30 // DONT_RESOLVE_DLL_REFERENCES must fail explicitly rather than silently resolving imports and running DllMain.
31 SetLastError(0);
32 if (LoadLibraryExW(L"tiny_bundled_dll.dll", nullptr, DONT_RESOLVE_DLL_REFERENCES) != nullptr ||
33 GetLastError() != ERROR_NOT_SUPPORTED) {
34 return fail("LoadLibraryExW(DONT_RESOLVE_DLL_REFERENCES) fails with ERROR_NOT_SUPPORTED", GetLastError());
35 }
36 if (GetModuleHandleW(L"tiny_bundled_dll.dll") != nullptr)
37 return fail("DONT_RESOLVE_DLL_REFERENCES must not map or register the bundled DLL", 0);
38
30 HMODULE mod = LoadLibraryW(L"tiny_bundled_dll.dll"); 39 HMODULE mod = LoadLibraryW(L"tiny_bundled_dll.dll");
31 if (!mod) return fail("LoadLibraryW(tiny_bundled_dll.dll)", GetLastError()); 40 if (!mod) return fail("LoadLibraryW(tiny_bundled_dll.dll)", GetLastError());
32 41