upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/test/code_hooks_test.cpp
diff options
context:
space:
mode:
authorcynbun <74268930+cynbun@users.noreply.github.com>2026-11-23 17:30:32 +0100
committerGitHub <noreply@github.com>2026-11-23 10:30:32 -0600
commite0816d6af23f42353a3939cf4c228675c6e31305 (patch)
tree23c4ca7bf398ba609d3ba1d12f4aaa60dc8abf2b /runtime/test/code_hooks_test.cpp
parent14b2e4462fb969ea4ae5c7847db86ed1b64ce6cf (diff)
pe_loader: a static load's DllMain gets a non-NULL lpvReserved (#7307)
Loader::initialise(Module&) called every DllMain(DLL_PROCESS_ATTACH) with lpvReserved NULL. Microsoft's DllMain reference: "If fdwReason is DLL_PROCESS_ATTACH, lpvReserved is NULL for dynamic loads and non-NULL for static loads." The executable gta6rt maps and the DLLs it imports are the static case; a run-time LoadLibrary (load_runtime_module) and a GetProcAddress forwarder (resolve_module_export) are dynamic. Each Module now records whether it was mapped inside a run-time load, and a static module's DllMain gets a pointer to a CONTEXT captured for the call. TLS callbacks and the process detach in ~Loader (an unload: NULL) are unchanged. loader_test: a host load() + initialise() must give a non-NULL lpvReserved (fails on main), the same image through load_runtime_module NULL. The lifecycle observer checks lpvReserved on detach only. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/code_hooks_test.cpp')
0 files changed, 0 insertions, 0 deletions