Skip to content

HLE: report the single supported offline user - #398

Open
ToxicmaggotRP wants to merge 1 commit into
Marvisak:mainfrom
ToxicmaggotRP:hle/xuser-max-users
Open

ToxicmaggotRP wants to merge 1 commit into
Marvisak:mainfrom
ToxicmaggotRP:hle/xuser-max-users

Conversation

@ToxicmaggotRP

@ToxicmaggotRP ToxicmaggotRP commented Nov 24, 2026 •

Copy link
Copy Markdown

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)

@jeremygold02

Copy link
Copy Markdown
Contributor

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.

@ghost ghost mentioned this pull request Nov 24, 2026

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 1d6f71e on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (265 passed, 0 failed).

XUserGetMaxUsers reporting 1 matches the single offline user this HLE ever adds. put gives the usual E_INVALIDARG for a null output, and the test checks both paths. Moving "maximum users" out of the unset-slots comment keeps that comment accurate.

No issues found.

AI-assisted (Claude Code).

mercuryVM added a commit to mercuryVM/VIctory that referenced this pull request Nov 24, 2026
…ine user

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
github-actions Bot added a commit to KevinPratap/VIctory that referenced this pull request Nov 24, 2026
nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Review workers over ~45 more PRs against the merged upstream tree.

Integrated: Marvisak#1394 (antisymmetric XUserCompare), Marvisak#1390 (A8_UNORM is not in
the R8 typeless family), Marvisak#1499 (deep 3D mips stay out of the thick tail,
plus a regression test the PR lacked), Marvisak#1366 (mesh stage I/O does not parse
VS inputs), Marvisak#1594 (the title's exit status reaches the shell), Marvisak#1299 (docs:
validator prerequisite), Marvisak#1515 (dialog commands before init), Marvisak#1424 (empty
submissions skip the lock), Marvisak#1144 (shader differential skips are reported),
Marvisak#1129 (64 MB pipeline-worker stacks), Marvisak#1564/Marvisak#1565/Marvisak#1566 (MakeResident,
Evict and SetStablePowerState succeed as the console's do), Marvisak#1250 (a zero
element count reads to the end of the buffer), Marvisak#1628 (texture-creation
failure logs its states).

Re-applied after the upstream merge dropped them: f32_to_half NaN and
ties-to-even (Marvisak#843), unique-temp library writes (Marvisak#1660),
VICTORY_PIPELINE_WORKERS (Marvisak#1728), VICTORY_MODE (Marvisak#1701).

Removed: the orphaned depth-bounds test file, whose implementation
(9a6d9e6) the merge dropped and which no module compiled.

Refused: Marvisak#1099 (writing 0 for an unpaired p1 interpolation computes wrong
values; two reviewers upstream and one here reached the same conclusion).
Duplicates: Marvisak#1217, Marvisak#529, Marvisak#531, Marvisak#590, Marvisak#1102, Marvisak#398, Marvisak#1150, Marvisak#1220.

Gate at efda2c5: fmt 0 differing, both Clippy gates 0 errors, policy 219
files, workspace 674 passed / 0 failed with the 10 documented pre-existing
GPU skips.

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants