file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to overlay scratch (OLD-10017) #766

Open
github-bot wants to merge 5 commits from github-bot/gh-766 into main AGit
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 13:35 UTC · original
abnalstlll-byte:restore/old-10017-fs-temppath → main · +246 −0 · 2 files · 5 commits · open

Restore old upstream PR 10017 (OLD-10017).

Implements \GetTempPathW, \GetTempPathA, \GetTempFileNameW, and \GetTempFileNameA\ shims routing console temporary directories (\GAME:, \G:, \T:) to the writable overlay's scratch directory (.gta6rt-temp).

  • Preserves subdirectory components within temporary paths
  • Preserves Unicode temporary paths and rejects unrepresentable ANSI conversions with \ERROR_NO_UNICODE_TRANSLATION\
  • Handles exact buffer capacity on \GetTempPathA\ when capacity matches path length without null terminator
  • Registers exports across kernel32, kernelbase, and api-ms-win-core-file-* sets

Clean-room verified; zero game data.

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 13:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/766) `abnalstlll-byte:restore/old-10017-fs-temppath` → `main` · +246 −0 · 2 files · 5 commits · open Restore old upstream PR 10017 (OLD-10017). Implements \GetTempPathW\, \GetTempPathA\, \GetTempFileNameW\, and \GetTempFileNameA\ shims routing console temporary directories (\GAME:\, \G:\, \T:\) to the writable overlay's scratch directory (\.gta6rt-temp\). - Preserves subdirectory components within temporary paths - Preserves Unicode temporary paths and rejects unrepresentable ANSI conversions with \ERROR_NO_UNICODE_TRANSLATION\ - Handles exact buffer capacity on \GetTempPathA\ when capacity matches path length without null terminator - Registers exports across kernel32, kernelbase, and api-ms-win-core-file-* sets Clean-room verified; zero game data.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:20:18 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 01:49 UTC · original

Reviewed 540c8444. I read the 5-commit series (temp-path and temp-file shims, plus tests) and ran scripts/check_no_game_data.py on both changed files (clean). file_system_test is a Windows-only target, so it could not run here. On this head's windows CI job it passes (file_system ... Passed, 294/294). The red check job fails in Python test files this PR does not touch. The new test starts with resolve("kernel32.dll", "GetTempPathW"), which is null on main.

Read statically, these all look correct:

  • the TMP/TEMP decision table;
  • subpath preservation and scratch-only file creation;
  • lossy-ANSI rejection, with the just-created file removed;
  • the error paths (ERROR_INVALID_NAME, ERROR_PATH_NOT_FOUND).

Merges: clean against current origin/main. It conflicts with sibling PR #747 in file_system.cpp (same anchor, same FILE_API list), so whichever merges second needs a short rebase.

A question for the author's rig, not a blocker: at exact capacity, the tip commit returns required from W but the bare length from A. Please re-confirm that matrix. The test only checks the return value and that the byte past the buffer is untouched, so it cannot tell whether real Win32 also copies the path bytes in that branch. No findings. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/766#issuecomment-7150005358) Reviewed 540c8444. I read the 5-commit series (temp-path and temp-file shims, plus tests) and ran `scripts/check_no_game_data.py` on both changed files (clean). `file_system_test` is a Windows-only target, so it could not run here. On this head's `windows` CI job it passes (`file_system ... Passed`, 294/294). The red `check` job fails in Python test files this PR does not touch. The new test starts with `resolve("kernel32.dll", "GetTempPathW")`, which is null on main. Read statically, these all look correct: - the TMP/TEMP decision table; - subpath preservation and scratch-only file creation; - lossy-ANSI rejection, with the just-created file removed; - the error paths (`ERROR_INVALID_NAME`, `ERROR_PATH_NOT_FOUND`). Merges: clean against current `origin/main`. It conflicts with sibling PR #747 in `file_system.cpp` (same anchor, same `FILE_API` list), so whichever merges second needs a short rebase. A question for the author's rig, not a blocker: at exact capacity, the tip commit returns `required` from W but the bare length from A. Please re-confirm that matrix. The test only checks the return value and that the byte past the buffer is untouched, so it cannot tell whether real Win32 also copies the path bytes in that branch. No findings. AI-assisted review. **Recommendation:** Merge
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-25 21:49 UTC · original

Rebased onto latest \main.
Verified \scripts/check_no_game_data.py\ (clean) on
untime/shims/file_system.cpp\ and
untime/test/file_system_test.cpp, and \git diff --check.

AI-assisted (Claude Code, Claude Opus 5.5).

**@⁠abnalstlll-byte** on GitHub · 2026-11-25 21:49 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/766#issuecomment-7175587850) Rebased onto latest \main\. Verified \scripts/check_no_game_data.py\ (clean) on \ untime/shims/file_system.cpp\ and \ untime/test/file_system_test.cpp\, and \git diff --check\. AI-assisted (Claude Code, Claude Opus 5.5).
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/766/head:github-bot/gh-766'
git switch 'github-bot/gh-766'

Merge

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