Commit dfe1bb7b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

conhost: Signal console in process_console_input if needed.

parent 8999dd2b
...@@ -428,6 +428,7 @@ static NTSTATUS read_complete( struct console *console, NTSTATUS status, const v ...@@ -428,6 +428,7 @@ static NTSTATUS read_complete( struct console *console, NTSTATUS status, const v
} }
SERVER_END_REQ; SERVER_END_REQ;
if (status && (console->read_ioctl || status != STATUS_INVALID_HANDLE)) ERR( "failed: %#x\n", status ); if (status && (console->read_ioctl || status != STATUS_INVALID_HANDLE)) ERR( "failed: %#x\n", status );
console->signaled = signal;
console->read_ioctl = 0; console->read_ioctl = 0;
console->pending_read = 0; console->pending_read = 0;
return status; return status;
...@@ -1218,6 +1219,9 @@ static NTSTATUS process_console_input( struct console *console ) ...@@ -1218,6 +1219,9 @@ static NTSTATUS process_console_input( struct console *console )
case IOCTL_CONDRV_READ_FILE: case IOCTL_CONDRV_READ_FILE:
break; break;
default: default:
assert( !console->read_ioctl );
if (console->record_count && !console->signaled)
read_complete( console, STATUS_PENDING, NULL, 0, TRUE ); /* signal server */
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }
...@@ -2534,11 +2538,12 @@ static NTSTATUS process_console_ioctls( struct console *console ) ...@@ -2534,11 +2538,12 @@ static NTSTATUS process_console_ioctls( struct console *console )
{ {
if (status) out_size = 0; if (status) out_size = 0;
console->signaled = console->record_count != 0;
SERVER_START_REQ( get_next_console_request ) SERVER_START_REQ( get_next_console_request )
{ {
req->handle = wine_server_obj_handle( console->server ); req->handle = wine_server_obj_handle( console->server );
req->status = status; req->status = status;
req->signal = console->record_count != 0; req->signal = console->signaled;
wine_server_add_data( req, ioctl_buffer, out_size ); wine_server_add_data( req, ioctl_buffer, out_size );
wine_server_set_reply( req, ioctl_buffer, ioctl_buffer_size ); wine_server_set_reply( req, ioctl_buffer, ioctl_buffer_size );
status = wine_server_call( req ); status = wine_server_call( req );
......
...@@ -80,6 +80,7 @@ struct console ...@@ -80,6 +80,7 @@ struct console
INPUT_RECORD *records; /* input records */ INPUT_RECORD *records; /* input records */
unsigned int record_count; /* number of input records */ unsigned int record_count; /* number of input records */
unsigned int record_size; /* size of input records buffer */ unsigned int record_size; /* size of input records buffer */
int signaled; /* is server in signaled state */
WCHAR *read_buffer; /* buffer of data available for read */ WCHAR *read_buffer; /* buffer of data available for read */
size_t read_buffer_count; /* size of available data */ size_t read_buffer_count; /* size of available data */
size_t read_buffer_size; /* size of buffer */ size_t read_buffer_size; /* size of buffer */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment