From aa5107b16542a2b236224cc4974731691d77a20c Mon Sep 17 00:00:00 2001 From: Jon Doron Date: Fri, 11 Jan 2019 10:24:45 +0200 Subject: [PATCH] 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 Signed-off-by: Alexandre Julliard --- 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 554f96a2b19..cf1c7689704 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 ); }