diff options
| author | Claude <noreply@anthropic.com> | 2026-11-22 21:54:00 +0000 |
|---|---|---|
| committer | Claude <noreply@anthropic.com> | 2026-11-22 21:54:00 +0000 |
| commit | c0b821cda743abee02c6d504056ea68c3a6751b2 (patch) | |
| tree | 817891d08139063ae6d2d365b38cd5b37bd8556a /runtime/src/pe_loader.cpp | |
| parent | 49ea89f201e457ad010c84d1af6baa928a8a1a67 (diff) | |
file_system: CopyFile2 checks its parameter block before the destination
Review on #3655 (kacper-serewis, daemosofchaos, on Windows 11):
- A parameter block shorter than COPYFILE2_EXTENDED_PARAMETERS (dwSize
0, 4, 31) made the fallback copy and return S_OK, where the host's
CopyFile2 returns E_INVALIDARG and writes nothing. Both paths now
check it first, before copy_paths prepares the destination.
- The fallback silently dropped COPY_FILE_SKIP_ALTERNATE_STREAMS and
copied the stream. Its flags are now sorted: passed on (the ones both
calls define), dropped (requests that leave the contents as
CopyFileExW writes them: no offload, compressed traffic, sparse copy,
...), or refused with ERROR_NOT_SUPPORTED before anything is written
(SKIP_ALTERNATE_STREAMS, DIRECTORY, OPEN_AND_COPY_REPARSE_POINT,
IGNORE_SOURCE_ENCRYPTION, unknown bits, a longer V2 block).
- A cancel flag already set is answered by the fallback itself, since
Wine 9's CopyFileExW doesn't read it.
rt::fs::force_copy_file2_fallback lets the test run the fallback on
Windows, where the host has CopyFile2 (Maraco91 noted it couldn't be
reached there). file_system_test runs its CopyFile2 checks both ways:
no block, short blocks, fail-if-exists with a hint flag, a set cancel
flag, and in the fallback the refused flags and block.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GN11jcpJWD4phrXJyDgED6
Diffstat (limited to 'runtime/src/pe_loader.cpp')
0 files changed, 0 insertions, 0 deletions