HLE: XSystemGetXboxLiveSandboxId refuses a buffer under 16 bytes #939
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!939
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@LouisRiverstone on GitHub · 2026-11-24 14:21 UTC · original
LouisRiverstone:hle/sandbox-id-buffer-minimum→main· +25 −0 · 1 files · 2 commits · openFixes #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
@dcastell1 on GitHub · 2026-11-24 14:35 UTC · original
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.@pushkarreddyy on GitHub · 2026-11-24 14:43 UTC · original
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!
@Zipettte on GitHub · 2026-11-24 15:40 UTC · original
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).
@Marvisak on GitHub · 2026-11-25 01:25 UTC · original · edited 2026-11-25 16:49 UTC
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
@fuzeofficlal on GitHub · 2026-11-26 01:20 UTC · original
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.