[KERNEL32]

CreateFile has to set last error on success.
Fixes kernel32:file test cancellation.

svn path=/trunk/; revision=54257
This commit is contained in:
Sylvain Petreolle 2011-10-26 19:02:32 +00:00
parent f8459fbb45
commit 7d118f02b6

View file

@ -146,7 +146,7 @@ HANDLE WINAPI CreateFileW (LPCWSTR lpFileName,
|| 0 == _wcsicmp(L"CONIN$", lpFileName))
{
return OpenConsoleW(lpFileName,
dwDesiredAccess,
dwDesiredAccess,
lpSecurityAttributes ? lpSecurityAttributes->bInheritHandle : FALSE,
FILE_SHARE_READ | FILE_SHARE_WRITE);
}
@ -367,6 +367,10 @@ HANDLE WINAPI CreateFileW (LPCWSTR lpFileName,
{
SetLastError(IoStatusBlock.Information == FILE_OVERWRITTEN ? ERROR_ALREADY_EXISTS : 0);
}
else
{
SetLastError(0);
}
return FileHandle;
}