[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
*/
BOOL WINAPI
FlushFileBuffers(HANDLE hFile)
FlushFileBuffers(IN HANDLE hFile)
{
NTSTATUS errCode;
NTSTATUS Status;
IO_STATUS_BLOCK IoStatusBlock;
hFile = TranslateStdHandle(hFile);
if (IsConsoleHandle(hFile))
{
return FALSE;
return FlushConsoleInputBuffer(hFile);
}
errCode = NtFlushBuffersFile(hFile,
&IoStatusBlock);
if (!NT_SUCCESS(errCode))
Status = NtFlushBuffersFile(hFile,
&IoStatusBlock);
if (!NT_SUCCESS(Status))
{
SetLastErrorByStatus(errCode);
return(FALSE);
BaseSetLastNTError(Status);
return FALSE;
}
return(TRUE);
return TRUE;
}