A GDK title reaches XTaskQueue/XAsync/XThread/XError through
xgameruntime.lib thunks, not named imports: QueryApiImpl(class, class),
one vtable slot with `this` first, then Release. QueryApiImpl refused
every class, so none of those calls could work.
The slot order is xgameruntime-docs' Layout list after IUnknown, and is
measured: the thunks linked into the package's libHttpClient.GDK.dll and
XCurl.dll (disassembled, not run) call IXThreadingImpl slots 3-7 and 9-30
and IXErrorImpl slot 3, each with the argument shape of the documented
function at that position (docs/runtime_imports.md, "Class layouts,
measured").
- XThreadingImpl: 28 slots forwarded to third_party/xtaskqueue (the same
code the named exports use), a per-thread time-sensitive flag, and the
two private slots (XAsyncBeginAlloc, XTaskQueueIsEmpty) logged once.
- XErrorImpl: XErrorReport (the docs' "_unknown_" slot; HRESULT + string)
logs and calls the XErrorSetCallback callback; XErrorSetOptions is S_OK.
- Process-wide singletons; QueryInterface answers IUnknown and the class.
- xgameruntime_test drives both slot by slot; tiny_gdk_load (under
gta6rt --run) creates and closes a queue through slots 12 and 17.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#1384 made the loader answer LoadLibrary/GetProcAddress for shim-owned modules, because the package's GDK
modules load xgameruntime.dll at run time instead of importing it. Only a registry-level unit test covered
it. tiny_gdk_load.exe has no xgameruntime.dll import and does what xgameruntime.lib's thunks do:
LoadLibraryW, GetProcAddress of the five entry points, InitializeApiImplEx2, QueryApiImpl for XThreadingImpl
and UninitializeApiImpl. ctest run_tiny_gdk_load runs it under gta6rt --run, so its own kernel32 imports go
through the loader's binding, and checks the verdict from outside as run_tiny_async does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>