From 6b96e0e0cbdc28e9dbde3fa3d9bc948b512fd1fb Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 14 Jul 2020 16:23:17 +0200 Subject: [PATCH] server: Introduce IOCTL_CONDRV_FILL_OUTPUT ioctl. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/wine/condrv.h | 13 +++++++++++++ server/console.c | 20 ++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/wine/condrv.h b/include/wine/condrv.h index 25e5820046d..a8b7c049158 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -36,6 +36,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_FILL_OUTPUT CTL_CODE(FILE_DEVICE_CONSOLE, 35, METHOD_BUFFERED, FILE_WRITE_DATA) /* console renderer ioctls */ #define IOCTL_CONDRV_GET_RENDERER_EVENTS CTL_CODE(FILE_DEVICE_CONSOLE, 70, METHOD_BUFFERED, FILE_READ_PROPERTIES) @@ -80,6 +81,18 @@ struct condrv_output_info_params struct condrv_output_info info; /* output info */ }; +/* IOCTL_CONDRV_FILL_OUTPUT params */ +struct condrv_fill_output_params +{ + int x; /* position where to start writing */ + int y; + int mode; /* char info mode */ + int count; /* number to write */ + int wrap; /* wrap around at end of line? */ + WCHAR ch; /* character to write */ + unsigned short attr; /* attribute to write */ +}; + #define SET_CONSOLE_OUTPUT_INFO_CURSOR_GEOM 0x0001 #define SET_CONSOLE_OUTPUT_INFO_CURSOR_POS 0x0002 #define SET_CONSOLE_OUTPUT_INFO_SIZE 0x0004 diff --git a/server/console.c b/server/console.c index 72e98f14a91..a5ddd82478a 100644 --- a/server/console.c +++ b/server/console.c @@ -1682,6 +1682,26 @@ 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_FILL_OUTPUT: + { + const struct condrv_fill_output_params *params = get_req_data(); + char_info_t data; + DWORD written; + if (get_req_data_size() != sizeof(*params) || + (get_reply_max_size() && get_reply_max_size() != sizeof(written))) + { + set_error( STATUS_INVALID_PARAMETER ); + return 0; + } + data.ch = params->ch; + data.attr = params->attr; + written = fill_console_output( screen_buffer, data, params->mode, + params->x, params->y, params->count, params->wrap ); + if (written && get_reply_max_size() == sizeof(written)) + set_reply_data( &written, sizeof(written) ); + return !get_error(); + } + default: set_error( STATUS_INVALID_HANDLE ); return 0;