runtime: trampoline xgameruntime!QueryApiImpl for pre-attach GPA caches #2342

Open
opened 2026-11-25 13:14:09 +00:00 by cursor · 1 comment
cursor commented 2026-11-25 13:14:09 +00:00 (Migrated from github.com)
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by cursor on 2026-11-25T13:14:09Z.


Context

startup_runtime_proxy_scope and the account-picker Y stall dig after #2166 show that a QueryApiImpl pointer resolved before the GameInput/runtime_proxy attach stays the real export. IAT/GPA rewrites do not touch already-held function pointers, so FakeUser/X2W_TRACE_API never see providers on that path.

Related: bound delay-IAT rewrite in https://github.com/R0Y00/Xbox2Windows/pull/2349. Refs #870. Do not ship a FakeUser slot-7 guess from account-picker logs that still show zero providers.

Done when

  1. After the proxy attaches, a QueryApiImpl pointer that was cached from xgameruntime.dll before attach forwards through the proxy (providers / provider … proxied appear when that pointer is called with readable GUIDs).
  2. An unrelated module that also exports QueryApiImpl (the existing decoy) is not trampolined.
  3. Docs: one sentence on the X2W_RUNTIME_PROXY row in docs/startup-runtime.md describing the export trampoline and its limits.

Acceptance command

ctest --preset dev --no-tests=error -R '^startup_runtime_proxy_scope$'

Extend that fixture (or a sibling) so the pre-attach cached pointer check that today expects the real export instead expects the proxy after this change.

Also keep:

g++ -std=c++17 -Wall -Wextra -Werror -Isrc -o /tmp/gpa_patch_check tests/startup_runtime_gpa_patch_check.cpp
/tmp/gpa_patch_check
/tmp/gpa_patch_check --mutate name-only   # must print FAIL:

Negative control

  • Decoy QueryApiImpl export must remain the decoy's own function (existing scope check).
  • Do not patch non-xgameruntime.dll modules' exports.
  • Title-neutral; no game files.

Out of scope

FakeUser XUserAddAsync / slot 7 completion. That needs observed provider calls after Y first.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6605309305 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2350). Originally posted by [cursor](https://github.com/apps/cursor) on 2026-11-25T13:14:09Z. --- ## Context `startup_runtime_proxy_scope` and the account-picker Y stall dig after #2166 show that a `QueryApiImpl` pointer resolved **before** the GameInput/`runtime_proxy` attach stays the real export. IAT/GPA rewrites do not touch already-held function pointers, so FakeUser/`X2W_TRACE_API` never see providers on that path. Related: bound delay-IAT rewrite in https://github.com/R0Y00/Xbox2Windows/pull/2349. Refs #870. **Do not** ship a FakeUser slot-7 guess from account-picker logs that still show zero providers. ## Done when 1. After the proxy attaches, a `QueryApiImpl` pointer that was cached from `xgameruntime.dll` **before** attach forwards through the proxy (providers / `provider … proxied` appear when that pointer is called with readable GUIDs). 2. An unrelated module that also exports `QueryApiImpl` (the existing decoy) is **not** trampolined. 3. Docs: one sentence on the `X2W_RUNTIME_PROXY` row in `docs/startup-runtime.md` describing the export trampoline and its limits. ## Acceptance command ```powershell ctest --preset dev --no-tests=error -R '^startup_runtime_proxy_scope$' ``` Extend that fixture (or a sibling) so the pre-attach cached pointer check that today expects the **real** export instead expects the **proxy** after this change. Also keep: ```bash g++ -std=c++17 -Wall -Wextra -Werror -Isrc -o /tmp/gpa_patch_check tests/startup_runtime_gpa_patch_check.cpp /tmp/gpa_patch_check /tmp/gpa_patch_check --mutate name-only # must print FAIL: ``` ## Negative control - Decoy `QueryApiImpl` export must remain the decoy's own function (existing scope check). - Do not patch non-`xgameruntime.dll` modules' exports. - Title-neutral; no game files. ## Out of scope FakeUser `XUserAddAsync` / slot 7 completion. That needs observed provider calls after Y first.
SimSalabimse commented 2026-11-25 14:05:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from R0Y00/Xbox2Windows. Originally posted by SimSalabimse on 2026-11-25T13:35:40Z.


Claiming for an xgameruntime!QueryApiImpl export trampoline so a pre-attach cached pointer forwards through the proxy after attach (IAT/GPA alone cannot). Decoy QueryApiImpl stays untouched. Synthetic fixture + negative control in startup_runtime_proxy_scope; docs one-liner on the X2W_RUNTIME_PROXY row. Refs #870. Not shipping a FakeUser slot-7 guess from zero-provider logs.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7164004212 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/2350#issuecomment-7164004212). Originally posted by [SimSalabimse](https://github.com/SimSalabimse) on 2026-11-25T13:35:40Z. --- Claiming for an `xgameruntime!QueryApiImpl` export trampoline so a pre-attach cached pointer forwards through the proxy after attach (IAT/GPA alone cannot). Decoy `QueryApiImpl` stays untouched. Synthetic fixture + negative control in `startup_runtime_proxy_scope`; docs one-liner on the `X2W_RUNTIME_PROXY` row. Refs #870. Not shipping a FakeUser slot-7 guess from zero-provider logs.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
R0Y00/Xbox2Windows#2342
No description provided.