Implement the build 19041 xvcmgmt four-counter query #229
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!229
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/229/head"
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?
@bambermf on GitHub · 2026-11-23 06:14 UTC · original
bambermf:port/xvcmgmt-19041-counter-group→main· +43 −1 · 2 files · 1 commits · closed without mergingLibrary / area — console-sandbox, xvcmgmt system counter queries on build 19041.
Exports changed — none. Adds device request 0x150064 to the existing xvcmgmt dispatch path.
Source of behaviour — I traced the PIX tooling allocator in Fortnite's pixrt10.dll through headless IDA MCP. That allocator reads the existing single-counter request 0x150068. The adjacent request 0x150064 in the same build's xvcmgmt.sys reads four different SFR counters. This PR implements the four-counter request. I verified its handler at RVA 0x199d with IDA and ran its original instructions in Unicorn with a controlled XvioSfrCounterGet response.
What was wrong
The sandbox already allowed a caller to update individual counters and read them back. Reading the four counters together returned STATUS_INVALID_DEVICE_REQUEST on build 19041.
Measurements
On success the first 32 bytes contain the four 64-bit values in that order, byte 32 is zero, and the following guard byte is untouched. The failure path makes no reads and leaves output untouched.
The change
Handle the request on build 19041 using the same in-process SFR store that backs the individual reads and updates. The request accepts unaligned output and reports the driver's exact completion length. Newer driver versions were not measured.
Tests
The regression test sets four distinct 64-bit values through the update request and reads them through the public device dispatch. It checks the short-buffer error, completion event and byte count, all values, the trailing zero and both guards. Only Rust source and tests are included.
The full console-sandbox release suite passed on Windows x64 (39 tests). The local PR gate checked two files and found zero problems.
@omonkeyz on GitHub · 2026-11-23 13:45 UTC · original
Applied locally on main with your authorship kept (cherry-picked,
32098a1); tests pass in a sandbox. It ships in the next release; this PR will be closed when that is pushed. Thanks.@kiwe147 on GitHub · 2026-11-23 18:57 UTC · original
Tested head
cbfa7a9a49, applied withgit apply(whitespace ignored, the line endings of my checkout differ) onmainf89e410, together with #199, #232 (one tree; the PRs touch different files). It applied without conflicts and built.Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC, Rust 1.91.1.
cargo test -p console-sandboxNo new failure against
mainf89e410in any of these. This is one combined tree, not a run of this PR alone.AI-assisted: yes (Claude Code)
@omonkeyz on GitHub · 2026-11-25 13:09 UTC · original
Applied on main in
32098a1(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed