Other Xbox Series compatibility-layer efforts have run the same package's
console DLLs, shader pack and retail titles. This folds their published
measurements into docs/d3d12_vulkan.md §7 — the CS root-argument packing, the
inline record opcodes, the mesh inputs, the OpenExistingHeapFromAddress UMA
recipe, 64 KiB physical pages, more command-list slot numbers and the console
export surface — each row paraphrased with its measurement basis noted.
The unimplemented-import classifier learns the console DLL names from that
surface (d3d12_xs!D3D12XboxCreateSyntheticDevice, xaudio2_9!XAudio2Create,
gameinput!GameInputCreate, dstorage_xs!DStorageGetFactory) so fail/stop
policies report E_NOTIMPL honestly instead of faking success; functions with
no measured return (xg_xs, AcpHal, D3D12XboxSetProcessDebugFlags) stay `other`.
Classification checks added to unimplemented_policy_test.
AI-assisted. Tested: test_i18n_index, test_docs_links, compileall. The
registry/test change is Windows-only C++ and was not compiled here.
Data directories past NumberOfRvaAndSizes were read anyway (only the
exception directory checked the count), so stale bytes there were parsed
as import, delay-import, export or relocation tables. And resolve_forwarder
range-checked the ordinal before adding each digit, so '#65537' passed and
was cast to ordinal 1. The hand-built test images now declare their 16
directories.
- make_common_stub checks RtlAddFunctionTable and reports a failure once;
the stub keeps working, only stack walks through it stop.
- rt_unimplemented keys per-import state by the thunk's `what` pointer, so a
repeat call does one map lookup and builds no strings.
- A test hook (set_unimplemented_test_hook) lets unimplemented_policy_test
check, from inside the call, that rsp is aligned and that
RtlLookupFunctionEntry/RtlVirtualUnwind walk through rt_unimplemented and
the stub back to the caller.
- abi_probe.asm (MASM) calls a thunk with rbx/rbp/rdi/rsi/r12-r15 and
xmm6-xmm15 set to patterns and compares them afterwards, with a control
callee that clobbers rbx and xmm6.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
An unimplemented import used to return 0 silently, which is S_OK for an
HRESULT function with its out parameters never written. The thunk now passes
the caller's return address and rcx/rdx/r8/r9 to a shared stub, and
LEONIDA_UNIMPLEMENTED picks the behaviour:
- log (default): exactly as before.
- fail: E_NOTIMPL for imports known to return HRESULT (D3D12Create*/Serialize*,
CreateDXGIFactory*, XGameRuntimeInitialize, and the GDK XAsync/XTaskQueue/
XUser/XStore/XGameSave/XPackage/XGameUi families minus their documented
void/bool/int functions), 0 otherwise.
- stop: print the import, the caller as module+RVA and the four argument
registers, then break under a debugger or exit with code 3.
--dry-run now counts unimplemented imports by return class. The stub zeroes
xmm0 and has unwind info, so float callers and debuggers are unaffected.
unimplemented_policy_test builds a synthetic image and checks all three modes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>