Skip to content

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

Backlog
SimSalabimse/Xbox2Windows
#5

Description

@cursor

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 #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.

Activity

  1. SimSalabimse commented on Nov 25, 2026

    @SimSalabimse
    Contributor

    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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions