victory-hle: one definition of each HRESULT #461
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/Belobug--VIctory-Belobug-AMD!461
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-461"
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?
@Jackster on GitHub · 2026-11-27 03:16 UTC · original
Jackster:hle/hresult-module→a-publier· +44 −23 · 11 files · 1 commits · openWhat
Ten Windows
HRESULTvalues were defined nineteen times across nine modules ofvictory-hle—E_OUTOFMEMORYfour times,E_NOINTERFACEandE_FAILthree times each,E_POINTERandE_NOTIMPLtwice each. A fix to one copy left the others wrong, and nothing made the copies agree.One module now holds them:
crates/victory-hle/src/hresult.rs. Values are unchanged (audited against4eb6cfd), call sites are untouched, and the duplicated definitions are gone —grep "const E_" crates/victory-hle/srcnow matches only the new module.Module-specific results stay where they are used, because they are one module's protocol rather than Windows': the XAPU
0x8AC8_1xxxset inapu.rs, DStorage'sHRESULT_FROM_WIN32codes (END_OF_FILE,INVALID_DATA), GameInput's0x838A_*set, andmedia.rs's unsupported-scheme code.The one compatibility shim, and why
xasync.rskeepsbecause seven sibling modules reach those results by that path (
display,speech,storage,xgameruntime,xgamesave,xpackage,xuser). There is still exactly one definition per value; this is a path, not a second name. The six that werepubthere arepub(crate)now — no consumer outside the crate referenced them, and--all-targetscompiles the integration tests that would have failed.Testing
cargo check -p victory-hle --all-targets— clean, no warnings.cargo test -p victory-hle— 162 passed, 2 ignored (pre-existing benchmarks), 0 failed; both integration tests pass.cargo clippy -p victory-hle --all-targets -- -D warnings, default and--all-features— clean.Notes
crates/victory-gpu/src/object.rskeeps its ownE_NOTIMPL/E_NOINTERFACE, outside this crate; a shared crate-wide module would be a larger change than this PR.@MamaLeVrai on GitHub · 2026-11-27 03:55 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
02862e5:cargo test --release -p victory-hle --lib162 passed, 0 failed, 2 ignored.AI-assisted (Claude Code); no game data.
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.