runtime: add XGameRuntime thunk skeleton #1051
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!1051
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1051/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?
@lambirou on GitHub · 2026-11-23 23:22 UTC · original
lambirou:runtime/xgameruntime-thunks→main· +830 −4 · 13 files · 3 commits · merged 2026-11-23 23:59 UTCChange
Add the first XGameRuntime shim skeleton and its load test.
src/xgameruntime_shim.cppuses one X-macro table to define seven public thunks and theirmetadata. The table covers XUser, XGameSave, XPackage, XSystem, XGame, XAsync and XTaskQueue.
log, then returns
E_NOTIMPL(0x80004001). A missing export remains distinguishable from apresent skeleton thunk.
xgameruntime.dllis built inout/build/<preset>/fixture-shims, never beside the normalxmem.dllord3d12_xs.dll. The C++ test loads it by explicit path and checks bothdirectories.
src/xgameruntime_shim.deffixes the DLL name and declares no ordinals; exports are generatedfrom the table with
__declspec(dllexport).tests/xgameruntime_thunks_check.cpploads the built DLL, resolves each name, calls eachthunk, checks the log and duplicate names, and verifies an unknown export returns null.
tests/xgameruntime_table_check.pystatically checks the table and.deffor the requiredclasses, duplicates and source/export consistency. It is registered in the Linux Python job and
the AGENTS list.
tests/xgameruntime_preflight_check.pypackages a real source-built EXE that importsxgameruntime.dll!XUserAddAsyncwith the normal shims but without the fixture DLL. Strictplan(report, allow_external=False)refuses the import asexternal_unverifiedbefore anyimage is mapped.
This is a skeleton, not an ABI-complete implementation. No Xbox ordinal is guessed.
Verification
cmake --build --preset dev --target xgameruntime_shim xgameruntime_shim_checkctest --preset dev --no-tests=error -R '^xgameruntime_thunks$' -VDesktop fixture xgameruntime.dll: exports=7 calls=7 unknown_export=null log=7 PASS.ctest --preset dev --no-tests=error -R '^xgameruntime_preflight_stub_refused$' -Vxgameruntime preflight: package=real-source-exe import=xgameruntime.dll!XUserAddAsync status=external_unverified strict_plan=refused mapped=0 PASS.python -B tests/xgameruntime_table_check.pyexports=7 classes=XAsync,XGame,XGameSave,XPackage,XSystem,XTaskQueue,XUser duplicate_control=detected PASS.python -B tests/pe_package_preflight_check.py -v -k test_strict_plan_refuses_external_providerdumpbin /exportsshows the seven public names and the two shim-only log functions.releasepreset.dumpbin /importson the fixture EXEshows only
xgameruntime.dll!XUserAddAsync. The fixture DLL is absent from both normal shimdirectories and present only under
fixture-shims.Evidence and follow-up
runtime/xgameruntime-thunks, headd295488, based onc74d708. Three commits:239d363adds the skeleton;af71215moves the DLL tofixture-shims, checks the normaldirectory, and adds the real EXE preflight control and the strict
allow_external=Falseplan;d295488registers the generated fixture import library withtarget_sourcesso theVS 2026/Ninja build has a rule for it.
XUserAddAsync,
XGameSaveInitializeProviderAsync,
XPackageMountWithUiAsync,
XSystemGetConsoleId,
XGameGetXboxTitleId,
XAsyncGetStatus,
XTaskQueueCreate.
ivall/xcl@38b05b7b6954cfa5bd21cec72f68823603ca2227, public GDKdocumentation only, observed 2026-11-23 for the class list. No XCL table, ordinal, identifier
or code was copied.
XGame in XCL-07. Each class needs an owned fixture and a negative control before it is called
implemented.
EXE preflight control are one behavior: proving the fixture DLL is not a provider. Actual
provider work lands one observable API contract at a time.
Checklist
@R0Y00 on GitHub · 2026-11-23 23:27 UTC · original
The named exports and E_NOTIMPL log can help a controlled caller trace. Please keep this DLL in a fixture-only output directory and have the test load it by explicit path. A production-named DLL next to the normal shims can satisfy name resolution even though none of these APIs provides its documented behavior. Add a source-built control that strict package preflight still refuses the unimplemented import before entry. Retain the explicit E_NOTIMPL and unknown-export checks for the fixture. Actual provider work can then land one observable API contract at a time.
@lambirou on GitHub · 2026-11-23 23:39 UTC · original
Addressed in
af71215. xgameruntime.dll now builds in out/build//fixture-shims, and the load test checks it is not in the normal shim directory. A real source-built EXE importing xgameruntime.dll!XUserAddAsync is packaged with xmem.dll and d3d12_xs.dll but without the fixture DLL; strict plan(report, allow_external=False) refuses it as external_unverified before mapping. Added the strict-plan unit control and documented the fixture-only path. The E_NOTIMPL, log and unknown-export checks remain. Targeted CTest: xgameruntime_thunks and xgameruntime_preflight_stub_refused both pass.@R0Y00 on GitHub · 2026-11-23 23:42 UTC · original
The fixture isolation and strict-plan refusal are in place. A clean Ninja build failed because the generated import library had no target dependency. I pushed
d295488eto register that output. The two XGameRuntime checks and the existing package import-closure check pass in both Windows presets (3/3 each). The strict source-built package reports external_unverified and maps no images. The static thunk-table check also passed.@lambirou on GitHub · 2026-11-23 23:43 UTC · original · edited 2026-11-23 23:44 UTC
Adopted
d295488, which registers the generated fixture import library with target_sources. Both Windows presets pass the two XGameRuntime checks and the package import-closure check. My local a486d53 variant was dropped; the PR body now points tod295488.