Repository navigation
gta6rt: GAME: paths for folders, moves, copies and attributes (RT-97 follow-up) - #1742
Conversation
|
Tested fa2c72a on Windows 11 x64 (MSVC 19.44, Ninja, no GPU needed): pass. Built the runtime from this tree and ran |
edupode
left a comment
There was a problem hiding this comment.
[P2] MOVEFILE_WRITE_THROUGH is dropped on the package-to-overlay path. In runtime/shims/file_system.cpp:765–771, keep preserves the flag for the MoveFileExW branch, but when the source exists only in the package the shim calls CopyFileW and then writes the deletion marker. That branch returns success without ensuring the copied file (and the logical move) has reached disk. A caller that requested write-through can therefore lose the overlay copy after an abrupt system failure despite receiving success. Please honor the flag on this branch as well. Microsoft documents that MOVEFILE_WRITE_THROUGH waits for the copy/delete operation to be flushed before return: MoveFileExW documentation.
Review by @edupode, with assistance from ChatGPT 6.2 Astra (Ultra Thinking).
|
Tested fa2c72a on Windows 11 (26200), MSVC 19.4x (VS 2022 Build Tools), Ninja RelWithDebInfo: pass on both GPUs of a two-GPU PC.
No game files. AI-assisted check (Claude Code), Vonsek3. |
|
Tested
No regression against AI-assisted (Claude Code). |
|
Tested
|
…follow-up) The calls docs/runtime_imports.md listed as not mapped now follow the RT-97 rules, under kernel32, kernelbase and the api-ms-win-core-file-* sets: - CreateDirectory/CreateDirectoryEx make the folder in the overlay; a name the title can already see, package-only folders included, is ERROR_ALREADY_EXISTS. - RemoveDirectory needs the folder empty in the title's view. An overlay folder is removed; a package folder is hidden by a .gta6rt-dir marker file inside its marker folder and stays on disk (deleted() now also checks that file, on top of the regular-file rule from 3f26a95). - MoveFile/MoveFileEx write the destination in the overlay; a moved package file is copied there and its old name deleted by a marker. MOVEFILE_WRITE_THROUGH flushes that copy and the marker before returning (review on #1742). Package folders are not moved (ERROR_ACCESS_DENIED), GAME: <-> host is ERROR_NOT_SAME_DEVICE and MOVEFILE_DELAY_UNTIL_REBOOT is ERROR_INVALID_PARAMETER. - CopyFile/CopyFileEx/CopyFile2 read like a read and write a GAME: destination in the overlay; fail-if-exists counts names only the package has. - SetFileAttributes sets the overlay copy (copy-up or folder mirror first). file_system: 123/123 checks. No game files. AI-assisted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks @edupode, good catch. Fixed in c9fbc9d: when the source is only in the package, Also rebased on Thanks @dcastell1, @Vonsek, @Spaghetih and @timelery for testing. Re-tested on the rebased branch, RTX 5070 Ti (NVIDIA 621.01), Windows 11 24H2, MSVC 14.44, Ninja RelWithDebInfo: |
fa2c72a to
c9fbc9d
Compare
|
Tested c9fbc9d on RTX 4070 SUPER, driver 610.47, Windows 11 (MSVC 17.14, Vulkan SDK 1.4.363): full Note: #1730 changes the same |
|
Tested fa2c72a on Intel(R) UHD Graphics (Tiger Lake (Xe-LP) iGPU 0x9a78, subgroup 8..32, no mesh), driver 32.0.101.7088, Windows 11, MSVC 14.44: pass
AI-assisted (GLM, operated by the account owner). |
Follow-up to RT-97 (#1551), claimed in #1548 (claim).
The calls
docs/runtime_imports.mdlisted as not mapped yet now follow the RT-97 rules, underkernel32.dll,kernelbase.dlland theapi-ms-win-core-file-*sets:GAME:pathCreateDirectory*,CreateDirectoryEx*ERROR_ALREADY_EXISTS, a missing parentERROR_PATH_NOT_FOUNDRemoveDirectory*ERROR_DIR_NOT_EMPTY); an overlay folder is removed, a package folder is hidden by a.gta6rt-dirmarker and stays on diskMoveFile*,MoveFileEx*MOVEFILE_REPLACE_EXISTINGeven when only the package has the name. Package folders are not moved (ERROR_ACCESS_DENIED, asDeleteFiledoes),GAME:↔ host isERROR_NOT_SAME_DEVICE,MOVEFILE_DELAY_UNTIL_REBOOTisERROR_INVALID_PARAMETERCopyFile*,CopyFileEx*,CopyFile2GAME:destination written in the overlay; fail-if-exists counts names only the package has; either side may be a host pathSetFileAttributes*Fix in RT-97's
deleted(): it treated a marker folder — left under.gta6rt-deletedwhen a file below it is deleted — as a marker for the folder itself. Deleting one package file in a folder the overlay had never written to therefore hid the whole folder (GetFileAttributes→ERROR_FILE_NOT_FOUND, gone from its parent's listing). The existing test didn't see it because its overlay already haddata\. Markers are now regular files only; a removed folder uses a.gta6rt-dirfile inside its marker folder. A regression check is added (it failed 2/51 before the fix).Tested on
89b047cd+ this branch, Windows 11 24H2, RTX 5070 Ti (NVIDIA 621.01), MSVC 14.44, Ninja RelWithDebInfo:file_system: 117/117 checks (46 before; the new ones cover every call above, both A and W, the registry names, refusals aboveGAME:and the package left untouched).ctest: 100/101 passed, 3 skipped (no game copy set for the two Bink tests; no RGB9E5 render targets),gameinputdisabled (no SDL3).d3d12_drawfails (bundle blend pixel (0, 0): got 255,0,0,255, expected red 64); this PR doesn't touch its sources and it doesn't linkfile_system.cpp— reported separately.No game files used or added. AI-assisted (Claude Code); reviewed and run locally.