hle(kernel): return FALSE from GetModuleHandleExW/A when module is not found #2879
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA#2879
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@RanoGames on GitHub · 2026-11-29 18:28 UTC · original
What it changes
Fixes
GetModuleHandleExWandGetModuleHandleExAincrates/victory-hle/src/modules/kernel.rs:give_module(out, module)previously returned1(TRUE) unconditionally wheneveroutwas non-null, even whenmodulewasNULL(e.g. refused host DLLs, unloaded title DLLs, or unloaded host DLLs). It now returnsi32::from(!module.is_null())while still zeroing*outand preservingERROR_MOD_NOT_FOUND.ModuleLookup::Host) now forward tohost::get_system_module_handle_ex(GetModuleHandleExWafteris_bare_dll_namevalidation) instead ofGetModuleHandleW, so reference counting,PIN/UNCHANGED_REFCOUNTflags, and missing-moduleFALSEreturns behave as on Windows.modules::kernel::tests::module_handle_ex_returns_false_and_null_when_module_is_missing.How it was tested
kernel32wrapper fix)GetModuleHandleExW/GetModuleHandleExAreturned1(TRUE) with*out = NULLfor refused, unloaded title, or unloaded host DLLs.0(FALSE) with*out = NULL, and forwards allow-listed host DLLs throughGetModuleHandleExW.cargo testpassed for the crates it touches: yes (cargo test --locked -p victory-hle -- modules::kernel::tests: 17 passed, 0 failed; in fullvictory-hlerun 423 passed with 1 unrelated timing flake inxasync::tests::terminate_waiting_from_its_own_callback_returns;cargo xtask policy --stagedpassed)Checked for overlap
Pull request details or commits were not available from GitHub; kept as an issue.
[pr-fix] hle(kernel): return FALSE from GetModuleHandleExW/A when module is not foundto hle(kernel): return FALSE from GetModuleHandleExW/A when module is not found