Jacek Caban : conhost: Signal console in tty_input if needed.

Alexandre Julliard julliard at winehq.org
Mon Sep 21 15:12:16 CDT 2020


Module: wine
Branch: master
Commit: a33594a0483be2fe30d6cff8e523a9bb208b7240
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a33594a0483be2fe30d6cff8e523a9bb208b7240

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Sep 21 17:05:26 2020 +0200

conhost: Signal console in tty_input if needed.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/conhost/conhost.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c
index 5f6065eab5..a9ad38eb99 100644
--- a/programs/conhost/conhost.c
+++ b/programs/conhost/conhost.c
@@ -473,7 +473,7 @@ static NTSTATUS read_complete( struct console *console, NTSTATUS status, const v
         status = wine_server_call( req );
     }
     SERVER_END_REQ;
-    if (status) ERR( "failed: %#x\n", status );
+    if (status && (console->read_ioctl || status != STATUS_INVALID_HANDLE)) ERR( "failed: %#x\n", status );
     console->read_ioctl = 0;
     console->pending_read = 0;
     return status;
@@ -1580,6 +1580,7 @@ static DWORD WINAPI tty_input( void *param )
     char read_buf[4096];
     WCHAR buf[4096];
     DWORD count, i;
+    BOOL signaled;
     NTSTATUS status;
 
     event = CreateEventW( NULL, TRUE, FALSE, NULL );
@@ -1595,6 +1596,7 @@ static DWORD WINAPI tty_input( void *param )
         if (status) break;
 
         EnterCriticalSection( &console_section );
+        signaled = console->record_count != 0;
 
         /* FIXME: Handle partial char read */
         count = MultiByteToWideChar(CP_UTF8, 0, read_buf, io.Information, buf, ARRAY_SIZE(buf));
@@ -1626,6 +1628,11 @@ static DWORD WINAPI tty_input( void *param )
         }
 
         process_console_input( console );
+        if (!signaled && console->record_count)
+        {
+            assert( !console->read_ioctl );
+            read_complete( console, STATUS_SUCCESS, NULL, 0, TRUE ); /* signal console */
+        }
         LeaveCriticalSection( &console_section );
     }
 




More information about the wine-cvs mailing list