Repository navigation
VFS: CopyFileW is redirected too - #59
Merged
Merged
Conversation
Only CopyFileExW and CopyFile2 were hooked. CopyFileW, and CopyFileA through it, need not go through CopyFileExW, so a copy between console paths (T:\f.txt → T:\g.txt) went to the PC's own drive and failed. CopyFileW is hooked with the same handling as CopyFileExW; when it calls CopyFileExW, the hook guard lets the inner call through.
ivall
added a commit
that referenced
this pull request
Nov 23, 2026
On Windows 11 kernel32's ANSI moves reach none of kernelbase's W move entries (measured with counting hooks: MoveFileW reaches MoveFileWithProgressW, the ANSI ones neither it nor MoveFileExW), so they are hooked in kernel32: paths become wide and go the MoveFileWithProgressW way. Checked with the real hooks and a VFS mounting T: / G: (T: does not exist on the PC): all six move entries move T:\a.txt to T:\b.txt, a move of a game file through MoveFileExA lands in the overlay and leaves the game folder intact; CopyFileW / A, CopyFileEx W / A, CopyFile2 and ReplaceFile W / A (also onto a game file, backup in the overlay) as in #59 / #60.
Collaborator
|
Merged (8603bcd). For the record, on Windows 11 Tested on Windows 11 (RX 9070): |
ivall
added a commit
that referenced
this pull request
Nov 23, 2026
…ommandListsX, big pipelines in the background The frame clock fired one event type per deadline; a title scheduling the origin and type 2 at the same offset waited on type 2 for ever after two frames. Now every type due fires. Newer console layout: queue #35 is ExecuteCommandListsX, list #61 is ExecuteIndirect (the shift by two from #59 on). Bottom-of-pipe writes into memory the GPU does not see are done by the CPU after the queue's work, waits there read it on the CPU. Compute pipelines of 256 KB of DXIL or more are built in the background (2 at a time), a bind of one not started builds it itself. DXC -O1 from 1 MB of HLSL. `xcl shaders --precompile --pipelines` warms the driver's cache.
Michael-Glaser
added a commit
to Michael-Glaser/xcl
that referenced
this pull request
Nov 24, 2026
…cl-dev#104) On newer GDK runtimes (QUEUE_SHIFTED), 20 command list console methods shift up by +2 via NEWER_LIST_SLOTS, leaving 11 older slots (xcl-dev#59, xcl-dev#60, xcl-dev#68, xcl-dev#69, xcl-dev#78, xcl-dev#81, xcl-dev#84, xcl-dev#88, xcl-dev#89, xcl-dev#93, xcl-dev#94) without another shifted method taking their old index. Those slots remained wired directly to the older layout's handlers, so a newer-layout call hit the wrong method. Wrap those orphaned slots in make_layout_split so newer-layout title calls go to a logged stub while older-layout titles keep the handler and non-title callers keep their PC target (including cl_execute_indirect at xcl-dev#59 and the original base-table stub for slots >= scanned). Slot xcl-dev#10 (Reset) stays Reset on both layouts and is not orphaned. Assisted-by: Antigravity (Gemini 4 Neon)
Michael-Glaser
added a commit
to Michael-Glaser/xcl
that referenced
this pull request
Nov 24, 2026
…vall#104) On newer GDK runtimes (QUEUE_SHIFTED), 20 command list console methods shift up by +2 via NEWER_LIST_SLOTS, leaving 11 older slots (ivall#59, ivall#60, ivall#68, ivall#69, ivall#78, ivall#81, ivall#84, ivall#88, ivall#89, ivall#93, ivall#94) without another shifted method taking their old index. Those slots remained wired directly to the older layout's handlers, so a newer-layout call hit the wrong method. Wrap those orphaned slots in make_layout_split so newer-layout title calls go to a logged stub while older-layout titles keep the handler and non-title callers keep their PC target (including cl_execute_indirect at ivall#59 and the original base-table stub for slots >= scanned). Slot ivall#10 (Reset) stays Reset on both layouts and is not orphaned. Assisted-by: Antigravity (Gemini 4 Neon)
kacper-serewis
pushed a commit
to kacper-serewis/xcl
that referenced
this pull request
Nov 24, 2026
On Windows, kernel32!FindFirstFileExA jumps to kernelbase!FindFirstFileExA, which reaches neither FindFirstFileExW nor FindFirstFileA (measured on Windows 11 26300 by patching each of them with a failing stub: ExA still listed C:\Windows; patching kernelbase!FindFirstFileExA itself did stop it). Only Wine's implementation goes through the W function, which is where xcl-dev#59 measured it. So FindFirstFileExA("G:\data\*") failed with ERROR_PATH_NOT_FOUND, or listed a PC drive or the unmerged game folder, instead of the merged VFS listing. Hook kernelbase!FindFirstFileExA like FindFirstFileA: the info levels and search ops hk_find_first_ex_w virtualises go through find_first_vfs and are converted with w_to_a; the others pass through. FindNextFileA and FindClose already handle the merged handle. The new integration test lists a game folder with an overlay file and a whiteout through FindFirstFileExA/FindNextFileA; without the hook it fails with error 3. Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit 3755c18)
CalvyPZ
pushed a commit
to CalvyPZ/xcl
that referenced
this pull request
Nov 24, 2026
On Windows, kernel32!FindFirstFileExA jumps to kernelbase!FindFirstFileExA, which reaches neither FindFirstFileExW nor FindFirstFileA (measured on Windows 11 26300 by patching each of them with a failing stub: ExA still listed C:\Windows; patching kernelbase!FindFirstFileExA itself did stop it). Only Wine's implementation goes through the W function, which is where xcl-dev#59 measured it. So FindFirstFileExA("G:\data\*") failed with ERROR_PATH_NOT_FOUND, or listed a PC drive or the unmerged game folder, instead of the merged VFS listing. Hook kernelbase!FindFirstFileExA like FindFirstFileA: the info levels and search ops hk_find_first_ex_w virtualises go through find_first_vfs and are converted with w_to_a; the others pass through. FindNextFileA and FindClose already handle the merged handle. The new integration test lists a game folder with an overlay file and a whiteout through FindFirstFileExA/FindNextFileA; without the hook it fails with error 3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
vfs_hooks.rshooksCopyFileExWandCopyFile2, but notCopyFileW, which doesn't have to go throughCopyFileExW(under Wine it doesn't).CopyFileAcallsCopyFileW, so a copy between console paths with either one (T:\f.txt→T:\g.txt) went to the PC's own drive and failed.CopyFileWis now hooked with the same handling asCopyFileExW(source throughsource_of, destination throughdest_of). Where Windows'CopyFileWdoes callCopyFileExW, the existing hook guard lets the inner call through.Same kind of gap as #58 (
MoveFileWithProgressW); the two don't conflict.Validation
The hooks are process-wide and need an initialized VFS (a global
OnceLock), so this isn't a unit test. I ran a probe test alone: a VFS that mountsT:on a temp folder, the real hooks installed, then each file API onT:paths. Under Wine:mainCopyFileW(T:\f.txt, T:\g.txt)CopyFileA(T:\f.txt, T:\g.txt)CopyFileExA(...)The same probe shows
DeleteFileA,CreateDirectoryA,RemoveDirectoryA,SetFileAttributesA,FindFirstFileExAandGetFileAttributesExAalready work through their W hooks. I haven't run it on Windows itself yet.cargo test -p xcl --lib: 343 passed, 0 failed, on Windows GNU under Wine.