XUser: finding an unknown local id fails with ERROR_NOT_FOUND #2071

Closed
0xkn0wh3r3 wants to merge 1 commit from upstream-pr/2073 into main
0xkn0wh3r3 commented 2026-11-25 04:22:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T04:22:59Z.


The problem

A title that looks up a local id with no user gets the wrong error code back.

XUserFindUserByLocalId documents HRESULT_FROM_WIN32(ERROR_NOT_FOUND) (0x80070490) for a local id with no user. VIctory's find_by_local_id returned the XUser error E_GAMEUSER_USER_NOT_FOUND (0x89245104, USER_NOT_FOUND) instead, through the shared found helper.

Found by the conformance title in #2057, which lists this check as a known divergence.

The fix

  • find_by_local_id returns the new NOT_FOUND (0x80070490) for an unknown local id, and the user's handle for the known one as before.
  • XUserFindUserById names no specific error, so it keeps the XUser one (USER_NOT_FOUND).

Testing

  • New unit test modules::xuser::tests::an_unknown_local_id_is_not_found: the known local id finds the user; an unknown one returns NOT_FOUND and leaves the handle null; XUserFindUserById with an unknown id still returns USER_NOT_FOUND.
  • 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).

#2057 lists this check on its test's KNOWN list. Whichever of the two merges second takes the entry off that list (a listed check that passes fails that test).

<!-- greyfinch-sync:Marvisak/VIctory:issue:6597157763 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2073). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-25T04:22:59Z. --- ## The problem A title that looks up a local id with no user gets the wrong error code back. `XUserFindUserByLocalId` documents `HRESULT_FROM_WIN32(ERROR_NOT_FOUND)` (0x80070490) for a local id with no user. VIctory's `find_by_local_id` returned the XUser error `E_GAMEUSER_USER_NOT_FOUND` (0x89245104, `USER_NOT_FOUND`) instead, through the shared `found` helper. Found by the conformance title in #2057, which lists this check as a known divergence. ## The fix - `find_by_local_id` returns the new `NOT_FOUND` (0x80070490) for an unknown local id, and the user's handle for the known one as before. - `XUserFindUserById` names no specific error, so it keeps the XUser one (`USER_NOT_FOUND`). ## Testing - New unit test `modules::xuser::tests::an_unknown_local_id_is_not_found`: the known local id finds the user; an unknown one returns `NOT_FOUND` and leaves the handle null; `XUserFindUserById` with an unknown id still returns `USER_NOT_FOUND`. - `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). ## Related #2057 lists this check on its test's `KNOWN` list. Whichever of the two merges second takes the entry off that list (a listed check that passes fails that test).
catminou4 commented 2026-11-25 05:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:26:30Z.

Review: COMMENTED


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

Unknown local id → ERROR_NOT_FOUND — XUser lookup error-code fix; pair with #2072 (same subsystem).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051851114 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2073#pullrequestreview-6051851114). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T04:26:30Z. **Review:** COMMENTED --- Static review only: victory-hle is Windows-only — nothing compiles or runs on macOS; source review of the diff. Unknown local id → ERROR_NOT_FOUND — XUser lookup error-code fix; pair with #2072 (same subsystem).
DenRakEiw commented 2026-11-25 05:05:59 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:44:51Z.

Review: APPROVED


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_local_id_is_not_found)
  • cargo clippy -p victory-hle --all-targets — 0 warnings
  • cargo xtask policy — ok (183 files ok)

Clean fix returning ERROR_NOT_FOUND for unknown local user IDs with unit test coverage. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051981075 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2073#pullrequestreview-6051981075). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T04:44:51Z. **Review:** APPROVED --- 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_local_id_is_not_found`) - `cargo clippy -p victory-hle --all-targets` — 0 warnings - `cargo xtask policy` — ok (`183 files ok`) Clean fix returning `ERROR_NOT_FOUND` for unknown local user IDs with unit test coverage. Looks good. AI-assisted (Gemini 4 Neon).
Marvisak commented 2026-11-25 11:05:21 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T10:27:43Z.


Automated triage for the maintainers.

find_by_local_id in crates/victory-hle/src/modules/xuser.rs now returns HRESULT_FROM_WIN32(ERROR_NOT_FOUND) (0x80070490) for an unknown local id, which the PR cites from the public XUserFindUserByLocalId reference. Before, the shared found helper returned USER_NOT_FOUND. find_by_id keeps USER_NOT_FOUND. The test covers the known id, an unknown id (the handle stays null) and the unchanged by-id path. The change is small and follows the repo rules.

CI: no check runs have been reported for this head. Whichever of this PR and #2057 merges second must drop the entry from #2057's KNOWN list.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7159727035 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2073#issuecomment-7159727035). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T10:27:43Z. --- <!-- victory-triage v1 head=3dd083a3f0410bf38d444cc8a837f1cc9f74fc72 verdict=merge-candidate at=2026-11-25T10:27:28Z --> Automated triage for the maintainers. `find_by_local_id` in `crates/victory-hle/src/modules/xuser.rs` now returns `HRESULT_FROM_WIN32(ERROR_NOT_FOUND)` (0x80070490) for an unknown local id, which the PR cites from the public `XUserFindUserByLocalId` reference. Before, the shared `found` helper returned `USER_NOT_FOUND`. `find_by_id` keeps `USER_NOT_FOUND`. The test covers the known id, an unknown id (the handle stays null) and the unchanged by-id path. The change is small and follows the repo rules. CI: no check runs have been reported for this head. 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)_
upstream-sync closed this pull request 2026-11-25 23:03:42 +00:00
Marvisak commented 2026-11-25 23:05:57 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T22:05:44Z.


Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the console runtime does not return that code. The public page lists HRESULT_FROM_WIN32(ERROR_NOT_FOUND), but on a console both find functions return 0x89245104 when no user matches, which is what main returns. The title's only caller ignores the HRESULT in any case.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7175928633 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2073#issuecomment-7175928633). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T22:05:44Z. --- Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the console runtime does not return that code. The public page lists `HRESULT_FROM_WIN32(ERROR_NOT_FOUND)`, but on a console both find functions return `0x89245104` when no user matches, which is what `main` returns. The title's only caller ignores the HRESULT in any case. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!2071
No description provided.