VFS: CopyFileW is redirected too #59
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!59
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/59/head"
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?
@gefydev on GitHub · 2026-11-22 23:05 UTC · original
gefydev:vfs-copy-file→main· +20 −0 · 1 files · 1 commits · merged 2026-11-23 09:44 UTCvfs_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.github-bot referenced this pull request2026-11-26 04:19:41 +00:00
@ivall on GitHub · 2026-11-23 09:45 UTC · original
Merged (
8603bcd). For the record, on Windows 11CopyFileWcallsCopyFileExW(both hooks fire, the guard handles it) andCopyFileA/CopyFileExAreachCopyFileExW, so there this was already covered; the extra hook is harmless and helps under Wine. All five copy entries verified onT:with the real hooks.Tested on Windows 11 (RX 9070):
cargo test --workspacegreen (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!