Commit 51367055 authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

MoveFile returns ERROR_ALREADY_EXISTS, not ERROR_FILE_EXISTS.

parent cf50f9a0
......@@ -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);
......
......@@ -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;
}
}
......
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