HLE: XSystemGetXboxLiveSandboxId refuses a buffer under 16 bytes #939
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/939"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by LouisRiverstone on 2026-11-24T14:21:51Z.
Fixes #862.
XSystemGetXboxLiveSandboxIddocumentsXSystemXboxLiveSandboxIdMaxBytes(16) as the minimum buffer and returnsHRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)below it. We only checked the 7 bytes"RETAIL\0"needs, so a 7–15 byte buffer succeeded here and failed on console.sandbox_idnow returnsE_NOT_SUFFICIENT_BUFFERwhensize < 16, beforeput_string.put_stringis unchanged.Verify:
cargo test -p victory-hle xsystem. The new testa_sandbox_id_buffer_under_the_documented_minimum_is_refusedchecks that sizes 7 and 15 are refused and leave the buffer alone, and that size 16 givesS_OKwithused = 7.🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T14:24:06Z.
Review: APPROVED
Tested head
d4306f4(fast-forward onmainffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):cargo test -p victory-hle: 95 passed, 0 failed (plusno_dll_planting: 1 passed)cargo clippy -p victory-hle --all-targets: 0 warningscargo xtask policy: okClean fix enforcing the 16-byte minimum buffer size for
XSystemGetXboxLiveSandboxId. Approving.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by dcastell1 on 2026-11-24T14:35:09Z.
Verified on native Windows (no Wine): NVIDIA GeForce RTX 5090 (driver 621.24), Windows 11 10.0.26300, Rust 1.98.1, MSVC 14.44.35207, debug build.
main@ffe310ebaseline on this box: 342 passed, 0 failed, 6 ignored.One more than the baseline;
XSystemGetXboxLiveSandboxIdrefusing a short buffer is covered and green.Tree restored afterwards (full diff against a clean checkout); no game data, the tests are synthetic. AI-assisted (opencode): applied the patch to a built tree, ran
cargo test --workspace, reverted it.Imported from Marvisak/VIctory. Originally posted by pushkarreddyy on 2026-11-24T14:43:51Z.
Thanks @LouisRiverstone for the implementation and @dcastell1 for the testing!
Just a quick heads-up: Issue #862 was claimed earlier (claim on #862) and our matching PR is open at #972. It enforces
SANDBOX_ID_MAX_BYTES = 16with unit tests verifying sizes 0, 7, and 15 returnE_NOT_SUFFICIENT_BUFFER.Would really appreciate community testing and verification on PR #972 as well to help @Marvisak with review and integration!
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T15:26:41Z.
Review: APPROVED
Tested
d4306f4on Windows 11, RTX 5070, MSVC: builds,cargo test --workspace --no-fail-fast557 passed. One run hadframe::tests::waits_end_on_ticks_and_count_framesfail under load (the known timing flake, untouched here); it passed 3 of 3 on its own. The newa_sandbox_id_buffer_under_the_documented_minimum_is_refusedpasses.put_string, so a 7-15 byte buffer is refused and neither the buffer norusedis touched. The test covers that, plus the 16-byte success case.E_NOT_SUFFICIENT_BUFFER(0x8007007A) isHRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), as documented.sandbox_idin the vtable, matching the existingidentity_strings_fit_the_documented_sizes, which already passes 16.Merged into our fork's main.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T15:40:46Z.
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
d4306f4:cargo test -p victory-hlepasses, 96 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:25:30Z.
Automated triage for the maintainers.
Merge candidate.
sandbox_idincrates/victory-hle/src/modules/xsystem.rsnow refuses any buffer under 16 bytes withE_NOT_SUFFICIENT_BUFFERbeforeput_stringruns. This matches issue #862. The new test checks sizes 7 and 15 (refused, with the buffer anduseduntouched) and size 16 (S_OK,used = 7).Changed since the last review (new head
5a7687d): the doc comment onSANDBOX_ID_MAX_BYTESis now in plain terms and no longer names an identifier from the console SDK, which was the only thing asked for. Optional: the constant is a minimum, so a name likeSANDBOX_ID_MIN_BUFFERwould read better.CI:
checkfailing inemit::memory_tests::heap_direct_texture_reads_mark_their_heap_index(victory-shader). This PR does not cause it: the PR touches only victory-hle, and that test-harness failure was fixed on main in67e8ae1. The branch is based on an older main; a rebase or re-run should turn CI green.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:20:51Z.
Code review and Windows 11 verification at head
5a7687dc22c7merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/xsystem.rs:41, 68-73):SANDBOX_ID_MAX_BYTES = 16upfront, returningE_NOT_SUFFICIENT_BUFFER(0x8007_007A) without touchingbufferorusedwhensize < 16, and delegatessize >= 16cleanly toput_string(SANDBOX, size, buffer, used)(which also handles nullbufferand writes"RETAIL\0"+used = 7).cargo xtask policy:191 files ok;cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warningsvictory-hle: 153/153 unit + 2/2 integration passed (includinga_sandbox_id_buffer_under_the_documented_minimum_is_refused).LGTM.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.