[PR #1314] [CLOSED] file_system: GetTempPath and GetTempFileName resolve GAME:, G: and T: to the overlay scratch folder (OLD-10017) #1344

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1314
Author: @ambroseautomation
Created: 11/24/2026
Status: ❌ Closed

Base: main ← Head: carry/old-10017-fs-temp-paths


📝 Commits (5)

  • 6976ec8 file_system: route console temporary paths to the overlay
  • 1ada9fe file_system: preserve temporary directory components
  • 46df3eb file_system: preserve Unicode temporary paths
  • 336dda7 file_system: reject lossy temporary paths
  • 574f8c7 Fix GetTempPathA exact capacity return

📊 Changes

2 files changed (+246 additions, -0 deletions)

View changed files

📝 runtime/shims/file_system.cpp (+122 -0)
📝 runtime/test/file_system_test.cpp (+124 -0)

📄 Description

Summary

Coordination item: OLD-10017 (carry-forward of old-pr/10017, preserving original author tedin7 across all 5 commits).

Problem & Root Cause

Console titles query temporary directories and create temporary files via GetTempPathW/A and GetTempFileNameW/A using GAME:, G:, and T: virtual drives. Previously these APIs were not shimmed in runtime/shims/file_system.cpp, so temporary paths were not routed to the overlay scratch directory.

Implementation

  • Adds GetTempPathW/A and GetTempFileNameW/A shims in runtime/shims/file_system.cpp, routing console temporary paths (GAME:, G:, T:) to the overlay scratch folder.
  • Preserves temporary directory components and Unicode temporary paths, rejects lossy ANSI conversions, and fixes GetTempPathA exact-capacity return value semantics.
  • Adds comprehensive unit tests in runtime/test/file_system_test.cpp.

Tests Run

Environment: Windows 11 Pro 64-bit, Visual Studio 18 Community (cl.exe x64, /std:c++20 /W4 /permissive- /utf-8).

  • file_system_test.exe (compiled with runtime/test/file_system_test.cpp, runtime/shims/file_system.cpp, runtime/shims/registry.cpp, advapi32.lib, /OPT:NOREF) — 533 check(s), 0 failure(s) (PASS)
  • .\scripts\build_runtime.ps1 -jobs 8 — PASS (runtime/build/gta6rt.exe built cleanly)
  • python -I scripts/check_no_game_data.py runtime/shims/file_system.cpp runtime/test/file_system_test.cpp — PASS

Disclosure

AI-assisted: yes (carry-forward, rebase onto current main, and local MSVC build/test verification; original implementation by tedin7).


🔄 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/1314 **Author:** [@ambroseautomation](https://github.com/ambroseautomation) **Created:** 11/24/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `carry/old-10017-fs-temp-paths` --- ### 📝 Commits (5) - [`6976ec8`](https://github.com/ubiquitarianism/leonida/commit/6976ec8ac6031297c82a61ec55aba9294d9ccc78) file_system: route console temporary paths to the overlay - [`1ada9fe`](https://github.com/ubiquitarianism/leonida/commit/1ada9fe0d6b83e3b93b1f9bf979cd3a3424b3d3a) file_system: preserve temporary directory components - [`46df3eb`](https://github.com/ubiquitarianism/leonida/commit/46df3eb56604e69766e0eb4338ecf105e6fe7b9e) file_system: preserve Unicode temporary paths - [`336dda7`](https://github.com/ubiquitarianism/leonida/commit/336dda7aa1dc5371d2fea0aded7b1e82ad85e617) file_system: reject lossy temporary paths - [`574f8c7`](https://github.com/ubiquitarianism/leonida/commit/574f8c7e5b8aba22cf068d7d83bbfb45270bc9fc) Fix GetTempPathA exact capacity return ### 📊 Changes **2 files changed** (+246 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/file_system.cpp` (+122 -0) 📝 `runtime/test/file_system_test.cpp` (+124 -0) </details> ### 📄 Description ## Summary Coordination item: `OLD-10017` (carry-forward of `old-pr/10017`, preserving original author `tedin7` across all 5 commits). ### Problem & Root Cause Console titles query temporary directories and create temporary files via `GetTempPathW/A` and `GetTempFileNameW/A` using `GAME:`, `G:`, and `T:` virtual drives. Previously these APIs were not shimmed in `runtime/shims/file_system.cpp`, so temporary paths were not routed to the overlay scratch directory. ### Implementation - Adds `GetTempPathW/A` and `GetTempFileNameW/A` shims in `runtime/shims/file_system.cpp`, routing console temporary paths (`GAME:`, `G:`, `T:`) to the overlay scratch folder. - Preserves temporary directory components and Unicode temporary paths, rejects lossy ANSI conversions, and fixes `GetTempPathA` exact-capacity return value semantics. - Adds comprehensive unit tests in `runtime/test/file_system_test.cpp`. ## Tests Run Environment: Windows 11 Pro 64-bit, Visual Studio 18 Community (`cl.exe` x64, `/std:c++20 /W4 /permissive- /utf-8`). - `file_system_test.exe` (compiled with `runtime/test/file_system_test.cpp`, `runtime/shims/file_system.cpp`, `runtime/shims/registry.cpp`, `advapi32.lib`, `/OPT:NOREF`) — **533 check(s), 0 failure(s)** (PASS) - `.\scripts\build_runtime.ps1 -jobs 8` — PASS (`runtime/build/gta6rt.exe` built cleanly) - `python -I scripts/check_no_game_data.py runtime/shims/file_system.cpp runtime/test/file_system_test.cpp` — PASS ## Disclosure AI-assisted: yes (carry-forward, rebase onto current `main`, and local MSVC build/test verification; original implementation by tedin7). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
4ld0 2026-11-26 20:20:55 +01:00
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#1344
No description provided.