mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:30:52 +01:00
[PR #1464] file_system: shim CRT _stat* and remove/_unlink for console paths (RT-FS-CRT-STAT-REMOVE) #1494
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1494
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1464
Author: @piyonchu
Created: 11/25/2026
Status: 🔄 Open
Base:
main← Head:pr/fs-crt-stat-remove📝 Commits (1)
fc6fb0bfile_system: shim CRT _stat* and remove/_unlink for console paths (RT-FS-CRT-STAT-REMOVE)📊 Changes
2 files changed (+235 additions, -0 deletions)
View changed files
📝
runtime/shims/file_system.cpp(+144 -0)📝
runtime/test/file_system_test.cpp(+91 -0)📄 Description
Claimed in the coordination issue as: RT-FS-CRT-STAT-REMOVE
Summary
game_scarlett_master.exeshow direct imports and call sites forapi-ms-win-crt-filesystem-l1-1-0.dll!_wstat64andapi-ms-win-crt-filesystem-l1-1-0.dll!remove. Because the host UCRT calls Win32 file APIs through its own import table rather than the guest's IAT, console paths (GAME:,G:,T:), overlay copies, and deletion markers were bypassed by CRT stat/remove calls.runtime/shims/file_system.cppforremove,_wremove,_unlink,_wunlink,_wstat64,_stat64,_wstat64i32,_stat64i32,_wstat32,_stat32,_wstat32i64, and_stat32i64registered underapi-ms-win-crt-filesystem-l1-1-0.dllanducrtbase.dll.view()/missing_error()and delegate disk resolution to host UCRT_wstat*(preserving long\\?\paths and UCRT mode/size/time fields); CRT deletes delegate console paths todelete_file_w()and map Win32 failures (ERROR_FILE_NOT_FOUND/ERROR_PATH_NOT_FOUND/ERROR_INVALID_NAME->ENOENT,ERROR_ACCESS_DENIED->EACCES, etc.) toerrnoand_doserrno.runtime/test/file_system_test.cppwithcheck_crt_stat_removecoveringGAME:,G:,T:, overlay shadowing, delete-marker preservation of package files,EACCESon read-only package files and directories,ENOENTon escaped..paths, and host passthrough.Verification
RelWithDebInfo, Windows 11, CPU-only build without Vulkan headers) and ranctest -C RelWithDebInfo -R "^(file_system|xgameruntime)$" --output-on-failure: 2/2 passed (file_system,xgameruntime).gta6rt.exe --dry-runagainst a localgame_scarlett_master.execonfirms bothapi-ms-win-crt-filesystem-l1-1-0.dll!_wstat64andapi-ms-win-crt-filesystem-l1-1-0.dll!removenow bind toshim.python -I tests/test_build_runtime_fallback.pyandpython -I tests/test_text_write_line_endings.py(run below before commit).git diff --check: clean.AI-assisted; synthetic tests +
--dry-runimport check on Windows 11 (CPU-only build; no game files included).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.