HLE: GetProcAddress on our modules sets the last error on a miss #161
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from fxceless/victory-fork. Originally posted by Peppacodes on 2026-11-24T22:03:24Z.
GetProcAddresson 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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.