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:
Diffstat (limited to 'runtime/src/pe_loader.h')
-rw-r--r--runtime/src/pe_loader.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/runtime/src/pe_loader.h b/runtime/src/pe_loader.h
index d9f89f542..7cfe7a771 100644
--- a/runtime/src/pe_loader.h
+++ b/runtime/src/pe_loader.h
@@ -46,12 +46,12 @@ struct Module {
46 46
47 // Static TLS (IMAGE_DIRECTORY_ENTRY_TLS). load() installs tls_block in the calling thread and writes tls_index to 47 // Static TLS (IMAGE_DIRECTORY_ENTRY_TLS). load() installs tls_block in the calling thread and writes tls_index to
48 // the image's _tls_index. tls_index names TEB->ThreadLocalStoragePointer[tls_index], the array 48 // the image's _tls_index. tls_index names TEB->ThreadLocalStoragePointer[tls_index], the array
49 // __declspec(thread) reads; it is not a TlsAlloc slot. The loader reserves the index by loading 49 // __declspec(thread) reads; it is not a TlsAlloc slot. The loader reserves distinct indices by loading
50 // gta6rt_tls_host.dll, so only one manually mapped TLS module can be live at a time; a second one is rejected 50 // gta6rt_tls_host.dll (and cloning it on demand for additional simultaneous TLS modules, up to 16 at a time).
51 // rather than sharing (and corrupting) the slot. Every thread started after load() gets its own copy through the 51 // Every thread started after load() gets its own copy through the helper's DLL_THREAD_ATTACH, and gives it back
52 // helper's DLL_THREAD_ATTACH, and gives it back at DLL_THREAD_DETACH; install_tls_for_thread() is for threads 52 // at DLL_THREAD_DETACH; install_tls_for_thread() is for threads that already existed.
53 // that already existed.
54 uint32_t tls_index = kNoTlsIndex; 53 uint32_t tls_index = kNoTlsIndex;
54 uint32_t tls_slot = kNoTlsIndex; // index into the loader's reserved TLS-host slot pool
55 void* tls_block = nullptr; // calling thread's copy of the image's template 55 void* tls_block = nullptr; // calling thread's copy of the image's template
56 void* tls_saved_block = nullptr; // helper DLL block replaced in that thread, restored by ~Loader 56 void* tls_saved_block = nullptr; // helper DLL block replaced in that thread, restored by ~Loader
57 uint32_t tls_block_size = 0; // raw template + zero fill 57 uint32_t tls_block_size = 0; // raw template + zero fill
@@ -106,7 +106,7 @@ public:
106 106
107 // Run-time module lookup/loading used by the library_loader shim for bundled package DLLs. 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; 108 void* find_loaded_module(const std::string& dll_lower) const;
109 void* load_runtime_module(const std::string& dll_lower, bool& handled); 109 void* load_runtime_module(const std::string& dll_lower, uint32_t flags, bool& handled);
110 void* resolve_module_export(void* module_handle, const std::string& sym, bool& owns_handle); 110 void* resolve_module_export(void* module_handle, const std::string& sym, bool& owns_handle);
111 bool owns_module_handle(void* module_handle) const; 111 bool owns_module_handle(void* module_handle) const;
112 112