mirror of
https://github.com/reactos/reactos.git
synced 2026-07-02 06:44:37 +08:00
The function didn't check if `COPY_FILE_FAIL_IF_EXISTS` bit flag is set or not, always failing if _any_ flags were set and the destination file already existed. This behavior was probably implemented under assumption that `COPY_FILE_FAIL_IF_EXISTS` is the only valid flag, but it's not the case. There are other flags, so this was breaking applications when they intend to overwrite a file with e.g. `COPY_FILE_ALLOW_DECRYPTED_DESTINATION`. These functions were affected by the problem: - CopyFileEx - exposed by Total Commander not being able to overwrite file - PrivCopyFileEx - MoveFileWithProgress Also cover `ERROR_ALREADY_EXISTS` returned by CreateFileW to match Windows behavior, making the API tests pass. CORE-10271