runtime: report the native error for null query output #221
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/224"
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 R0Y00/Xbox2Windows. Originally posted by Vonsek on 2026-11-21T18:36:31Z.
Change
When a caller gives desktop
XMemVirtualQuerya null output pointer,xmem.dllreturnsFALSEand sets the Windows last error toERROR_NOACCESS. Previously the export always reportedERROR_BAD_LENGTHeven though its fixed 64-byte result capacity was sufficient. The shared query handler checks the supplied length first, matching the Windows error for null outputs shorter thanMEMORY_BASIC_INFORMATION.Verification
Windows x64 build 26200, MSVC 19.44.35230, Debug, based on
f02c237.All nine selected cases passed, with zero skips. The direct handler fixture compares the return value and last error with
VirtualQueryExin the same process. The named DLL import exercises the 64-byte case independently.With the tests added and the previous implementation,
ctest --preset dev --no-tests=error -R '^(era_query_short|xmem_shim_query)$' -Vfailed both tests. The first handler mismatch wasnull_query_length=48 native_error=998 shim_error=24. The separate DLL fixture reportednull_output_error=24.Evidence and follow-up
The fixture uses a valid address in its own process and a null output. Existing cases check a short non-null buffer stays untouched and an exactly sized non-null buffer succeeds. These measurements describe the desktop shim contract. They do not establish console last-error behavior.
This contribution was AI-assisted.
Checklist
era_query_shortexperiment indocs/experiments.md.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-21T18:36:41Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
216df14ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.