[PR #1242] runtime/shims: shim Win32 localization, priority-boost, and named-pipe APIs (RT-WIN32-ENV-LOC-PIPE) #1274

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

📋 Pull Request Information

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

Base: main ← Head: pr/win32-loc-priority-pipe-shims


📝 Commits (1)

  • f222051 runtime/shims: shim Win32 localization, priority-boost, and named-pipe APIs (RT-WIN32-ENV-LOC-PIPE)

📊 Changes

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

View changed files

📝 runtime/CMakeLists.txt (+17 -0)
➕ runtime/shims/win32_env.cpp (+261 -0)
➕ runtime/test/win32_env_test.cpp (+161 -0)
📝 scripts/build_runtime.ps1 (+2 -2)

📄 Description

Summary

Claim ID: RT-WIN32-ENV-LOC-PIPE

Adds runtime/shims/win32_env.cpp and runtime/test/win32_env_test.cpp (wired into runtime/CMakeLists.txt and scripts/build_runtime.ps1, rebased onto cont/main 871e4b8b9 at 1a8cc6253):

  • Shims GetUserDefaultGeoName, GetUserDefaultLocaleName, and LocaleNameToLCID (api-ms-win-core-localization-l1-2-{0,3}.dll, kernel32.dll, kernelbase.dll) with offline fallback and LEONIDA_GEO / LEONIDA_LOCALE overrides.
  • Shims SetProcessPriorityBoost (api-ms-win-core-processthreads-l1-1-2.dll, kernel32.dll, kernelbase.dll) in-process so title priority-boost toggles do not mutate the host gta6rt scheduler policy.
  • Shims WaitNamedPipeA/W and SetNamedPipeHandleState (api-ms-win-core-namedpipe-l1-1-0.dll, kernel32.dll, kernelbase.dll), preserving ERROR_BAD_PATHNAME for WaitNamedPipeA/W(nullptr) without faulting on Windows 11.
  • Adds win32_env and win32_env_override CTest cases in runtime/test/win32_env_test.cpp.

Verification

  • Host: Windows 11 (10.0.26100 SDK), MSVC (RelWithDebInfo).
  • ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure: 100% tests passed out of 149 (including win32_env and win32_env_override), 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: Ran 10 tests ... OK.
  • 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/1242 **Author:** [@piyonchu](https://github.com/piyonchu) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `pr/win32-loc-priority-pipe-shims` --- ### 📝 Commits (1) - [`f222051`](https://github.com/ubiquitarianism/leonida/commit/f2220514964c90be636c01197680a9571cb39565) runtime/shims: shim Win32 localization, priority-boost, and named-pipe APIs (RT-WIN32-ENV-LOC-PIPE) ### 📊 Changes **4 files changed** (+441 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+17 -0) ➕ `runtime/shims/win32_env.cpp` (+261 -0) ➕ `runtime/test/win32_env_test.cpp` (+161 -0) 📝 `scripts/build_runtime.ps1` (+2 -2) </details> ### 📄 Description ### Summary Claim ID: `RT-WIN32-ENV-LOC-PIPE` Adds `runtime/shims/win32_env.cpp` and `runtime/test/win32_env_test.cpp` (wired into `runtime/CMakeLists.txt` and `scripts/build_runtime.ps1`, rebased onto `cont/main` `871e4b8b9` at `1a8cc6253`): - Shims `GetUserDefaultGeoName`, `GetUserDefaultLocaleName`, and `LocaleNameToLCID` (`api-ms-win-core-localization-l1-2-{0,3}.dll`, `kernel32.dll`, `kernelbase.dll`) with offline fallback and `LEONIDA_GEO` / `LEONIDA_LOCALE` overrides. - Shims `SetProcessPriorityBoost` (`api-ms-win-core-processthreads-l1-1-2.dll`, `kernel32.dll`, `kernelbase.dll`) in-process so title priority-boost toggles do not mutate the host `gta6rt` scheduler policy. - Shims `WaitNamedPipeA/W` and `SetNamedPipeHandleState` (`api-ms-win-core-namedpipe-l1-1-0.dll`, `kernel32.dll`, `kernelbase.dll`), preserving `ERROR_BAD_PATHNAME` for `WaitNamedPipeA/W(nullptr)` without faulting on Windows 11. - Adds `win32_env` and `win32_env_override` CTest cases in `runtime/test/win32_env_test.cpp`. ### Verification - Host: Windows 11 (`10.0.26100` SDK), MSVC (`RelWithDebInfo`). - `ctest --test-dir runtime/build -C RelWithDebInfo --output-on-failure`: `100% tests passed out of 149` (including `win32_env` and `win32_env_override`), 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`: `Ran 10 tests ... OK`. - `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#1274
No description provided.