MoveFile returns ERROR_ALREADY_EXISTS, not ERROR_FILE_EXISTS.

This commit is contained in:
Hans Leidekker 2003-12-15 20:15:20 +00:00 committed by Alexandre Julliard
parent cf50f9a04e
commit 513670551b
2 changed files with 3 additions and 3 deletions

View File

@ -669,7 +669,7 @@ static void test_MoveFileA(void)
ok(ret != 0, "GetTempFileNameA error %ld", GetLastError());
ret = MoveFileA(source, dest);
ok(!ret && GetLastError() == ERROR_FILE_EXISTS,
ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS,
"MoveFileA: unexpected error %ld\n", GetLastError());
ret = DeleteFileA(dest);
@ -745,7 +745,7 @@ static void test_MoveFileW(void)
ok(ret != 0, "GetTempFileNameW error %ld", GetLastError());
ret = MoveFileW(source, dest);
ok(!ret && GetLastError() == ERROR_FILE_EXISTS,
ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS,
"CopyFileW: unexpected error %ld\n", GetLastError());
ret = DeleteFileW(source);

View File

@ -1817,7 +1817,7 @@ BOOL WINAPI MoveFileExW( LPCWSTR fn1, LPCWSTR fn2, DWORD flag )
/* target exists, check if we may overwrite */
if (!(flag & MOVEFILE_REPLACE_EXISTING))
{
SetLastError( ERROR_FILE_EXISTS );
SetLastError( ERROR_ALREADY_EXISTS );
return FALSE;
}
}