Module: wine
Branch: master
Commit: c9700896fe666b17a203d82b65bfb71113977a8b
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c9700896fe666b17a203d82b6…
Author: Kirill K. Smirnov <lich(a)math.spbu.ru>
Date: Tue Dec 18 19:38:50 2007 +0300
kernel32: ReadConsoleW should wait for at least one character before returning.
---
dlls/kernel32/console.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 65312d2..6bbffac 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -1359,17 +1359,20 @@ BOOL WINAPI ReadConsoleW(HANDLE hConsoleInput, LPVOID lpBuffer,
/* FIXME: should we read at least 1 char? The SDK does not say */
/* wait for at least one available input record (it doesn't mean we'll have
* chars stored in xbuf...)
+ *
+ * Although SDK doc keeps silence about 1 char, SDK examples assume
+ * that we should wait for at least one character (not key). --KS
*/
charsread = 0;
do
{
if (read_console_input(hConsoleInput, &ir, timeout) != rci_gotone) break;
- timeout = 0;
if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown &&
ir.Event.KeyEvent.uChar.UnicodeChar &&
!(ir.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY))
{
xbuf[charsread++] = ir.Event.KeyEvent.uChar.UnicodeChar;
+ timeout = 0;
}
} while (charsread < nNumberOfCharsToRead);
/* nothing has been read */