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

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

@⁠piyonchu on GitHub · 2026-11-24 20:43 UTC · original
piyonchu:pr/win32-loc-priority-pipe-shims → main · +441 −2 · 4 files · 1 commits · open

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.
**@⁠piyonchu** on GitHub · 2026-11-24 20:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1242) `piyonchu:pr/win32-loc-priority-pipe-shims` → `main` · +441 −2 · 4 files · 1 commits · open ### 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:14 +00:00
github-bot force-pushed github-bot/gh-1242 from bd263cad63 to f222051496 2026-11-27 00:35:53 +00:00 Compare
Author
Owner

@⁠piyonchu on GitHub · 2026-11-26 21:36 UTC · original

Rebased onto latest main (fac8b4bb9, head commit f22205149), resolving the scripts/build_runtime.ps1 fallback file list conflict cleanly (shims\xapu_queue.cpp + shims\win32_env.cpp).

Verified locally after rebase:

  • git diff --check cont/main..HEAD
  • python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/win32_env.cpp runtime/test/win32_env_test.cpp scripts/build_runtime.ps1
  • cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env$" --output-on-failure (1/1 passed)
**@⁠piyonchu** on GitHub · 2026-11-26 21:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1242#issuecomment-7203887560) Rebased onto latest `main` (`fac8b4bb9`, head commit `f22205149`), resolving the `scripts/build_runtime.ps1` fallback file list conflict cleanly (`shims\xapu_queue.cpp` + `shims\win32_env.cpp`). Verified locally after rebase: - `git diff --check cont/main..HEAD` - `python -I scripts/check_no_game_data.py runtime/CMakeLists.txt runtime/shims/win32_env.cpp runtime/test/win32_env_test.cpp scripts/build_runtime.ps1` - `cmake --build runtime/build --config RelWithDebInfo --target gta6rt win32_env_test` - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^win32_env$" --output-on-failure` (1/1 passed)
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/1242/head:github-bot/gh-1242'
git switch 'github-bot/gh-1242'

Merge

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