HLE: an unknown gamertag component is an invalid argument #2072

Open
github-bot wants to merge 1 commit from github-bot/gh-2072 into main AGit
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-25 04:22 UTC · original
0xkn0wh3r3:hle/xuser-gamertag-invalid-component → main · +23 −2 · 1 files · 1 commits · open

The problem

XUserGetGamertag documents E_INVALIDARG for an invalid gamertagComponent. The valid values (XUserGamertagComponent) are Classic 0, Modern 1, ModernSuffix 2 and UniqueModern 3.

VIctory's get_gamertag (crates/victory-hle/src/modules/xuser.rs) answered any value other than the modern suffix with the gamertag, so a title passing a bad component got a name back instead of an error.

The fix

  • Values past 3 are now refused with E_INVALIDARG.
  • Values 0-3 answer as before. The offline gamertag fits every documented size.

Testing

  • New unit test an_unknown_gamertag_component_is_an_invalid_argument: asks for components 4, 5 and u32::MAX through both slots that serve the call, and checks each returns E_INVALIDARG.
  • cargo test -p victory-hle: all pass. cargo clippy -p victory-hle --all-targets: clean.
  • With this and the other conformance fixes merged onto #2057's branch, its suite passes 151 of 152 checks (the remaining one, the console id, is #1717).
  • Not run with a title (no game data here).
  • Found by the conformance title in #2057, which lists this check as a known divergence. Whichever of the two merges second takes the entry off the test's KNOWN list (a listed check that passes fails that test).
**@⁠0xkn0wh3r3** on GitHub · 2026-11-25 04:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2072) `0xkn0wh3r3:hle/xuser-gamertag-invalid-component` → `main` · +23 −2 · 1 files · 1 commits · open ## The problem `XUserGetGamertag` documents `E_INVALIDARG` for an invalid `gamertagComponent`. The valid values (`XUserGamertagComponent`) are Classic 0, Modern 1, ModernSuffix 2 and UniqueModern 3. VIctory's `get_gamertag` (`crates/victory-hle/src/modules/xuser.rs`) answered any value other than the modern suffix with the gamertag, so a title passing a bad component got a name back instead of an error. ## The fix - Values past 3 are now refused with `E_INVALIDARG`. - Values 0-3 answer as before. The offline gamertag fits every documented size. ## Testing - New unit test `an_unknown_gamertag_component_is_an_invalid_argument`: asks for components 4, 5 and `u32::MAX` through both slots that serve the call, and checks each returns `E_INVALIDARG`. - `cargo test -p victory-hle`: all pass. `cargo clippy -p victory-hle --all-targets`: clean. - With this and the other conformance fixes merged onto #2057's branch, its suite passes 151 of 152 checks (the remaining one, the console id, is #1717). ## Not covered / Related - Not run with a title (no game data here). - Found by the conformance title in #2057, which lists this check as a known divergence. Whichever of the two merges second takes the entry off the test's `KNOWN` list (a listed check that passes fails that test).
XUserGetGamertag documents E_INVALIDARG for an invalid gamertagComponent
(XUserGamertagComponent: Classic 0, Modern 1, ModernSuffix 2,
UniqueModern 3). Any value other than the modern suffix was answered with
the gamertag; values past 3 are now refused, and 0-3 answer as before
(the offline gamertag fits every documented size).

The new test asks for components 4, 5 and u32::MAX through both slots
that serve the call.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:53:59 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 10:27 UTC · original · edited 2026-11-26 01:20 UTC

Automated triage for the maintainers.

Merge candidate (a recommendation to look, not an approval). The new head is the same change rebased onto current main. get_gamertag in crates/victory-hle/src/modules/xuser.rs returns E_INVALIDARG for a component other than 0-3, and components 0-3 behave as before. The public reference for XUserGetGamertag supports this, and the conformance title in #2057 found the difference. The new test checks both vtable slots that serve the call (GAMERTAG_OBJECT 0x18 and OBJECT 0x78).

The branch merges cleanly. CI: check passing. Whichever of this PR and #2057 merges second must drop the entry from #2057's KNOWN list.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 10:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/2072#issuecomment-7159714392) · edited 2026-11-26 01:20 UTC <!-- victory-triage v1 head=bb907903e3f76fabe5fdb36cc8981c16f8e0de0f verdict=merge-candidate at=2026-11-26T01:20:49Z --> Automated triage for the maintainers. **Merge candidate** (a recommendation to look, not an approval). The new head is the same change rebased onto current `main`. `get_gamertag` in `crates/victory-hle/src/modules/xuser.rs` returns `E_INVALIDARG` for a component other than 0-3, and components 0-3 behave as before. The public reference for `XUserGetGamertag` supports this, and the conformance title in #2057 found the difference. The new test checks both vtable slots that serve the call (`GAMERTAG_OBJECT` 0x18 and `OBJECT` 0x78). The branch merges cleanly. CI: `check` passing. Whichever of this PR and #2057 merges second must drop the entry from #2057's `KNOWN` list. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠catminou4 on GitHub · 2026-11-25 04:26 UTC · original · reviewed

Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff.

