HLE: resolve ordinals on pseudo-module handles #512
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!512
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-512"
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?
@Quat3rnion on GitHub · 2026-11-24 04:21 UTC · original
Quat3rnion:victory-module-ordinals→main· +31 −8 · 1 files · 1 commits · openWhat
GetProcAddressrefused every ordinal on one of our pseudo modules. Someconsole APIs are exported only by ordinal —
gameinput.dllregistersGameInputCreateas#1— so a title that loaded the module and asked forthat ordinal got null even though the static import resolved. The registry
already stores ordinal exports under the name
#n; the lookup now uses thatform. Unexported ordinals still return null.
An AI tool wrote part of this change.
Tested
cargo test --workspace: 165 passed, 0 failed, 3 ignored. A new regression loads thegameinput.dllpseudo module, resolves ordinal 1 to the registered address, and checks that ordinal 2 fails.cargo check --target x86_64-pc-windows-gnu --workspace --testspasses. No Windows host here.cargo xtask policypasses (150 files ok). No game files or data from them were added.Checklist
cargo xtask policypasses. No game files or data from them were added.@jeremygold02 on GitHub · 2026-11-24 17:35 UTC · original
Verification ran against PR head
829f774722a6b8feab7a88cffd1d635c03b9c81b; the PR was open at refresh.cargo test -p victory-hle pseudo_module_ordinals_resolvemodules::kernel::tests::pseudo_module_ordinals_resolve. It confirms ordinal 1 on the pseudogameinput.dllhandle resolves to registry export#1, while unexported ordinal 2 returns null.This verification was AI-assisted.
@Marvisak on GitHub · 2026-11-25 01:22 UTC · original
Automated triage for the maintainers.
Needs work. The fix itself is right:
GetProcAddressincrates/victory-hle/src/modules/kernel.rsrefused every ordinal on a pseudo-module handle. The registry already names ordinal exports#n(gameinput.rsregisters#1,net.rsitsws2_32ordinals), andhost_overridealready looks ordinals up the same way. Resolving#nhere makes the dynamic lookup agree with the static import binding. Forws2_32this hands out our guardednetfunctions, so the offline guards still apply.What blocks it: CI fails at Clippy (
-D warnings). In the new testpseudo_module_ordinals_resolve,GetProcAddress(module, 1 as *const u8)tripsclippy::manual_dangling_ptr. Usestd::ptr::without_provenance::<u8>(1)(and(2)for the second call), or build the pointer through ausizevariable. Once CI is green, this would be a merge candidate.Minor: the change to
title_dlls_and_pseudo_modules_are_found_by_name(non-Windows path) is unrelated to the fix. Please drop it or mention it in the description.CI: failing (Clippy, see above).
Generated by 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.