mirror of
https://github.com/reactos/reactos.git
synced 2024-09-28 13:34:53 +00:00
ReadFile: When reading from a console handle with processed input mode enabled, simulate EOF if the first character read is ^Z (Bug 4745)
svn path=/trunk/; revision=42345
This commit is contained in:
parent
2d8cd02bb5
commit
ee2e05e18d
|
@ -148,11 +148,22 @@ ReadFile(IN HANDLE hFile,
|
|||
|
||||
if (IsConsoleHandle(hFile))
|
||||
{
|
||||
return ReadConsoleA(hFile,
|
||||
if (ReadConsoleA(hFile,
|
||||
lpBuffer,
|
||||
nNumberOfBytesToRead,
|
||||
lpNumberOfBytesRead,
|
||||
NULL);
|
||||
NULL))
|
||||
{
|
||||
DWORD dwMode;
|
||||
GetConsoleMode(hFile, &dwMode);
|
||||
if ((dwMode & ENABLE_PROCESSED_INPUT) && *(char *)lpBuffer == 0x1a)
|
||||
{
|
||||
/* EOF character entered; simulate end-of-file */
|
||||
*lpNumberOfBytesRead = 0;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (lpOverlapped != NULL)
|
||||
|
|
Loading…
Reference in a new issue