[KERNEL32]

FlushFileBuffers:
- In spite of what MSDN pretends, it appears that FlushFileBuffers flushes console input buffer when it's called with a console handle. Then, do it here as well.
- Get rid of SetLastErrorByStatus here...

svn path=/trunk/; revision=50980
This commit is contained in:
Pierre Schweitzer 2011-03-06 10:28:50 +00:00
parent 5696898543
commit 91bdfab1bd

View file

@ -406,26 +406,26 @@ OpenFile(LPCSTR lpFileName,
* @implemented * @implemented
*/ */
BOOL WINAPI BOOL WINAPI
FlushFileBuffers(HANDLE hFile) FlushFileBuffers(IN HANDLE hFile)
{ {
NTSTATUS errCode; NTSTATUS Status;
IO_STATUS_BLOCK IoStatusBlock; IO_STATUS_BLOCK IoStatusBlock;
hFile = TranslateStdHandle(hFile); hFile = TranslateStdHandle(hFile);
if (IsConsoleHandle(hFile)) if (IsConsoleHandle(hFile))
{ {
return FALSE; return FlushConsoleInputBuffer(hFile);
} }
errCode = NtFlushBuffersFile(hFile, Status = NtFlushBuffersFile(hFile,
&IoStatusBlock); &IoStatusBlock);
if (!NT_SUCCESS(errCode)) if (!NT_SUCCESS(Status))
{ {
SetLastErrorByStatus(errCode); BaseSetLastNTError(Status);
return(FALSE); return FALSE;
} }
return(TRUE); return TRUE;
} }