Module: wine Branch: master Commit: c47f64bd3e5ca6e10096dc9b39d3df2cc9be95a0 URL: https://source.winehq.org/git/wine.git/?a=commit;h=c47f64bd3e5ca6e10096dc9b3...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Sep 21 17:06:37 2020 +0200
conhost: Use IOCTL_CONDRV_SETUP_INPUT to initialize input in Unix mode.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
programs/conhost/conhost.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index 0de55af14c..c637b16379 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -1625,6 +1625,14 @@ static DWORD WINAPI tty_input( void *param ) BOOL signaled; NTSTATUS status;
+ if (console->is_unix) + { + unsigned int h = condrv_handle( console->tty_input ); + status = NtDeviceIoControlFile( console->server, NULL, NULL, NULL, &io, IOCTL_CONDRV_SETUP_INPUT, + &h, sizeof(h), NULL, 0 ); + if (status) ERR( "input setup failed: %#x\n", status ); + } + event = CreateEventW( NULL, TRUE, FALSE, NULL );
for (;;) @@ -1682,6 +1690,13 @@ static DWORD WINAPI tty_input( void *param )
EnterCriticalSection( &console_section ); if (console->read_ioctl) read_complete( console, status, NULL, 0, FALSE ); + if (console->is_unix) + { + unsigned int h = 0; + status = NtDeviceIoControlFile( console->server, NULL, NULL, NULL, &io, IOCTL_CONDRV_SETUP_INPUT, + &h, sizeof(h), NULL, 0 ); + if (status) ERR( "input restore failed: %#x\n", status ); + } CloseHandle( console->input_thread ); console->input_thread = NULL; LeaveCriticalSection( &console_section );