Preserve the statistics buffer on invalid 19041 XMem pool queries #219
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!219
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/219/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 05:36 UTC · original
bambermf:fix/xmem-legacy-stats-invalid-type→main· +31 −0 · 1 files · 1 commits · closed without mergingLibrary / area: XMem, allocation statistics on OS build 19041.
Exports changed (exports.txt rows): none. The change is in the existing
XMemGetAllocationStatisticsexport.Source of the behaviour: headless IDA analysis of Fortnite's XMem 10.0.19041.3948. I also executed the original getter instructions in Unicorn with a stand-in for SetLastError and a seeded pool for the valid control. The emulator measurements call the release DLL export in separate processes for each OS build.
What was wrong
With a correctly sized output and an invalid memory type, upstream returned success and zeroed the statistics fields. The original 19041 getter returned failure and preserved the caller's buffer.
Measurements
The change
For build 19041, return ERROR_INVALID_PARAMETER when the pool index is invalid. The output size check still runs first. The same export probes on the emulator's 22000 profile confirmed its previous behavior.
Tests
The regression failed on main
f6ae886(returned 1) and passed on this branch. It runs with the 19041 profile in an isolated process and checks the entire output buffer. Serial release XMem tests passed: 56 unit tests and 3 integration tests. No console files or binaries are included.@omonkeyz on GitHub · 2026-11-23 05:44 UTC · original
Applied in
9475037(merged in1dc9fff) with your authorship kept, thanks.Pull request closed