runtime: export XMemTransferMemory with an explicit desktop refusal #977
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/984"
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 Holastor on 2026-11-23T19:49:47Z.
Export
XMemTransferMemoryfromxmem.dll(assigned ordinal@13) with a narrow desktop refusal semantics and verification of state preservation.Following the merged prerequisite and failure-chain fixtures (#935 and #955), this runtime export resolves the missing import (
xmem.dll!XMemTransferMemory) identified during runtime import binding preflight in #870.Behavior
XMemIsToolsMemAvailable() == FALSEper #896), returnsFALSEwithERROR_NOT_SUPPORTED(50).ERROR_INVALID_PARAMETER(87), all calls take this narrow refusal. Never reports unbacked ownership transfer.XMemTransferMemoryunder existing caller sequences (including partition 1, 2 MiB / 16 MiB counts, and variant inputs) leaves heap allocations, GPU graphics allocations,era_queryregistration, physical page grants, tools memory status, and working-set statistics untouched.XMemTransferMemory @13insrc/xmem_shim.def.Verification
Release build:
Documentation and hygiene checks:
All passed.
Refs #870.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T19:57:34Z.
Thanks for keeping the no-tools path a real refusal. #935 and #955 establish the recorder's inputs and the caller's failure path. They do not establish partition 1, 2 MiB alignment, or the 16 MiB cap as runtime validation rules. Please cite independent evidence for any input that must return 87. With only the current evidence, use a narrow desktop refusal and verify it leaves memory/accounting unchanged under the existing caller sequence. Also distinguish a resolved import that refuses transfer from evidence that the startup path can proceed past the call.
Imported from R0Y00/Xbox2Windows. Originally posted by Holastor on 2026-11-23T20:06:58Z.
Thanks @R0Y00, that makes total sense. Updated in commit
88e454d:Narrow desktop refusal:
ERROR_INVALID_PARAMETER(87), as #935 and #955 establish the recorder's inputs and failure paths rather than production runtime parameter validation rules.XMemTransferMemoryunconditionally setsERROR_NOT_SUPPORTEDand returnsFALSE.Memory and accounting preservation verification:
tests/xmem_shim_check.cpp(xmem_shim_transfer_memory) to verify that callingXMemTransferMemoryacross existing caller sequences (including partition 1, 2 MiB and 16 MiB counts, as well as variant inputs) leaves:era_queryintact with unmodified bytes;FALSE);Distinguishing import resolution from startup progression:
docs/experiments.mdand the PR summary to explicitly distinguish that resolving the missing export allows PE import binding to succeed at load time (clearing the status 5 unresolved import), but does not establish that the startup path can proceed past an unsupported transfer.Both
devandreleasepresets build and pass 12/12xmem_shim_*tests locally, and all repository hygiene checks pass.Imported from R0Y00/Xbox2Windows. Originally posted by Jess-Doit on 2026-11-23T20:14:18Z.
Independent Windows 10 check of
88e454d(22H2 19045.6456, MSVC 19.44 x64, Release). Eight focused XMem tests passed, includingxmem_shim_transfer_memoryandxmem_shim_mapped_pages.The same binding-only probe as the #870 checkpoint bound 217 imports in two runs and stopped with status 5 at
d3d12_xs.dll!D3D12ConfigureVirtualMemoryX. Withholding onlyXMemTransferMemoryreproduced the prior 174-import stop at that name. The probe stops at import binding, before executable initialization or calling the transfer function.AI-assisted (Codex).