From b68138a62e849036b75954f7a406c64be5d86e21 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 17 Jul 2020 13:55:40 +0200 Subject: [PATCH] server: Introduce IOCTL_CONDRV_ACTIVATE ioctl. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/wine/condrv.h | 1 + server/console.c | 15 +++++++++++++++ server/trace.c | 1 + 3 files changed, 17 insertions(+) diff --git a/include/wine/condrv.h b/include/wine/condrv.h index bf00262d70c..fedf3f308ce 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -37,6 +37,7 @@ /* console output ioctls */ #define IOCTL_CONDRV_GET_OUTPUT_INFO CTL_CODE(FILE_DEVICE_CONSOLE, 32, METHOD_BUFFERED, FILE_READ_PROPERTIES) #define IOCTL_CONDRV_SET_OUTPUT_INFO CTL_CODE(FILE_DEVICE_CONSOLE, 33, METHOD_BUFFERED, FILE_WRITE_PROPERTIES) +#define IOCTL_CONDRV_ACTIVATE CTL_CODE(FILE_DEVICE_CONSOLE, 34, METHOD_BUFFERED, FILE_WRITE_DATA) #define IOCTL_CONDRV_FILL_OUTPUT CTL_CODE(FILE_DEVICE_CONSOLE, 35, METHOD_BUFFERED, FILE_WRITE_DATA) /* console renderer ioctls */ diff --git a/server/console.c b/server/console.c index 2785669deb2..149a31dd578 100644 --- a/server/console.c +++ b/server/console.c @@ -1694,6 +1694,21 @@ static int screen_buffer_ioctl( struct fd *fd, ioctl_code_t code, struct async * return set_output_info( screen_buffer, params, get_req_data_size() - sizeof(*params) ); } + case IOCTL_CONDRV_ACTIVATE: + if (!screen_buffer->input) + { + set_error( STATUS_INVALID_HANDLE ); + return 0; + } + + if (screen_buffer != screen_buffer->input->active) + { + if (screen_buffer->input->active) release_object( screen_buffer->input->active ); + screen_buffer->input->active = (struct screen_buffer *)grab_object( screen_buffer ); + generate_sb_initial_events( screen_buffer->input ); + } + return 1; + case IOCTL_CONDRV_FILL_OUTPUT: { const struct condrv_fill_output_params *params = get_req_data(); diff --git a/server/trace.c b/server/trace.c index a2ee9c10b7d..c3cfd7de12b 100644 --- a/server/trace.c +++ b/server/trace.c @@ -114,6 +114,7 @@ static void dump_ioctl_code( const char *prefix, const ioctl_code_t *code ) switch(*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_FILL_OUTPUT); CASE(IOCTL_CONDRV_GET_INPUT_INFO);