mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
[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:
parent
5696898543
commit
91bdfab1bd
1 changed files with 9 additions and 9 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue