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>
This commit is contained in:
Jon Doron 2019-01-11 10:24:45 +02:00 committed by Alexandre Julliard
parent 69d3c7a00f
commit aa5107b165
1 changed files with 3 additions and 2 deletions

View File

@ -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 );
}