Measured 2026-11-29 by HTTP against the public docs.xbox.com index and Microsoft Learn; page contents not read, nothing copied from the GDK. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
8.4 KiB
Using the public GDK to write shims
How to use Microsoft's public GDK documentation and headers to implement the console APIs the game imports, without copying Microsoft's files and without touching anything under NDA. A convention for contributors; only the table of public pages is a measurement.
The rule in one line
Read the public PC GDK reference and headers, then write in your own words only what a shim needs: names, values, signatures and struct layouts. Never commit GDK files, and never use the console GDK, which is under NDA.
What the public GDK gives the project
- Signatures, enums and structs of the system APIs the game imports: XGameRuntime, XTaskQueue, XUser, XStore, XGameSave and GameInput.
- That is what these already implement, and they are the models to follow:
runtime/shims/xgameruntime.cpp,xgameruntime_user.cpp,xgameruntime_store.cpp,xgameruntime_gamesave.cpp,xgameruntime_offline.cppd3d12/crates/leonida-hle/src/modules/xgameruntime.rsruntime/shims/gameinput*(see gameinput.md)
What it does not give
- The console-only graphics surface:
D3D12XboxCreateDevice,PresentX, XDXR and the rest ofd3d12_xsbeyond what the public pages list. d3d12_xs_surface.md and xbox_d3d12_xs.md say which pages exist and which are missing or NDA-gated. - Those layouts are recovered from the game's own call sites and from public code compiled against the headers (Mesa, ebiten, the Microsoft samples), as d3d12_vulkan.md does. They are not guessed, and they are not taken from leaked or NDA material.
The method, in 4 steps
- Get the public references. The system API reference at
docs.xbox.com
(pages under
reference/system/<family>/functions/<name>), the graphics reference at devdocs.xbox.com, and the public PC GDK headers from Microsoft's own download. GameInput is also published as theMicrosoft.GameInputNuGet package. - List what the game imports, locally, on your own copy (
dumpbin /imports). The measured tables are already in runtime_imports.md, andtests/test_gdk_runtime_calls.pychecks them. Nothing from the game goes into the repository. - For each missing function, read its public page and header, then write the declaration and the shim yourself,
with a test:
runtime/test/xgameruntime_*_test.cppfor the C++ runtime, withruntime/test/fixtures/tiny_gdk_load.cppas the model for loading a GDK-style module. - Document it in runtime_imports.md, linking the public page you used. Then the usual
path: claim it in the coordination issue, open a pull request with a test that fails on
mainand passes with it (CONTRIBUTING.md).
Public pages by family
MEASURED on 2026-11-29 from a Mac, by HTTP only; the page contents were not read. Each GDK name in
runtime_imports.md (the names in backticks, not the whole import table) was looked up in two
places: the public index at https://docs.xbox.com/_llms/en/apis/gdk-apis/system-api-reference.txt (and its XStore
part), then directly at https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/<area>/<family>/<kind>/<name>
(kinds functions, structs, enums, handles). A name counts as found when the page answers 200 with that name in
its title. The index is incomplete: it leaves out most of XMem and all of XNetworking, whose pages do exist on
Microsoft Learn.
| Family | Contents page | Found | Not found |
|---|---|---|---|
| XAccessibility | xaccessibility | 2 | |
| XAppCapture | xappcapture | 1 | |
| XAsync | xasync | 2 | |
| XAsyncProvider | xasyncprovider | 3 | XAsyncBeginAlloc |
| XDisplay | xdisplay | 3 | |
| XError | xerror | 1 | XErrorReport |
| XGame | xgame | 3 | |
| XGameEvent | xgameevent | 1 | |
| XGameRuntimeFeature | xgameruntimefeature | 1 | |
| XGameRuntimeInit | xgameruntimeinit | 1 | |
| XGameSave | xgamesave | 5 | |
| XGameSaveFiles | xgamesavefiles | family page only | |
| XGameStreaming | xgamestreaming | 3 | |
| XGameUI | xgameui | 1 | |
| XLauncher | xlauncher | 1 | |
| XMem | xmem | 13 | |
| XNetworking | xnetworking | 2 | |
| XPackage | xpackage | 2 | |
| XPersistentLocalStorage | xpersistentlocalstorage | 2 | |
| XSpeechSynthesizer | xspeechsynthesizer | 2 | |
| XStore | xstore | 4 | XStoreIsAvailabilityPurchasable |
| XSystem | xsystem | 7 | |
| XTaskQueue | xtaskqueue | 4 | XTaskQueueIsEmpty |
| XThread | xthread | 2 | |
| XUser | xuser | 11 | XUserHandle |
| XApu (console audio) | none found | 0 | XApuConnect, XApuDequeueResult, XApuDisconnect, XApuEnqueueCommand, XApuGetResultCount |
| XDsp (console audio) | none found | 0 | XDspActivate, XDspConnectWithMaximumStreamLimit, XDspDeactivate, XDspDisconnect, XDspSubmitCommand |
| XG (console graphics) | none found | 0 | XGCreateTextureComputer, XGSuggestSwizzleMode |
"Not found" means no page at the index or at the usual paths on that date; the five names in the upper rows may
still be documented under another path or name. For the last three rows no public page was found at all: treat
them like d3d12_xs above and recover what a shim needs from the game's call sites.
Lines not to cross
- Do not copy GDK headers, samples or documentation text into the repository. They are under Microsoft's licence. Take the facts (names, values, layouts), not the text.
- Nothing from the console GDK or from a leak, not even to check a value. If a layout is only in NDA material, write down that it is open and recover it from call sites instead.
- The repository's hard rules still apply (AGENTS.md): no keys, no decryption, no protection
workarounds, and nothing online. The shims answer offline (
runtime/shims/xgameruntime_offline.cpp); no Xbox Live or Rockstar services.