server: Introduce IOCTL_CONDRV_CTRL_EVENT ioctl.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-09-01 15:35:51 +02:00 committed by Alexandre Julliard
parent 7d3503d83e
commit f9c8993259
3 changed files with 28 additions and 0 deletions

View File

@ -36,6 +36,7 @@
#define IOCTL_CONDRV_SET_INPUT_INFO CTL_CODE(FILE_DEVICE_CONSOLE, 14, METHOD_BUFFERED, FILE_WRITE_PROPERTIES)
#define IOCTL_CONDRV_GET_TITLE CTL_CODE(FILE_DEVICE_CONSOLE, 15, METHOD_BUFFERED, FILE_READ_PROPERTIES)
#define IOCTL_CONDRV_SET_TITLE CTL_CODE(FILE_DEVICE_CONSOLE, 16, METHOD_BUFFERED, FILE_WRITE_PROPERTIES)
#define IOCTL_CONDRV_CTRL_EVENT CTL_CODE(FILE_DEVICE_CONSOLE, 17, METHOD_BUFFERED, FILE_WRITE_PROPERTIES)
/* console output ioctls */
#define IOCTL_CONDRV_READ_OUTPUT CTL_CODE(FILE_DEVICE_CONSOLE, 30, METHOD_BUFFERED, FILE_READ_DATA)
@ -226,6 +227,13 @@ enum condrv_renderer_event_type
CONSOLE_RENDERER_EXIT_EVENT,
};
/* IOCTL_CONDRV_CTRL_EVENT params */
struct condrv_ctrl_event
{
int event; /* the event to send */
unsigned int group_id; /* the group to send the event to */
};
/* Wine specific values for console inheritance (params->ConsoleHandle) */
#define CONSOLE_HANDLE_ALLOC ((HANDLE)1)

View File

@ -1844,6 +1844,25 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
return 1;
}
case IOCTL_CONDRV_CTRL_EVENT:
{
const struct condrv_ctrl_event *event = get_req_data();
process_id_t group;
if (get_req_data_size() != sizeof(*event))
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
group = event->group_id ? event->group_id : current->process->group_id;
if (!group)
{
set_error( STATUS_INVALID_PARAMETER );
return 0;
}
propagate_console_signal( console, event->event, group );
return !get_error();
}
default:
set_error( STATUS_INVALID_HANDLE );
return 0;

View File

@ -116,6 +116,7 @@ static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code )
#define CASE(c) case c: fprintf( stderr, "%s%s", prefix, #c ); break
CASE(IOCTL_CONDRV_ACTIVATE);
CASE(IOCTL_CONDRV_ATTACH_RENDERER);
CASE(IOCTL_CONDRV_CTRL_EVENT);
CASE(IOCTL_CONDRV_FILL_OUTPUT);
CASE(IOCTL_CONDRV_GET_INPUT_INFO);
CASE(IOCTL_CONDRV_GET_MODE);