Unknown gamertag component returns invalid-argument — XUser error-code correctness; matches GDK behavior.

**@⁠catminou4** on GitHub · 2026-11-25 04:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/2072#pullrequestreview-6051851042) · **reviewed** Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. Unknown gamertag component returns invalid-argument — XUser error-code correctness; matches GDK behavior.
Author
Owner

@⁠DenRakEiw on GitHub · 2026-11-25 04:50 UTC · original · approved these changes

Verified locally merged onto origin/main (940d32f, Windows 11 x64, Rust 1.98.1 MSVC):

  • cargo test -p victory-hle --lib xuser:: — 3 passed, 0 failed (including an_unknown_gamertag_component_is_an_invalid_argument)
  • cargo clippy -p victory-hle --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean E_INVALIDARG return for unknown gamertag components with unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

**@⁠DenRakEiw** on GitHub · 2026-11-25 04:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/2072#pullrequestreview-6052018548) · **approved these changes** Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, Rust 1.98.1 MSVC): - `cargo test -p victory-hle --lib xuser::` — 3 passed, 0 failed (including `an_unknown_gamertag_component_is_an_invalid_argument`) - `cargo clippy -p victory-hle --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean `E_INVALIDARG` return for unknown gamertag components with unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 19:59 UTC · original · approved these changes

Verified locally merged onto origin/main (63bcca43) at PR head bb907903 (Windows 11 x64):

  • crates/victory-hle/src/modules/xuser.rs (get_gamertag, lines 160-179): explicitly matches XUserGamertagComponent 0..=3 (CLASSIC, MODERN, MODERN_SUFFIX, UNIQUE_MODERN) and returns xasync::E_INVALIDARG on any other value before calling put_string, leaving the caller's output buffer and written-length pointer untouched.
  • cargo xtask policy: 191 files ok.
  • cargo clippy --locked -p victory-hle --all-targets -- -D warnings (default and --all-features): 0 warnings.
  • cargo test --locked -p victory-hle --lib modules::xuser::: 4/4 passed (including an_unknown_gamertag_component_is_an_invalid_argument exercising both (&GAMERTAG_OBJECT, 0x18) and (&OBJECT, 0x78) vtable slots).
  • Extra synthetic probe (not committed): confirmed components 4, 5, 100, and u32::MAX through both vtable slots return E_INVALIDARG, preserve caller-initialized buffer and used bytes, handle null output pointers without faulting, and keep components 0..=3 returning S_OK as before.

Synthetic tests only; looks ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 19:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/2072#pullrequestreview-6079892924) · **approved these changes** Verified locally merged onto `origin/main` (`63bcca43`) at PR head `bb907903` (Windows 11 x64): - `crates/victory-hle/src/modules/xuser.rs` (`get_gamertag`, lines 160-179): explicitly matches `XUserGamertagComponent` `0..=3` (`CLASSIC`, `MODERN`, `MODERN_SUFFIX`, `UNIQUE_MODERN`) and returns `xasync::E_INVALIDARG` on any other value before calling `put_string`, leaving the caller's output buffer and written-length pointer untouched. - `cargo xtask policy`: 191 files ok. - `cargo clippy --locked -p victory-hle --all-targets -- -D warnings` (default and `--all-features`): 0 warnings. - `cargo test --locked -p victory-hle --lib modules::xuser::`: 4/4 passed (including `an_unknown_gamertag_component_is_an_invalid_argument` exercising both `(&GAMERTAG_OBJECT, 0x18)` and `(&OBJECT, 0x78)` vtable slots). - Extra synthetic probe (not committed): confirmed components `4`, `5`, `100`, and `u32::MAX` through both vtable slots return `E_INVALIDARG`, preserve caller-initialized `buffer` and `used` bytes, handle null output pointers without faulting, and keep components `0..=3` returning `S_OK` as before. Synthetic tests only; looks ready to merge.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2072/head:github-bot/gh-2072'
git switch 'github-bot/gh-2072'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2072'
git switch 'github-bot/gh-2072'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2072'
git switch 'github-bot/gh-2072'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2072'
git switch 'main'
git merge --squash 'github-bot/gh-2072'
git switch 'main'
git merge --ff-only 'github-bot/gh-2072'
git switch 'main'
git merge 'github-bot/gh-2072'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2072
No description provided.