upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/test/tiny_game_exit_code_test.cpp
diff options
context:
space:
mode:
authorTyrannys <80750971+Tyrannys@users.noreply.github.com>2026-11-27 18:40:30 -0600
committerTyrannys <80750971+Tyrannys@users.noreply.github.com>2026-11-27 18:40:30 -0600
commitd1b7d10c76d739125f0e050b52375dff7ab6f4b8 (patch)
treeac0e22f0abd808714332d9b2fad5266d407f5334 /runtime/test/tiny_game_exit_code_test.cpp
parent431ceba4f4a55c69c26fcf0e36fd83e86e1b9a32 (diff)
library_loader: no ".dll" for an empty name; FreeLibrary drops the cached name
Two bugs from kevincommits' finding in #1608 (item 2): - module_name() and module_name_w() stripped the directory and then added ".dll" when no '.' was left, so "" and a path ending in a slash came out as ".dll". That passed every `dll.empty()` guard and went to the bundled loader's lookups as a module name. Both now return an empty name there. - host_module_name() caches HMODULE -> module name for GetProcAddress on host modules, and free_library() never removed the entry. A DLL loaded later at the same base was then served the freed module's shims. free_library() now erases the entry when FreeLibrary succeeds; a module that is still loaded is looked up again on the next call. New test library_loader_names: a fake bundled loader records the names it is asked for, and a fixture DLL with no relocations at a fixed base is loaded as wsock32.dll (a shimmed host module), freed, and loaded again under a plain name at the same base. Both checks fail on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/test/tiny_game_exit_code_test.cpp')
0 files changed, 0 insertions, 0 deletions