HLE: GetProcAddress on our modules sets the last error on a miss #161
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!161
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-161"
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?
@Peppacodes on GitHub · 2026-11-24 22:03 UTC · original
Peppacodes:vf/getprocaddress-last-error→main· +27 −1 · 1 files · 1 commits · openGetProcAddresson one of our pseudo modules returned NULL without setting the last error. That happened for a name the module does not export, and for any ordinal.The host sets
ERROR_PROC_NOT_FOUND(127). A caller that builds its failure fromGetLastError()got 0, andHRESULT_FROM_WIN32(0)isS_OK. So a failed lookup could be reported as a success.The fix sets
ERROR_PROC_NOT_FOUNDon both misses, as the host does.Tested on this branch's base (
2119b0e) plus this commit, on Windows 11:kernel32, the host's, for comparison;xgameruntime.dll;xgameruntime.dll.cargo clippy --workspace --all-targets --locked -- -D warnings, with and without--all-features: clean.cargo test -p victory-shader -p victory-hle -p victory-loader --locked: 337 passed, 0 failed, 2 ignored. This was with the two other PRs from this account applied as well.AI-assisted (Claude Code).
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.