You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
file_system: shim GetDriveTypeA/W for GAME:, G:, and T: (RT-FS-DISK-SPACE) - #1234
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.
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.
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.
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
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
Merge & Hygiene: Clean git merge-tree onto main (791899f652) individually and in a 5-PR batch (0 conflicts); python -I scripts/check_no_game_data.pyrc=0; 0 new /W4 warnings.
Red -> Green:
Red (file_system_test.cpp compiled against mainruntime/shims/file_system.cpp): fails with rc=1 (FAIL GetDriveTypeW/A resolve through the shim registry, 545 check(s), 1 failure(s)).
Green (894501117b + main791899f652): file_system_test.exe passes with rc=0 (582 check(s), 0 failure(s)), covering:
GetDriveTypeW / GetDriveTypeA shim resolution across kernel32.dll, kernelbase.dll, and api-ms-win-core-file-l1-*;
GAME:\, G:\, and T:\ root queries (\ and /, upper and lower case) returning the backing NTFS volume's DRIVE_FIXED type;
DRIVE_NO_ROOT_DIR on subpaths (GAME:\sub\, T:\save), drive-relative paths (GAME:, T:sub), unconfigured GAME:\, and T:\ with an empty overlay;
nullptr parity with the host Win32 GetDriveTypeW(nullptr) / GetDriveTypeA(nullptr) and zero directory-creation side effects (overlay and .gta6rt-temp remain uncreated after read-only GetDriveType* probes).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetDiskFreeSpaceA/WandGetDiskFreeSpaceExA/Walready landed onmain(fbafd7cd2,RT-FS-DISK-FREE-SPACE), so after rebasing ontomain(16f505304), this PR is narrowed to the remainingGetDriveTypeA/Wshims.GetDriveTypeAandGetDriveTypeWinruntime/shims/file_system.cpp(RT-FS-DISK-SPACE):GAME:,G:,T:) using non-creatingresolve_console_readonly_dirforT:\soGetDriveTypedoes not create directories on disk, returningDRIVE_FIXED(3).C:\,C:, ornullptr) to the real Win32GetDriveTypeW.GetDriveTypeW/GetDriveTypeAassertions toruntime/test/file_system_test.cpp.Verification
python -I scripts/check_no_game_data.py ...-> PASSpython -I tests/test_fs_disk_free_space.py-> 1/1 OKcmake --build runtime/build --config RelWithDebInfo --target gta6rt file_system_test-> build succeededctest --test-dir runtime/build -C RelWithDebInfo -R "^file_system$" --output-on-failure-> 1/1 passed (17.88 sec)