Commit bae4776c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

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: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent faebd0ce
......@@ -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 );
}
/*
......
......@@ -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());
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment