upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/src/pe_loader.h
diff options
context:
space:
mode:
authorjaybeebabageyus <jaybeebabageyus@users.noreply.github.com>2026-11-22 16:21:16 +0100
committerjaybeebabageyus <jaybeebabageyus@users.noreply.github.com>2026-11-22 16:21:16 +0100
commit47f4cdc643f3fca3f87a34d9a4718f250d7cd905 (patch)
tree0ff132d81a5a655525d5a851adaabfaa10ac1fa2 /runtime/src/pe_loader.h
parent6a6704df1592e1dc4a3215ddf1423a78adb52045 (diff)
runtime: route LoadLibrary/GetProcAddress of bundled package DLLs through rt::Loader
Diffstat (limited to 'runtime/src/pe_loader.h')
-rw-r--r--runtime/src/pe_loader.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/runtime/src/pe_loader.h b/runtime/src/pe_loader.h
index 1303cdff9..d9f89f542 100644
--- a/runtime/src/pe_loader.h
+++ b/runtime/src/pe_loader.h
@@ -8,6 +8,7 @@
8#include <cstdint> 8#include <cstdint>
9#include <filesystem> 9#include <filesystem>
10#include <map> 10#include <map>
11#include <mutex>
11#include <string> 12#include <string>
12#include <vector> 13#include <vector>
13 14
@@ -103,6 +104,12 @@ public:
103 void install_tls_for_thread(Module& m); 104 void install_tls_for_thread(Module& m);
104 void uninstall_tls_for_thread(Module& m); 105 void uninstall_tls_for_thread(Module& m);
105 106
107 // Run-time module lookup/loading used by the library_loader shim for bundled package DLLs.
108 void* find_loaded_module(const std::string& dll_lower) const;
109 void* load_runtime_module(const std::string& dll_lower, bool& handled);
110 void* resolve_module_export(void* module_handle, const std::string& sym, bool& owns_handle);
111 bool owns_module_handle(void* module_handle) const;
112
106private: 113private:
107 void initialise(Module& m); 114 void initialise(Module& m);
108 static void set_initialised(Module& m, bool value); 115 static void set_initialised(Module& m, bool value);
@@ -115,6 +122,7 @@ private:
115 void protect_sections(Module& m); 122 void protect_sections(Module& m);
116 void register_unwind(Module& m); 123 void register_unwind(Module& m);
117 124
125 mutable std::recursive_mutex mutex_;
118 std::filesystem::path game_dir_; 126 std::filesystem::path game_dir_;
119 std::map<std::string, Module*> by_name_; // lower-case file name 127 std::map<std::string, Module*> by_name_; // lower-case file name
120 std::vector<Module*> order_; // mapping order; owns the modules 128 std::vector<Module*> order_; // mapping order; owns the modules