Windows will just leave the file if unable to delete it.
Fixes: 5e218fe758fe6beed5c7ad73405eccf33c307e6d Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernel32/file.c | 6 +----- dlls/kernel32/tests/file.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index 2a2ace5dd81..3b2d82cc37e 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -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 ); }
/* diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 41d03c14fa2..e8a31c6e749 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -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()); }
/*