Module: wine Branch: master Commit: aa5107b16542a2b236224cc4974731691d77a20c URL: https://source.winehq.org/git/wine.git/?a=commit;h=aa5107b16542a2b236224cc49...
Author: Jon Doron arilou@gmail.com Date: Fri Jan 11 10:24:45 2019 +0200
kernel32: Fix MOVEFILE_REPLACE_EXISTING between devices.
Fix the case of rename fails because when done between 2 different devices and the MOVEFILE_REPLACE_EXISTING is set.
Signed-off-by: Jon Doron arilou@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 554f96a..cf1c768 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1418,8 +1418,9 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, NtClose( source_handle ); RtlFreeAnsiString( &source_unix ); RtlFreeAnsiString( &dest_unix ); - if (!CopyFileExW( source, dest, fnProgress, - param, NULL, COPY_FILE_FAIL_IF_EXISTS )) + if (!CopyFileExW( source, dest, fnProgress, param, NULL, + flag & MOVEFILE_REPLACE_EXISTING ? + 0 : COPY_FILE_FAIL_IF_EXISTS )) return FALSE; return DeleteFileW( source ); }