Signed-off-by: Jon Doron arilou@gmail.com --- dlls/kernel32/path.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index 41f0d34aa4..554f96a2b1 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1392,6 +1392,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest, }
NtClose( dest_handle ); + dest_handle = NULL; } else if (status != STATUS_OBJECT_NAME_NOT_FOUND) {
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 --- 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 ); }