HLE: match host DLLs behind lifecycle and CRT API sets #3310
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3310
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3310"
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?
@fuzeofficlal on GitHub · 2026-11-26 16:58 UTC · original
fuzeofficlal:fix/hle-host-dll-overrides→main· +113 −0 · 2 files · 1 commits · openSummary
Add the backing host DLL names to
lifecycle::module()andkernel::module()soGetProcAddresslookups on host-loaded API-set modules (and direct imports from the backing DLLs) reach Victory's HLE overrides:crates/victory-hle/src/modules/lifecycle.rs: add"twinapi.appcore.dll"(backingapi-ms-win-core-psm-appnotify-*) and"user32.dll"(backingext-ms-win-rtcore-ntuser-window-*).crates/victory-hle/src/modules/kernel.rs: add"ucrtbase.dll"(backingapi-ms-win-crt-runtime-*forexit,abort,terminate, and_invalid_parameter_noinfo_noreturn; does not collide withfiles.rsstdio/file exports onucrtbase.dll).Root Cause
When a title loads an allowed API set (
api-ms-win-core-psm-appnotify-l1-1-0.dll,ext-ms-win-rtcore-ntuser-window-l1-1-0.dll, orapi-ms-win-crt-runtime-l1-1-0.dll) viaLoadLibraryW/GetModuleHandleWand resolves symbols withGetProcAddress, Windows maps the handle to the backing host DLL (twinapi.appcore.dll,user32.dll, orucrtbase.dll).kernel::host_overrideextracts that host filename viaGetModuleFileNameWand queriesregistry::lookup(file, &symbol). Becauselifecycleandkernelonly listed the API-set patterns, dynamicGetProcAddresslookups (and direct imports from those backing DLLs) bypassed the lifecycle notification/window hooks and CRT termination logging.Verification
lifecycle::testsandkernel::testscovering both staticHleResolver::classifyand live WindowsLoadLibraryW+GetProcAddressresolution on all three API sets (confirmed RED 0/6 before the 3-line change, GREEN 6/6 after).cargo test -p victory-hle --lockedand--all-features: 158 unit + 2 integration tests passed.cargo clippy -p victory-hle --all-targets --locked -- -D warnings(default and--all-features): clean.cargo test -p xtask --locked policy::tests::repository_passes_policy: passed.@Dukestar69 on GitHub · 2026-11-26 17:07 UTC · original · approved these changes
Reviewed the diff and verified locally on Windows 11 x64:
ucrtbase.dll,twinapi.appcore.dll, anduser32.dllalongside their API-set patterns cleanly ensuresGetProcAddresslookups on host DLLs resolved behindapi-ms-win-crt-runtime-*,api-ms-win-core-psm-appnotify-*, andext-ms-win-rtcore-ntuser-window-*hit the HLE overrides.cargo test -p victory-hle --lib modules::kernel:: -- --test-threads=1: 7 passed, 0 failed.cargo test -p victory-hle --lib modules::lifecycle:: -- --test-threads=1: 16 passed, 0 failed.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@cloph-dsp on GitHub · 2026-11-26 17:08 UTC · original
Independent local verification of PR #3310 — "HLE: match host DLLs behind lifecycle and CRT API sets".
No game data, assets or extracted shaders were used. Windows, Rust/Cargo 1.100.0 (MSVC), repository-pinned toolchain 1.98.1 noted; per-worktree
CARGO_TARGET_DIR=D:\Victory-Contrib\target-3310,CARGO_BUILD_JOBS=2. Head verified:0468c76.Exact tests (single filtered invocation):
cargo test --locked -p victory-hle --lib -- --exact modules::kernel::tests::ucrtbase_termination_functions_resolve_to_hle modules::kernel::tests::crt_runtime_api_set_lookups_get_our_overrides modules::lifecycle::tests::appcore_notifications_resolve_to_hle modules::lifecycle::tests::user32_window_functions_resolve_to_hle modules::lifecycle::tests::appnotify_api_set_lookups_get_our_overrides modules::lifecycle::tests::ntuser_window_api_set_lookups_get_our_overrides→ 6 passed, 0 failed, 152 filtered out, exit 0.
git diff --check origin/main HEAD→ exit 0.Negative control: all six test names are absent on the merge base
63bcca43(git grep -creturned no matches), confirming the tests are added by this PR.Caveat: these are synthetic API-set lookup tests using real Windows
LoadLibraryW/GetProcAddress; no title process or in-game UI was exercised. AI-assisted (Hy4 flash). GPU/driver: N/A (CPU-only HLE).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.