xgameruntime: test the XErrorReport export and count it among the looked-up names (OLD-9914) #1149

Open
github-bot wants to merge 1 commit from github-bot/gh-1149 into main AGit
Owner

@⁠ambroseautomation on GitHub · 2026-11-24 19:14 UTC · original
ambroseautomation:carry/old-9914-xerror-export-test → main · +12 −3 · 2 files · 1 commits · open

Claimed in the coordination issue as: OLD-9914 (#14)

What and why

Carries forward old-pr/9914 (draft #182, original commit author Sunkiller-qc preserved; indexed in #17), rebased cleanly onto current main.

Adds regression coverage for the XErrorReport DLL export that XGameRuntimeInitialize looks up via GetProcAddress:

  • Checks that GetProcAddress(xgameruntime.dll, "XErrorReport") resolves to the shim table's function alongside the five xgameruntime.lib thunk entry points (6 total).
  • Invokes the export using its two-argument WINAPI signature XErrorReport(HRESULT, const char*) (no this) while the XErrorImpl callback is installed and verifies that the callback receives the HRESULT and message and returns S_OK.
  • Updates the entry-point comments in runtime/shims/xgameruntime.cpp and runtime/test/xgameruntime_test.cpp.

Tested

  • Compiled and ran xgameruntime_test.exe natively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2): xgameruntime_test: OK (159 checks).
  • python -I scripts/check_no_game_data.py runtime/shims/xgameruntime.cpp runtime/test/xgameruntime_test.cpp: exit 0 (no game data).

GPUs tested: n/a (CPU/OS runtime shim test; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a — xgameruntime test)
**@⁠ambroseautomation** on GitHub · 2026-11-24 19:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1149) `ambroseautomation:carry/old-9914-xerror-export-test` → `main` · +12 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: OLD-9914 (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### What and why Carries forward `old-pr/9914` (draft #182, original commit author `Sunkiller-qc` preserved; indexed in #17), rebased cleanly onto current `main`. Adds regression coverage for the `XErrorReport` DLL export that `XGameRuntimeInitialize` looks up via `GetProcAddress`: - Checks that `GetProcAddress(xgameruntime.dll, "XErrorReport")` resolves to the shim table's function alongside the five `xgameruntime.lib` thunk entry points (6 total). - Invokes the export using its two-argument `WINAPI` signature `XErrorReport(HRESULT, const char*)` (no `this`) while the `XErrorImpl` callback is installed and verifies that the callback receives the `HRESULT` and message and returns `S_OK`. - Updates the entry-point comments in `runtime/shims/xgameruntime.cpp` and `runtime/test/xgameruntime_test.cpp`. ### Tested - Compiled and ran `xgameruntime_test.exe` natively on Windows 11 with MSVC (`/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2`): `xgameruntime_test: OK (159 checks)`. - `python -I scripts/check_no_game_data.py runtime/shims/xgameruntime.cpp runtime/test/xgameruntime_test.cpp`: exit 0 (no game data). GPUs tested: n/a (CPU/OS runtime shim test; built and tested on Windows 11 Pro 64-bit, MSVC VS 18) AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a — `xgameruntime` test)
Follow-up to 6312c05, which exports XErrorReport for XGameRuntimeInitialize.

- check_run_time_load now asks GetProcAddress for XErrorReport alongside the
  five thunk entry points and checks it is the shim table's function.
- The export is called with its two-argument WINAPI signature (no `this`)
  while the XErrorImpl callback is set, and must reach that callback with the
  HRESULT and message and return S_OK.
- The comment above the run-time entry points mentions the sixth name.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:40:19 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 19:21 UTC · original · approved these changes

Reviewed and verified. Completes the GDK runtime initialization surface in
untime/shims/xgameruntime.cpp\ by testing the \XErrorReport\ export (signature \HRESULT(WINAPI*)(HRESULT, const char*), without \ his) and verifying that \GetProcAddress\ returns all 6 entry points expected by \xgameruntime.lib\ and \XGameRuntimeInitialize. Clean test addition in
untime/test/xgameruntime_test.cpp. 100% clean-room.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 19:21 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1149#pullrequestreview-6045827356) · **approved these changes** Reviewed and verified. Completes the GDK runtime initialization surface in \ untime/shims/xgameruntime.cpp\ by testing the \XErrorReport\ export (signature \HRESULT(WINAPI*)(HRESULT, const char*)\, without \ his\) and verifying that \GetProcAddress\ returns all 6 entry points expected by \xgameruntime.lib\ and \XGameRuntimeInitialize\. Clean test addition in \ untime/test/xgameruntime_test.cpp\. 100% clean-room.
Author
Owner

@⁠madhyn on GitHub · 2026-11-24 19:32 UTC · original

Tested a18e2d216 on Arch Linux + Wine 11.22 (clang-cl + xwin cross-build):

  • ctest --test-dir runtime/build/win -R "^xgameruntime$" --output-on-failure: Passed (5.41 s)

AI-assisted: yes

**@⁠madhyn** on GitHub · 2026-11-24 19:32 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1149#issuecomment-7142256352) Tested `a18e2d216` on Arch Linux + Wine 11.22 (clang-cl + xwin cross-build): - `ctest --test-dir runtime/build/win -R "^xgameruntime$" --output-on-failure`: **Passed** (5.41 s) AI-assisted: yes
Author
Owner

@⁠Deedlyy on GitHub · 2026-11-24 20:12 UTC · original

Recommendation: [MERGE]

Reasoning: Carries #182: adds a regression test that GetProcAddress(xgameruntime.dll, "XErrorReport") resolves to the shim and works with its two-argument signature, and counts it among the looked-up names. Mostly test-only. Verified on Wine. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

**@⁠Deedlyy** on GitHub · 2026-11-24 20:12 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1149#issuecomment-7143201966) **Recommendation:** [MERGE] **Reasoning:** Carries #182: adds a regression test that `GetProcAddress(xgameruntime.dll, "XErrorReport")` resolves to the shim and works with its two-argument signature, and counts it among the looked-up names. Mostly test-only. Verified on Wine. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1149/head:github-bot/gh-1149'
git switch 'github-bot/gh-1149'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1149'
git switch 'github-bot/gh-1149'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1149'
git switch 'github-bot/gh-1149'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1149'
git switch 'main'
git merge --squash 'github-bot/gh-1149'
git switch 'main'
git merge --ff-only 'github-bot/gh-1149'
git switch 'main'
git merge 'github-bot/gh-1149'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.