runtime: refuse forwarding an offline store context to desktop methods #1592

Merged
SuperCraft3M merged 2 commits from upstream-pr/1599 into main 2026-11-24 15:17:42 +00:00
SuperCraft3M commented 2026-11-24 14:44:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by SuperCraft3M on 2026-11-24T14:44:32Z.


Change

An unimplemented store operation can forward the offline context token created by the fake-user proxy to the desktop gaming runtime. The token is not a desktop runtime object, and a local diagnostic run faults when that runtime dereferences it.

Refuse unhandled calls carrying the known offline store token in any of the first four arguments with E_FAIL, before invoking the desktop method. This follows the existing synthetic-user forwarding guard and leaves typed handled operations in control of their own result. No store operation is newly implemented.

Verification

Main base be484d0f, patch ab913560, Windows 11 / MSVC 19.44 Debug.

cmake --build C:/Xbox2Windows-build --target startup_stub_consumer --parallel 4: passed.

ctest --test-dir C:/Xbox2Windows-build --no-tests=error -R '^startup_stubs$' --output-on-failure: passed 1/1, no skips, with TEMP/TMP set to C:/Xbox2Windows-build/test-temp (the fixture's ASCII log reader cannot read a non-ASCII temporary path).

The source-built store-context check now installs a sentinel desktop method. It requires E_FAIL for the token in each of the first four positions; a different value must still reach the sentinel. Existing creation, mutated-provider, foreign-user and invalid-output checks remain.

Evidence and limits

A private diagnostic run exposed a desktop-runtime fault after offline context creation; raw logs, pointers, binaries and captures are not attached. The public fixture verifies the forwarding boundary. It does not validate complete startup or store services. Original contribution under MIT. Reproduction is in docs/experiments.md.

AI-assisted (Codex).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6584398868 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1599). Originally posted by [SuperCraft3M](https://github.com/SuperCraft3M) on 2026-11-24T14:44:32Z. --- ## Change An unimplemented store operation can forward the offline context token created by the fake-user proxy to the desktop gaming runtime. The token is not a desktop runtime object, and a local diagnostic run faults when that runtime dereferences it. Refuse unhandled calls carrying the known offline store token in any of the first four arguments with E_FAIL, before invoking the desktop method. This follows the existing synthetic-user forwarding guard and leaves typed handled operations in control of their own result. No store operation is newly implemented. ## Verification Main base be484d0f, patch ab913560, Windows 11 / MSVC 19.44 Debug. `cmake --build C:/Xbox2Windows-build --target startup_stub_consumer --parallel 4`: passed. `ctest --test-dir C:/Xbox2Windows-build --no-tests=error -R '^startup_stubs$' --output-on-failure`: passed 1/1, no skips, with TEMP/TMP set to C:/Xbox2Windows-build/test-temp (the fixture's ASCII log reader cannot read a non-ASCII temporary path). The source-built store-context check now installs a sentinel desktop method. It requires E_FAIL for the token in each of the first four positions; a different value must still reach the sentinel. Existing creation, mutated-provider, foreign-user and invalid-output checks remain. ## Evidence and limits A private diagnostic run exposed a desktop-runtime fault after offline context creation; raw logs, pointers, binaries and captures are not attached. The public fixture verifies the forwarding boundary. It does not validate complete startup or store services. Original contribution under MIT. Reproduction is in docs/experiments.md. AI-assisted (Codex).
tedin7 commented 2026-11-24 15:02:17 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T15:01:28Z.

Review: COMMENTED


Reviewed ab913560 (src/startup_stubs/runtime_proxy.cpp, docs/experiments.md).

Findings

  • No defects found.
  • In forward<N>, checking args[0..3] against store_context_handle after save_call / area_call and before the local_user_handle guard ensures any unimplemented N >= 3 method (including store methods beyond slot 3) returns E_FAIL (0x80004005) instead of forwarding the synthetic token to the desktop vtable.
  • store_method3_check() verifies all four argument positions return 0x80004005 while a non-matching token (context ^ 1) still reaches the mock desktop method (0x1234).

Verification

  • Linux repo hygiene:
    • python3 tests/docs_links_check.py: passed (16 Markdown files, 346 links).
    • python3 tests/bidi_controls_check.py: passed (1255 tracked files).
  • Windows (OS build 26100, MSVC 14.44.35207, Debug & Release /O2):
    • ctest --preset dev -R '^(startup_gameinput_keys|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (0.60s).
    • ctest --preset release -R '^(startup_gameinput_keys|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure: 3/3 passed (0.53s).

AI-assisted; commands listed were executed locally.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:review:6041701149 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1599#pullrequestreview-6041701149). Originally posted by [tedin7](https://github.com/tedin7) on 2026-11-24T15:01:28Z. **Review:** COMMENTED --- Reviewed `ab913560` (`src/startup_stubs/runtime_proxy.cpp`, `docs/experiments.md`). ### Findings - No defects found. - In `forward<N>`, checking `args[0..3]` against `store_context_handle` after `save_call` / `area_call` and before the `local_user_handle` guard ensures any unimplemented `N >= 3` method (including store methods beyond slot 3) returns `E_FAIL` (`0x80004005`) instead of forwarding the synthetic token to the desktop vtable. - `store_method3_check()` verifies all four argument positions return `0x80004005` while a non-matching token (`context ^ 1`) still reaches the mock desktop method (`0x1234`). ### Verification - Linux repo hygiene: - `python3 tests/docs_links_check.py`: passed (16 Markdown files, 346 links). - `python3 tests/bidi_controls_check.py`: passed (1255 tracked files). - Windows (OS build 26100, MSVC 14.44.35207, Debug & Release `/O2`): - `ctest --preset dev -R '^(startup_gameinput_keys|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure`: 3/3 passed (`0.60s`). - `ctest --preset release -R '^(startup_gameinput_keys|startup_storage_directory_batch|startup_stubs)$' --parallel 4 --no-tests=error --output-on-failure`: 3/3 passed (`0.53s`). AI-assisted; commands listed were executed locally.
upstream-sync closed this pull request 2026-11-24 16:03:13 +00:00
R0Y00 commented 2026-11-24 16:03:32 +00:00 (Migrated from github.com)

Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T15:07:24Z.


Resolved the docs conflict at ae21de70 and kept both the offline forwarding and UTF-8 storage notes. The documented build now lists the DLL targets that the full startup_stubs fixture loads. Windows Release passed startup_stubs, startup_storage_root and its separator control (3/3), and the docs check passed all 348 links.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7135495186 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/pull/1599#issuecomment-7135495186). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T15:07:24Z. --- Resolved the docs conflict at ae21de70 and kept both the offline forwarding and UTF-8 storage notes. The documented build now lists the DLL targets that the full startup_stubs fixture loads. Windows Release passed startup_stubs, startup_storage_root and its separator control (3/3), and the docs check passed all 348 links.
Sign in to join this conversation.
No reviewers
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!1592
No description provided.