From 9f3e9d464da8806acd185783f4d2350dd675fd2e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 23 Jul 2020 17:32:12 +0200 Subject: [PATCH] server: Remove no longer used write_console_output request. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/wine/condrv.h | 8 ++++ include/wine/server_protocol.h | 33 +------------ server/console.c | 84 ---------------------------------- server/protocol.def | 22 --------- server/request.h | 12 ----- server/trace.c | 20 -------- 6 files changed, 9 insertions(+), 170 deletions(-) diff --git a/include/wine/condrv.h b/include/wine/condrv.h index add88d8885c..922550f6f58 100644 --- a/include/wine/condrv.h +++ b/include/wine/condrv.h @@ -93,6 +93,14 @@ struct condrv_write_output_params /* followed by an array of data with type depending on mode */ }; +enum char_info_mode +{ + CHAR_INFO_MODE_TEXT, /* characters only */ + CHAR_INFO_MODE_ATTR, /* attributes only */ + CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */ + CHAR_INFO_MODE_TEXTSTDATTR, /* characters but use standard attributes */ +}; + /* IOCTL_CONDRV_GET_OUTPUT_INFO result */ struct condrv_output_info { diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index f50e6a213c2..9c9ff8945ee 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -1995,34 +1995,6 @@ struct create_console_output_reply -struct write_console_output_request -{ - struct request_header __header; - obj_handle_t handle; - int x; - int y; - int mode; - int wrap; - /* VARARG(data,bytes); */ -}; -struct write_console_output_reply -{ - struct reply_header __header; - int written; - int width; - int height; - char __pad_20[4]; -}; -enum char_info_mode -{ - CHAR_INFO_MODE_TEXT, - CHAR_INFO_MODE_ATTR, - CHAR_INFO_MODE_TEXTATTR, - CHAR_INFO_MODE_TEXTSTDATTR -}; - - - struct read_console_output_request { struct request_header __header; @@ -5646,7 +5618,6 @@ enum request REQ_append_console_input_history, REQ_get_console_input_history, REQ_create_console_output, - REQ_write_console_output, REQ_read_console_output, REQ_move_console_output, REQ_send_console_signal, @@ -5940,7 +5911,6 @@ union generic_request struct append_console_input_history_request append_console_input_history_request; struct get_console_input_history_request get_console_input_history_request; struct create_console_output_request create_console_output_request; - struct write_console_output_request write_console_output_request; struct read_console_output_request read_console_output_request; struct move_console_output_request move_console_output_request; struct send_console_signal_request send_console_signal_request; @@ -6232,7 +6202,6 @@ union generic_reply struct append_console_input_history_reply append_console_input_history_reply; struct get_console_input_history_reply get_console_input_history_reply; struct create_console_output_reply create_console_output_reply; - struct write_console_output_reply write_console_output_reply; struct read_console_output_reply read_console_output_reply; struct move_console_output_reply move_console_output_reply; struct send_console_signal_reply send_console_signal_reply; @@ -6451,7 +6420,7 @@ union generic_reply /* ### protocol_version begin ### */ -#define SERVER_PROTOCOL_VERSION 629 +#define SERVER_PROTOCOL_VERSION 630 /* ### protocol_version end ### */ diff --git a/server/console.c b/server/console.c index 9e61987e338..e74340d122c 100644 --- a/server/console.c +++ b/server/console.c @@ -1326,68 +1326,6 @@ static void write_console_output( struct screen_buffer *screen_buffer, const str else set_reply_data( &i, sizeof(i) ); } -/* write data into a screen buffer */ -static int write_console_output_req( struct screen_buffer *screen_buffer, data_size_t size, - const void* data, enum char_info_mode mode, - int x, int y, int wrap ) -{ - unsigned int i; - char_info_t *end, *dest = screen_buffer->data + y * screen_buffer->width + x; - - if (y >= screen_buffer->height) return 0; - - if (wrap) - end = screen_buffer->data + screen_buffer->height * screen_buffer->width; - else - end = screen_buffer->data + (y+1) * screen_buffer->width; - - switch(mode) - { - case CHAR_INFO_MODE_TEXT: - { - const WCHAR *ptr = data; - for (i = 0; i < size/sizeof(*ptr) && dest < end; dest++, i++) dest->ch = ptr[i]; - } - break; - case CHAR_INFO_MODE_ATTR: - { - const unsigned short *ptr = data; - for (i = 0; i < size/sizeof(*ptr) && dest < end; dest++, i++) dest->attr = ptr[i]; - } - break; - case CHAR_INFO_MODE_TEXTATTR: - { - const char_info_t *ptr = data; - for (i = 0; i < size/sizeof(*ptr) && dest < end; dest++, i++) *dest = ptr[i]; - } - break; - case CHAR_INFO_MODE_TEXTSTDATTR: - { - const WCHAR *ptr = data; - for (i = 0; i < size/sizeof(*ptr) && dest < end; dest++, i++) - { - dest->ch = ptr[i]; - dest->attr = screen_buffer->attr; - } - } - break; - default: - set_error( STATUS_INVALID_PARAMETER ); - return 0; - } - - if (i && screen_buffer == screen_buffer->input->active) - { - struct condrv_renderer_event evt; - evt.event = CONSOLE_RENDERER_UPDATE_EVENT; - memset(&evt.u, 0, sizeof(evt.u)); - evt.u.update.top = y + x / screen_buffer->width; - evt.u.update.bottom = y + (x + i - 1) / screen_buffer->width; - console_input_events_append( screen_buffer->input, &evt ); - } - return i; -} - /* fill a screen buffer with uniform data */ static int fill_console_output( struct screen_buffer *screen_buffer, char_info_t data, enum char_info_mode mode, int x, int y, int count, int wrap ) @@ -2219,28 +2157,6 @@ DECL_HANDLER(read_console_output) } } -/* write data (char and/or attrs) to a screen buffer */ -DECL_HANDLER(write_console_output) -{ - struct screen_buffer *screen_buffer; - - if ((screen_buffer = (struct screen_buffer*)get_handle_obj( current->process, req->handle, - FILE_WRITE_DATA, &screen_buffer_ops))) - { - if (console_input_is_bare( screen_buffer->input )) - { - set_error( STATUS_OBJECT_TYPE_MISMATCH ); - release_object( screen_buffer ); - return; - } - reply->written = write_console_output_req( screen_buffer, get_req_data_size(), get_req_data(), - req->mode, req->x, req->y, req->wrap ); - reply->width = screen_buffer->width; - reply->height = screen_buffer->height; - release_object( screen_buffer ); - } -} - /* move a rect of data in a screen buffer */ DECL_HANDLER(move_console_output) { diff --git a/server/protocol.def b/server/protocol.def index a121c371c19..d703ccb734e 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -1567,28 +1567,6 @@ enum server_fd_type @END -/* write data (chars and/or attributes) in a screen buffer */ -@REQ(write_console_output) - obj_handle_t handle; /* handle to the console output */ - int x; /* position where to start writing */ - int y; - int mode; /* char info (see below) */ - int wrap; /* wrap around at end of line? */ - VARARG(data,bytes); /* info to write */ -@REPLY - int written; /* number of char infos actually written */ - int width; /* width of screen buffer */ - int height; /* height of screen buffer */ -@END -enum char_info_mode -{ - CHAR_INFO_MODE_TEXT, /* characters only */ - CHAR_INFO_MODE_ATTR, /* attributes only */ - CHAR_INFO_MODE_TEXTATTR, /* both characters and attributes */ - CHAR_INFO_MODE_TEXTSTDATTR /* characters but use standard attributes */ -}; - - /* read data (chars and/or attributes) from a screen buffer */ @REQ(read_console_output) obj_handle_t handle; /* handle to the console output */ diff --git a/server/request.h b/server/request.h index 1ddf21496bb..529f2c4d1c0 100644 --- a/server/request.h +++ b/server/request.h @@ -191,7 +191,6 @@ DECL_HANDLER(get_console_input_info); DECL_HANDLER(append_console_input_history); DECL_HANDLER(get_console_input_history); DECL_HANDLER(create_console_output); -DECL_HANDLER(write_console_output); DECL_HANDLER(read_console_output); DECL_HANDLER(move_console_output); DECL_HANDLER(send_console_signal); @@ -484,7 +483,6 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_append_console_input_history, (req_handler)req_get_console_input_history, (req_handler)req_create_console_output, - (req_handler)req_write_console_output, (req_handler)req_read_console_output, (req_handler)req_move_console_output, (req_handler)req_send_console_signal, @@ -1170,16 +1168,6 @@ C_ASSERT( FIELD_OFFSET(struct create_console_output_request, fd) == 28 ); C_ASSERT( sizeof(struct create_console_output_request) == 32 ); C_ASSERT( FIELD_OFFSET(struct create_console_output_reply, handle_out) == 8 ); C_ASSERT( sizeof(struct create_console_output_reply) == 16 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_request, handle) == 12 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_request, x) == 16 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_request, y) == 20 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_request, mode) == 24 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_request, wrap) == 28 ); -C_ASSERT( sizeof(struct write_console_output_request) == 32 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_reply, written) == 8 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_reply, width) == 12 ); -C_ASSERT( FIELD_OFFSET(struct write_console_output_reply, height) == 16 ); -C_ASSERT( sizeof(struct write_console_output_reply) == 24 ); C_ASSERT( FIELD_OFFSET(struct read_console_output_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct read_console_output_request, x) == 16 ); C_ASSERT( FIELD_OFFSET(struct read_console_output_request, y) == 20 ); diff --git a/server/trace.c b/server/trace.c index 16bcc616a51..7cff5bf5f4b 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2138,23 +2138,6 @@ static void dump_create_console_output_reply( const struct create_console_output fprintf( stderr, " handle_out=%04x", req->handle_out ); } -static void dump_write_console_output_request( const struct write_console_output_request *req ) -{ - fprintf( stderr, " handle=%04x", req->handle ); - fprintf( stderr, ", x=%d", req->x ); - fprintf( stderr, ", y=%d", req->y ); - fprintf( stderr, ", mode=%d", req->mode ); - fprintf( stderr, ", wrap=%d", req->wrap ); - dump_varargs_bytes( ", data=", cur_size ); -} - -static void dump_write_console_output_reply( const struct write_console_output_reply *req ) -{ - fprintf( stderr, " written=%d", req->written ); - fprintf( stderr, ", width=%d", req->width ); - fprintf( stderr, ", height=%d", req->height ); -} - static void dump_read_console_output_request( const struct read_console_output_request *req ) { fprintf( stderr, " handle=%04x", req->handle ); @@ -4571,7 +4554,6 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_append_console_input_history_request, (dump_func)dump_get_console_input_history_request, (dump_func)dump_create_console_output_request, - (dump_func)dump_write_console_output_request, (dump_func)dump_read_console_output_request, (dump_func)dump_move_console_output_request, (dump_func)dump_send_console_signal_request, @@ -4861,7 +4843,6 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { NULL, (dump_func)dump_get_console_input_history_reply, (dump_func)dump_create_console_output_reply, - (dump_func)dump_write_console_output_reply, (dump_func)dump_read_console_output_reply, NULL, NULL, @@ -5151,7 +5132,6 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "append_console_input_history", "get_console_input_history", "create_console_output", - "write_console_output", "read_console_output", "move_console_output", "send_console_signal",