Skip to content

file_system: shim GetDriveTypeA/W for GAME:, G:, and T: (RT-FS-DISK-SPACE) - #1234

Open
piyonchu wants to merge 1 commit into
ProjectLeonida:mainfrom
piyonchu:pr/file-system-disk-space
Open

piyonchu wants to merge 1 commit into
ProjectLeonida:mainfrom
piyonchu:pr/file-system-disk-space

Conversation

@piyonchu

@piyonchu piyonchu commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Scope note: GetDiskFreeSpaceA/W and GetDiskFreeSpaceExA/W already landed on main (fbafd7cd2, RT-FS-DISK-FREE-SPACE), so after rebasing onto main (16f505304), this PR is narrowed to the remaining GetDriveTypeA/W shims.
  • Implement GetDriveTypeA and GetDriveTypeW in runtime/shims/file_system.cpp (RT-FS-DISK-SPACE):
    • Recognize virtual Xbox/PS5 drive paths (GAME:, G:, T:) using non-creating resolve_console_readonly_dir for T:\ so GetDriveType does not create directories on disk, returning DRIVE_FIXED (3).
    • Forward host/system drive paths (such as C:\, C:, or nullptr) to the real Win32 GetDriveTypeW.
    • Add GetDriveTypeW / GetDriveTypeA assertions to runtime/test/file_system_test.cpp.

Verification

  • python -I scripts/check_no_game_data.py ... -> PASS
  • python -I tests/test_fs_disk_free_space.py -> 1/1 OK
  • cmake --build runtime/build --config RelWithDebInfo --target gta6rt file_system_test -> build succeeded
  • ctest --test-dir runtime/build -C RelWithDebInfo -R "^file_system$" --output-on-failure -> 1/1 passed (17.88 sec)

@piyonchu

Copy link
Copy Markdown
Contributor Author

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
piyonchu force-pushed the pr/file-system-disk-space branch from d54c351 to 83ef3ee Compare November 26, 2026 02:53
@github-actions github-actions Bot added the needs rebase Conflicts with the base branch: rebase it on main label Nov 28, 2026
@MoonEyes

Copy link
Copy Markdown
Collaborator

Hi @piyonchu, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/file_system.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

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

@OreoFR

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Verified by OreoFR

  • Base: main c1ecf04ed + PR head 83ef3eea9
  • Test: not run (merge conflict with main)
  • Red on main: not run
  • Green with the PR: not run
  • Verdict: CONFLICT (runtime/shims/file_system.cpp conflicts with main)
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

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

@piyonchu
piyonchu force-pushed the pr/file-system-disk-space branch from 83ef3ee to 8945011 Compare November 29, 2026 01:30
@piyonchu piyonchu changed the title file_system: shim GetDiskFreeSpaceExA/W, GetDiskFreeSpaceA/W, and GetDriveTypeA/W (RT-FS-DISK-SPACE) file_system: shim GetDriveTypeA/W for GAME:, G:, and T: (RT-FS-DISK-SPACE) Nov 29, 2026
@piyonchu

Copy link
Copy Markdown
Contributor Author

Rebased onto main (16f505304) at 894501117:

  • GetDiskFreeSpaceA/W and GetDiskFreeSpaceExA/W already landed on main (fbafd7cd2, RT-FS-DISK-FREE-SPACE), so I removed the duplicate definitions/exports from this branch and narrowed #1234 cleanly to GetDriveTypeA/W (using non-creating resolve_console_readonly_dir for T:\) plus GetDriveTypeW/A test assertions in runtime/test/file_system_test.cpp.
  • Updated the PR title and description to match the narrowed scope.
  • Verified:
    • git diff --check cont/main..HEAD: clean
    • python -I scripts/check_no_game_data.py ...: PASS
    • python -I tests/test_fs_disk_free_space.py: 1/1 OK
    • cmake --build runtime/build --config RelWithDebInfo --target gta6rt file_system_test: build succeeded
    • ctest --test-dir runtime/build -C RelWithDebInfo -R "^file_system$" --output-on-failure: 1/1 passed (17.88 sec)

@github-actions github-actions Bot removed the needs rebase Conflicts with the base branch: rebase it on main label Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants