file_system: shim GetDiskFreeSpaceExA/W, GetDiskFreeSpaceA/W, and GetDriveTypeA/W (RT-FS-DISK-SPACE) #1234

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

@⁠piyonchu on GitHub · 2026-11-24 20:40 UTC · original
piyonchu:pr/file-system-disk-space → main · +370 −10 · 2 files · 1 commits · open

Summary

Claim ID: RT-FS-DISK-SPACE

Shims GetDiskFreeSpaceExA/W, GetDiskFreeSpaceA/W, and GetDriveTypeA/W in runtime/shims/file_system.cpp (registered across kernel32.dll, kernelbase.dll, and api-ms-win-core-file-l1-{1,2}-0.dll / l2-1-0.dll) for console paths (GAME:, G:, and T:):

  • Resolves read-only console queries through resolve_console_readonly_dir + parse_console_parts(..., create_scratch=false) using win32_io_path, so querying T:\ or missing console directories does not create .gta6rt-temp or overlay on disk.
  • Preserves overlay-over-package precedence and deletion markers (ERROR_PATH_NOT_FOUND for GetDiskFreeSpaceEx* / DRIVE_NO_ROOT_DIR for GetDriveType*, ERROR_FILE_NOT_FOUND for GetDiskFreeSpace*, ERROR_DIRECTORY for files, ERROR_INVALID_NAME for escaped/reserved paths).
  • GetDriveTypeA/W checks is_root and delegates volume type lookup via GetVolumePathNameW.
  • Adds host-comparison and edge-case tests in runtime/test/file_system_test.cpp.

Verification

  • Host: Windows 11 (10.0.26200), MSVC 19.44.35228.0 (RelWithDebInfo), CMake configure & build for file_system_test and gta6rt.
  • ctest --test-dir runtime/build -C RelWithDebInfo -R file_system --output-on-failure: 1/1 Test #56: file_system ... Passed (1.10 sec).
  • git diff --check: clean.
  • No game files used; CPU/filesystem shim test only (no GPU required). AI-assisted.
**@⁠piyonchu** on GitHub · 2026-11-24 20:40 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1234) `piyonchu:pr/file-system-disk-space` → `main` · +370 −10 · 2 files · 1 commits · open ### Summary Claim ID: `RT-FS-DISK-SPACE` Shims `GetDiskFreeSpaceExA/W`, `GetDiskFreeSpaceA/W`, and `GetDriveTypeA/W` in `runtime/shims/file_system.cpp` (registered across `kernel32.dll`, `kernelbase.dll`, and `api-ms-win-core-file-l1-{1,2}-0.dll` / `l2-1-0.dll`) for console paths (`GAME:`, `G:`, and `T:`): - Resolves read-only console queries through `resolve_console_readonly_dir` + `parse_console_parts(..., create_scratch=false)` using `win32_io_path`, so querying `T:\` or missing console directories does not create `.gta6rt-temp` or `overlay` on disk. - Preserves overlay-over-package precedence and deletion markers (`ERROR_PATH_NOT_FOUND` for `GetDiskFreeSpaceEx*` / `DRIVE_NO_ROOT_DIR` for `GetDriveType*`, `ERROR_FILE_NOT_FOUND` for `GetDiskFreeSpace*`, `ERROR_DIRECTORY` for files, `ERROR_INVALID_NAME` for escaped/reserved paths). - `GetDriveTypeA/W` checks `is_root` and delegates volume type lookup via `GetVolumePathNameW`. - Adds host-comparison and edge-case tests in `runtime/test/file_system_test.cpp`. ### Verification - Host: Windows 11 (`10.0.26200`), MSVC `19.44.35228.0` (`RelWithDebInfo`), CMake configure & build for `file_system_test` and `gta6rt`. - `ctest --test-dir runtime/build -C RelWithDebInfo -R file_system --output-on-failure`: `1/1 Test #56: file_system ... Passed (1.10 sec)`. - `git diff --check`: clean. - No game files used; CPU/filesystem shim test only (no GPU required). AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:43:55 +00:00
Author
Owner

@⁠piyonchu on GitHub · 2026-11-26 02:53 UTC · original

Rebased onto latest main (86dc3d86e, head commit 83ef3eea9) and updated parse_console_parts / resolve_console_readonly_dir so create_scratch = false inspects g_scratch_folders via existing_scratch_folder without creating <overlay>\.gta6rt-temp\<run> on disk while keeping T:\.. clamped and mapping T:\ root queries (parts.size() == 2) cleanly.

Verified locally after rebase:

  • git diff --check cont/main..HEAD
  • python -I scripts/check_no_game_data.py runtime/shims/file_system.cpp runtime/test/file_system_test.cpp
  • cmake -S runtime -B runtime/build -DLEONIDA_VULKAN_HEADERS_FETCH=ON
  • cmake --build runtime/build --config RelWithDebInfo --target gta6rt file_system_test
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^file_system$" --output-on-failure (1/1 passed)
**@⁠piyonchu** on GitHub · 2026-11-26 02:53 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1234#issuecomment-7181214443) Rebased onto latest `main` (`86dc3d86e`, head commit `83ef3eea9`) and updated `parse_console_parts` / `resolve_console_readonly_dir` so `create_scratch = false` inspects `g_scratch_folders` via `existing_scratch_folder` without creating `<overlay>\.gta6rt-temp\<run>` on disk while keeping `T:\..` clamped and mapping `T:\` root queries (`parts.size() == 2`) cleanly. Verified locally after rebase: - `git diff --check cont/main..HEAD` - `python -I scripts/check_no_game_data.py runtime/shims/file_system.cpp runtime/test/file_system_test.cpp` - `cmake -S runtime -B runtime/build -DLEONIDA_VULKAN_HEADERS_FETCH=ON` - `cmake --build runtime/build --config RelWithDebInfo --target gta6rt file_system_test` - `ctest --test-dir runtime/build -C RelWithDebInfo -R "^file_system$" --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/1234/head:github-bot/gh-1234'
git switch 'github-bot/gh-1234'

Merge

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