kernel32: Don't fail ReplaceFile() if unable to delete a generated backup.

Windows will just leave the file if unable to delete it.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
feature/deterministic
Zebediah Figura 2020-03-28 23:09:35 -05:00 committed by Alexandre Julliard
parent faebd0ce14
commit bae4776c57
2 changed files with 3 additions and 7 deletions

View File

@ -507,11 +507,7 @@ BOOL WINAPI ReplaceFileW(LPCWSTR lpReplacedFileName, LPCWSTR lpReplacementFileNa
|| !MoveFileExW( lpReplacedFileName, temp_file, MOVEFILE_REPLACE_EXISTING ))
return FALSE;
if (!DeleteFileW( temp_file ))
{
SetLastError( ERROR_UNABLE_TO_REMOVE_REPLACED );
return FALSE;
}
DeleteFileW( temp_file );
}
/*

View File

@ -3841,12 +3841,12 @@ static void test_ReplaceFileA(void)
ok(ret, "got error %u\n", GetLastError());
ret = ReplaceFileA(replaced, replacement, NULL, 0, 0, 0);
todo_wine ok(ret, "got error %u\n", GetLastError());
ok(ret, "got error %u\n", GetLastError());
CloseHandle(mapping);
CloseHandle(hReplacedFile);
ret = DeleteFileA(replaced);
todo_wine ok(ret, "got error %u\n", GetLastError());
ok(ret, "got error %u\n", GetLastError());
}
/*