HLE: resolve ordinals on pseudo-module handles #512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-24T04:21:26Z.
What
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.Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T08:36:07Z.
Review: APPROVED
Tested
d3e33eaon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (248 passed, 0 failed; older base), includingpseudo_module_ordinals_resolve.The registry already names ordinal exports
#nfor the import binder, soGetProcAddress(module, n)looking up the same#nmakes run-time ordinal lookups agree with static imports. For example,gameinput.dll's#1isGameInputCreate. An ordinal we don't export still returns null, now with a warning, as before. The Linux path tweak in the other test only affects non-Windows test builds.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T17:35:57Z.
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.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:22:33Z.
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
Imported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-27T02:48:23Z.
Addressed the CI blocker in new head
d99845a14: the ordinal test now usesstd::ptr::without_provenanceinstead of a cast integer, and I dropped the unrelated non-Windows path change from the test.cargo clippy --target x86_64-pc-windows-gnu --workspace --all-targets -- -D warningspasses. On the evidence question: the rule mirrorsUpdate::submit's own name matching (blobs.retain(|(n, _)| n != name)), so a second change in one update would otherwise silently overwrite the first. If maintainers prefer preserving last-wins semantics, say so and I will close this. @MarvisakImported from Marvisak/VIctory. Originally posted by Quat3rnion on 2026-11-27T02:48:31Z.
Correction: the last paragraph of my previous comment belongs to PR #590, not this one. For #512 the only changes are the
without_provenancefix and dropping the unrelated test edit.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.