HLE: set ERROR_PROC_NOT_FOUND for missing pseudo-module exports #1432
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!1432
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1432"
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-24 17:58 UTC · original
fuzeofficlal:fix/hle-getprocaddress-last-error-764→main· +37 −0 · 1 files · 1 commits · openFixes #764.
Summary
ERROR_PROC_NOT_FOUND(127) viahost::set_last_errorbefore returning null fromkernel::GetProcAddresswhen a pseudo-module lookup misses by ordinal or by symbol name, matching Win32GetProcAddresssoHRESULT_FROM_WIN32(GetLastError())never misreportsS_OK.Verification
missing_pseudo_module_exports_set_proc_not_foundtesting missing symbol names, missing ordinals, and ordinal0afterSetLastError(0).cargo test --workspace,cargo clippy --workspace --all-targets --all-features, andcargo xtask policy: passed.@acetonahard-code on GitHub · 2026-11-24 20:56 UTC · original
Tested on Windows 11 with the repo toolchain, merged into current
main(ffe310e):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
@Marvisak on GitHub · 2026-11-25 01:27 UTC · original · edited 2026-11-25 06:28 UTC
Automated triage for the maintainers.
Merge candidate. It merges cleanly.
GetProcAddress(crates/victory-hle/src/modules/kernel.rs) now setsERROR_PROC_NOT_FOUND(127) when a pseudo module has no such export, or is asked by ordinal (which includes a null name). That matches the documented Windows behaviour, and the host's ownGetProcAddress, which the new test checks onkernel32.dllside by side. Onmainthese paths return null and leave a stale last error behind. The change is small: three lines plus the constant, which did not exist yet. The test covers a found export, a missing name, an ordinal and null.CI: passing (
check).Generated by Claude Code
@cloph-dsp on GitHub · 2026-11-26 15:17 UTC · original
Independent verification (Windows, Rust 1.100.0/MSVC, head
f30681c, synthetic fake-hostSetLastError, no game data):cargo test --locked -p victory-hle --lib -- modules::kernel::tests::missing_pseudo_module_exports_set_proc_not_found --exact— 1 passed, 0 failed, 143 filtered.git diff --checkagainst merge base940d32f— clean.CARGO_TARGET_DIRused.AI-assisted (Hy4 flash). GPU/driver: N/A (CPU only). Did not exercise a real pseudo-module import from a title.
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.