HLE: report the single supported offline user #398

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

@⁠ToxicmaggotRP on GitHub · 2026-11-24 02:56 UTC · original
ToxicmaggotRP:hle/xuser-max-users → main · +23 −3 · 1 files · 1 commits · open

Title:
HLE: implement the maximum supported offline users query

Summary

  • Implement the previously missing maximum-users method at vtable slot 0x30.
  • Return 1, matching VIctory's current single-offline-user HLE implementation.
  • Use the existing put helper to validate and write the output parameter.
  • Add a regression test covering the returned value and null output pointer handling.

Context

The current XUser implementation exposes one offline local user, but the maximum-users method was still returning E_NOTIMPL.

This implements that missing part of the current single-user HLE model.

Related discussion: #348. This change does not claim to resolve the initialization crash reported there; that still requires a reproduction with the modified build.

Tests

  • Added maximum_users_reports_the_single_offline_user.
  • Verifies S_OK and a maximum user count of 1.
  • Verifies E_INVALIDARG for a null output pointer.
  • cargo test has not yet been run on this branch.

AI ASSISTED (CHATGPT)

**@⁠ToxicmaggotRP** on GitHub · 2026-11-24 02:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/398) `ToxicmaggotRP:hle/xuser-max-users` → `main` · +23 −3 · 1 files · 1 commits · open **Title:** HLE: implement the maximum supported offline users query ## Summary - Implement the previously missing maximum-users method at vtable slot `0x30`. - Return `1`, matching VIctory's current single-offline-user HLE implementation. - Use the existing `put` helper to validate and write the output parameter. - Add a regression test covering the returned value and null output pointer handling. ## Context The current XUser implementation exposes one offline local user, but the maximum-users method was still returning `E_NOTIMPL`. This implements that missing part of the current single-user HLE model. Related discussion: #348. This change does not claim to resolve the initialization crash reported there; that still requires a reproduction with the modified build. ## Tests - Added `maximum_users_reports_the_single_offline_user`. - Verifies `S_OK` and a maximum user count of `1`. - Verifies `E_INVALIDARG` for a null output pointer. - `cargo test` has not yet been run on this branch. AI ASSISTED (CHATGPT)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:02:29 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:29 UTC · original

Thanks @⁠ToxicmaggotRP for making the offline-user limit explicit. I tested head 1d6f71e78730821f89f10c65fba14713d62b05fd with:

cargo test --locked -p victory-hle --lib xuser:: -- --test-threads=1

Result: 2 passed, 0 failed (85 filtered out). The tests cover the reported maximum of one offline user and startup adding that user and returning its ID. They validate the HLE object behavior, not a title’s full sign-in flow.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/398#issuecomment-7122063853) Thanks @⁠ToxicmaggotRP for making the offline-user limit explicit. I tested head `1d6f71e78730821f89f10c65fba14713d62b05fd` with: ``` cargo test --locked -p victory-hle --lib xuser:: -- --test-threads=1 ``` Result: 2 passed, 0 failed (85 filtered out). The tests cover the reported maximum of one offline user and startup adding that user and returning its ID. They validate the HLE object behavior, not a title’s full sign-in flow.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:30 UTC · original

Automated triage for the maintainers.

Needs work. This fills xuser vtable slot 0x30 (crates/victory-hle/src/modules/xuser.rs) with get_max_users(This, *mut u32) returning 1. The open question is the signature: several other open PRs fill the same slot as (This, Handle, *mut u32) (#648, #623, #1330, #1368, #1521), and #648 says the title calls it during account init. If the real method takes a user handle, this version writes the 1 through the handle argument; if not, those PRs write through an undefined register. Either way a wrong guess corrupts memory rather than just returning a wrong value. Please add evidence for the argument list (the title's call site and which registers it sets, or public documentation of the method) and say whether the title really calls it, since the comment in main says no title seen does. With the signature confirmed this is small and fine; a maintainer should then pick one of the duplicates.

CI: no check runs on the head commit.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/398#issuecomment-7148581303) <!-- victory-triage v1 head=22cc74ef4cadff454bab2b1837a2e87b54fab216 verdict=needs-work at=2026-11-25T00:24:46Z --> Automated triage for the maintainers. **Needs work.** This fills xuser vtable slot 0x30 (`crates/victory-hle/src/modules/xuser.rs`) with `get_max_users(This, *mut u32)` returning 1. The open question is the signature: several other open PRs fill the same slot as `(This, Handle, *mut u32)` (#648, #623, #1330, #1368, #1521), and #648 says the title calls it during account init. If the real method takes a user handle, this version writes the 1 through the handle argument; if not, those PRs write through an undefined register. Either way a wrong guess corrupts memory rather than just returning a wrong value. Please add evidence for the argument list (the title's call site and which registers it sets, or public documentation of the method) and say whether the title really calls it, since the comment in main says no title seen does. With the signature confirmed this is small and fine; a maintainer should then pick one of the duplicates. CI: no check runs on the head commit. --- _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/398/head:github-bot/gh-398'
git switch 'github-bot/gh-398'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-398'
git switch 'github-bot/gh-398'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-398'
git switch 'github-bot/gh-398'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-398'
git switch 'main'
git merge --squash 'github-bot/gh-398'
git switch 'main'
git merge --ff-only 'github-bot/gh-398'
git switch 'main'
git merge 'github-bot/gh-398'
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!398
No description provided.