[PATCH v1 2/2] kernel32: Fix MOVEFILE_REPLACE_EXISTING between devices

Jon Doron arilou at gmail.com
Fri Jan 11 02:24:45 CST 2019


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 at gmail.com>
---
 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 554f96a2b1..cf1c768970 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 );
         }
-- 
2.19.2




More information about the wine-devel mailing list