[PR #1240] runtime/shims: shim PSM app-notification and WER file registration APIs (RT-PSM-APPNOTIFY-WER) #1270

Open
opened 2026-11-26 20:20:40 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1240
Author: @piyonchu
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: pr/psm-appnotify-wer-shims


📝 Commits (1)

  • 677379b runtime/shims: shim PSM app-notification and WER file registration APIs (RT-PSM-APPNOTIFY-WER)

📊 Changes

4 files changed (+412 additions, -2 deletions)

View changed files

📝 runtime/CMakeLists.txt (+15 -0)
➕ runtime/shims/appnotify.cpp (+236 -0)
➕ runtime/test/appnotify_test.cpp (+159 -0)
📝 scripts/build_runtime.ps1 (+2 -2)

📄 Description

Summary

Claim ID: RT-PSM-APPNOTIFY-WER

Adds runtime/shims/appnotify.cpp and runtime/test/appnotify_test.cpp (wired into runtime/CMakeLists.txt and scripts/build_runtime.ps1):

  • Shims RegisterAppConstrainedChangeNotification and UnregisterAppConstrainedChangeNotification across kernel32.dll, kernelbase.dll, twinapi.appcore.dll, and api-ms-win-core-psm-appnotify-l1-1-0/1.dll, returning distinct tracked registration handles, ignoring nullptr/foreign/already-freed handles cleanly on unregister, and using constant-initialized SRWLOCK + raw lists to avoid MSVC TLS init guards. (RegisterAppStateChangeNotification and UnregisterAppStateChangeNotification are left out so they do not collide with #769.)
  • Shims WerRegisterFile / WerUnregisterFile across kernel32.dll, kernelbase.dll, wer.dll, and api-ms-win-core-windowserrorreporting-l1-1-0/1.dll, tracking normalized GAME:/G:/T: and host paths in-process without mutating host WER state or creating files on disk.
  • Adds unit tests in runtime/test/appnotify_test.cpp executed via rt::shims::find.

Verification

  • Host: Windows 11 (10.0.26100 SDK), MSVC (RelWithDebInfo), rebased onto cont/main (871e4b8b9), commit b607337fd.
  • ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure: 100% tests passed out of 148 (including #83 appnotify), with 7 game-data tests skipped (LEONIDA_GAME_DIR unset) and 2 gameinput tests disabled (no SDL3).
  • python -I tests/test_build_runtime_fallback.py: passed (10/10).
  • python -I scripts/check_no_game_data.py ... and git diff --check cont/main..HEAD: clean.
  • No game files used; CPU runtime test only (no GPU required). AI-assisted.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1240 **Author:** [@piyonchu](https://github.com/piyonchu) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/psm-appnotify-wer-shims` --- ### 📝 Commits (1) - [`677379b`](https://github.com/ubiquitarianism/leonida/commit/677379b01884ee108b51260ed5d853dd798f3b70) runtime/shims: shim PSM app-notification and WER file registration APIs (RT-PSM-APPNOTIFY-WER) ### 📊 Changes **4 files changed** (+412 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+15 -0) ➕ `runtime/shims/appnotify.cpp` (+236 -0) ➕ `runtime/test/appnotify_test.cpp` (+159 -0) 📝 `scripts/build_runtime.ps1` (+2 -2) </details> ### 📄 Description ### Summary Claim ID: `RT-PSM-APPNOTIFY-WER` Adds `runtime/shims/appnotify.cpp` and `runtime/test/appnotify_test.cpp` (wired into `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1`): - Shims `RegisterAppConstrainedChangeNotification` and `UnregisterAppConstrainedChangeNotification` across `kernel32.dll`, `kernelbase.dll`, `twinapi.appcore.dll`, and `api-ms-win-core-psm-appnotify-l1-1-0/1.dll`, returning distinct tracked registration handles, ignoring `nullptr`/foreign/already-freed handles cleanly on unregister, and using constant-initialized `SRWLOCK` + raw lists to avoid MSVC TLS init guards. (`RegisterAppStateChangeNotification` and `UnregisterAppStateChangeNotification` are left out so they do not collide with `#769`.) - Shims `WerRegisterFile` / `WerUnregisterFile` across `kernel32.dll`, `kernelbase.dll`, `wer.dll`, and `api-ms-win-core-windowserrorreporting-l1-1-0/1.dll`, tracking normalized `GAME:`/`G:`/`T:` and host paths in-process without mutating host WER state or creating files on disk. - Adds unit tests in `runtime/test/appnotify_test.cpp` executed via `rt::shims::find`. ### Verification - Host: Windows 11 (`10.0.26100` SDK), MSVC (`RelWithDebInfo`), rebased onto `cont/main` (`871e4b8b9`), commit `b607337fd`. - `ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure`: `100% tests passed out of 148` (including `#83 appnotify`), with 7 game-data tests skipped (`LEONIDA_GAME_DIR` unset) and 2 `gameinput` tests disabled (no SDL3). - `python -I tests/test_build_runtime_fallback.py`: passed (`10/10`). - `python -I scripts/check_no_game_data.py ...` and `git diff --check cont/main..HEAD`: clean. - No game files used; CPU runtime test only (no GPU required). AI-assisted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
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.

Dependencies

No dependencies set

Reference
starred/leonida#1270
No description provided.