mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user