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)_
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.