feat(xgameruntime): serve the GDK threading API table from measured slots #71
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!71
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/71/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?
@Dark3581 on GitHub · 2026-11-23 05:13 UTC · original
Dark3581:feat/threading-api-table→main· +221 −14 · 6 files · 1 commits · merged 2026-11-23 05:17 UTCWhat
QueryApiImpl(#70) now serves its first method table, for the XAsync and XTaskQueue interface. With it, a bundled GDK module's initialization completes on AnyBox's runtime.How the table was mapped (measured from the title package's own HTTP client module; no SDK material used):
QueryApiImpl(&provider, &interface, &obj), thenobj->vtable[slot](args), thenvtable[2](Release). Methods start at slot 3.{073b7dcb-1fcf-4030-94be-e3c9eb623428}(provider and interface GUID are the same).XAsyncGetStatusXAsyncCancelXAsyncBeginXAsyncScheduleXAsyncCompleteXAsyncGetResultXTaskQueueCreateXTaskQueueCreateCompositeXTaskQueueGetPortXTaskQueueDuplicateHandleXTaskQueueCloseHandleXTaskQueueSubmitDelayedCallbackXTaskQueueTerminateXThreadAssertNotTimeSensitiveXTaskQueueDispatch), because no call site confirms them.Code (
xgameruntime/ApiImpl.cpp):QueryInterface(answers its own GUID andIUnknown),AddRef/Release(a singleton) and the method slots, which forward to the existingXAsync*/XTaskQueue*/XThread*implementations.QueryApiImplreturns it for the matching GUID pair; any other pair still stops with both GUIDs.InitializeApiImpl*now log their values and returnS_OK, so the module'sXGameRuntimeInitializecompletes.InitializeApiImplEx2still stops if its fourth argument isn't null, because that might be an output.The README row and the debt entry describe the table and how it was mapped.
Tested
Windows 10, MinGW (GCC) and MSVC 2022.
e2e_api_threading: the relinked fake title loads the runtime at run time and does the handshake. Through table slots only, it calls slot 29, creates a thread-pool queue (12), runs a delayed callback (19), runs an XAsync operation whose provider schedules (9) and completes (10) while the title waits on it (3), terminates (22) and closes (17) the queue, checks thatQueryInterfacerefuses another IID, and releases.e2e_api_unmapped: calling slot 16 stops as unsupported, naming the slot and the interface.HCInitialize(nullptr)now returnsS_OK: Before slot 29 was mapped, the run stopped there, naming slot 29.ctest: 77 of 77. With MSVC, the four API and loader e2e tests pass, and every target builds exceptab_gameinput, which needsgameinput.lib, which this machine doesn't have.python tools/check_conventions.pyanddebt_fold.py --check: ok.msvcp140.dll. That's an older, separate bug: the MSVC build links AnyBox's libraries against the dynamic C++ runtime, so they load a title's console copy. A follow-up PR fixes it.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.md