|
From: David W. <we...@cw...> - 2002-05-01 20:15:01
|
On Wed, May 01, 2002 at 08:48:55PM +0200, Jason Filby wrote:
> FILE: reactos\lib\kernel32\file\rw.c: (At about line 103, function ReadFile)
>
> Add two new variables:
> DWORD oldStdinMode;
> WINBOOL consoleResult;
>
> Then replace the first few lines of code with:
>
> if (IsConsoleHandle(hFile))
> {
> GetConsoleMode(hFile, &oldStdinMode);
> SetConsoleMode(hFile, ENABLE_ECHO_INPUT | ENABLE_PROCESSED_INPUT);
>
> consoleResult = ReadConsoleA(hFile,
> lpBuffer,
> nNumberOfBytesToRead,
> lpNumberOfBytesRead,
> NULL);
>
> SetConsoleMode(hFile, oldStdinMode);
> return consoleResult;
> }
>
> NOTE: What it does is set the stdin to echo all input (that was missing if it's not specified). Also save and load the previous stdin settings, otherwise when you go back to the command line it's broken.
>
> Comments please
>
I don't see that the second change is correct; where is it documented that
ReadFile always reads in non-raw, echoed mode? Shouldn't the library
implementing the libc interface set the console mode themselves?
|