Module: wine Branch: master Commit: 817cb4dd696b8f9c9e118a29d949fa419a63bcaf URL: https://gitlab.winehq.org/wine/wine/-/commit/817cb4dd696b8f9c9e118a29d949fa4...
Author: Rémi Bernon rbernon@codeweavers.com Date: Mon Jun 24 16:30:15 2024 +0200
server: Remove now unnecessary active_hooks from replies.
---
include/wine/server_protocol.h | 10 +++------- server/hook.c | 4 ---- server/protocol.def | 4 ---- server/queue.c | 17 ----------------- server/request.h | 10 +++------- server/trace.c | 10 +--------- 6 files changed, 7 insertions(+), 48 deletions(-)
diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index e78c3af4cc1..0516d23d3ee 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -2967,9 +2967,9 @@ struct get_message_reply int x; int y; unsigned int time; - unsigned int active_hooks; data_size_t total; /* VARARG(data,message_data); */ + char __pad_52[4]; };
@@ -4228,7 +4228,7 @@ struct set_hook_reply { struct reply_header __header; user_handle_t handle; - unsigned int active_hooks; + char __pad_12[4]; };
@@ -4244,8 +4244,6 @@ struct remove_hook_request struct remove_hook_reply { struct reply_header __header; - unsigned int active_hooks; - char __pad_12[4]; };
@@ -4267,9 +4265,7 @@ struct start_hook_chain_reply thread_id_t tid; int unicode; client_ptr_t proc; - unsigned int active_hooks; /* VARARG(module,unicode_str); */ - char __pad_36[4]; };
@@ -6591,7 +6587,7 @@ union generic_reply
/* ### protocol_version begin ### */
-#define SERVER_PROTOCOL_VERSION 818 +#define SERVER_PROTOCOL_VERSION 819
/* ### protocol_version end ### */
diff --git a/server/hook.c b/server/hook.c index 3047f52492d..c2d2823cd61 100644 --- a/server/hook.c +++ b/server/hook.c @@ -486,7 +486,6 @@ DECL_HANDLER(set_hook) req->flags, req->proc, req->unicode, module, module_size ))) { reply->handle = hook->handle; - reply->active_hooks = get_active_hooks(); } else free( module );
@@ -525,7 +524,6 @@ DECL_HANDLER(remove_hook) }
remove_hook( hook ); - reply->active_hooks = get_active_hooks(); }
@@ -542,8 +540,6 @@ DECL_HANDLER(start_hook_chain) return; }
- reply->active_hooks = get_active_hooks(); - if (!table || !(hook = get_first_valid_hook( table, req->id - WH_MINHOOK, req->event, req->window, req->object_id, req->child_id ))) { diff --git a/server/protocol.def b/server/protocol.def index 128aab3a812..33fd7a96e03 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2231,7 +2231,6 @@ enum message_type int x; /* message x position */ int y; /* message y position */ unsigned int time; /* message time */ - unsigned int active_hooks; /* active hooks bitmap */ data_size_t total; /* total size of extra data */ VARARG(data,message_data); /* message data for sent messages */ @END @@ -3035,7 +3034,6 @@ enum caret_state VARARG(module,unicode_str); /* module name */ @REPLY user_handle_t handle; /* handle to the hook */ - unsigned int active_hooks; /* active hooks bitmap */ @END
@@ -3045,7 +3043,6 @@ enum caret_state client_ptr_t proc; /* hook procedure if handle is 0 */ int id; /* id of the hook if handle is 0 */ @REPLY - unsigned int active_hooks; /* active hooks bitmap */ @END
@@ -3062,7 +3059,6 @@ enum caret_state thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */ int unicode; /* is it a unicode hook? */ client_ptr_t proc; /* hook procedure */ - unsigned int active_hooks; /* active hooks bitmap */ VARARG(module,unicode_str); /* module name */ @END
diff --git a/server/queue.c b/server/queue.c index f73beb3ce4c..53306f46793 100644 --- a/server/queue.c +++ b/server/queue.c @@ -625,21 +625,6 @@ void set_queue_hooks( struct thread *thread, struct hook_table *hooks ) queue->hooks = hooks; }
-/* get the thread message queue active hooks bitmap */ -unsigned int get_active_hooks(void) -{ - unsigned int ret = 1u << 31; /* set high bit to indicate that the bitmap is valid */ - struct msg_queue *queue; - int bit; - - if (!(queue = current->queue)) return ret; - - for (bit = 0; bit < ARRAY_SIZE(queue->shared->hooks_count); bit++) - if (queue->shared->hooks_count[bit]) ret |= 1 << bit; - - return ret; -} - /* update the thread message queue hooks counters */ void add_queue_hook_count( struct thread *thread, unsigned int index, int count ) { @@ -3125,8 +3110,6 @@ DECL_HANDLER(get_message) user_handle_t get_win = get_user_full_handle( req->get_win ); unsigned int filter = req->flags >> 16;
- reply->active_hooks = get_active_hooks(); - if (get_win && get_win != 1 && get_win != -1 && !get_user_object( get_win, USER_WINDOW )) { set_win32_error( ERROR_INVALID_WINDOW_HANDLE ); diff --git a/server/request.h b/server/request.h index 2dbde23f705..3944e754cfa 100644 --- a/server/request.h +++ b/server/request.h @@ -1430,8 +1430,7 @@ C_ASSERT( FIELD_OFFSET(struct get_message_reply, type) == 32 ); C_ASSERT( FIELD_OFFSET(struct get_message_reply, x) == 36 ); C_ASSERT( FIELD_OFFSET(struct get_message_reply, y) == 40 ); C_ASSERT( FIELD_OFFSET(struct get_message_reply, time) == 44 ); -C_ASSERT( FIELD_OFFSET(struct get_message_reply, active_hooks) == 48 ); -C_ASSERT( FIELD_OFFSET(struct get_message_reply, total) == 52 ); +C_ASSERT( FIELD_OFFSET(struct get_message_reply, total) == 48 ); C_ASSERT( sizeof(struct get_message_reply) == 56 ); C_ASSERT( FIELD_OFFSET(struct reply_message_request, remove) == 12 ); C_ASSERT( FIELD_OFFSET(struct reply_message_request, result) == 16 ); @@ -1863,14 +1862,12 @@ C_ASSERT( FIELD_OFFSET(struct set_hook_request, flags) == 40 ); C_ASSERT( FIELD_OFFSET(struct set_hook_request, unicode) == 44 ); C_ASSERT( sizeof(struct set_hook_request) == 48 ); C_ASSERT( FIELD_OFFSET(struct set_hook_reply, handle) == 8 ); -C_ASSERT( FIELD_OFFSET(struct set_hook_reply, active_hooks) == 12 ); C_ASSERT( sizeof(struct set_hook_reply) == 16 ); C_ASSERT( FIELD_OFFSET(struct remove_hook_request, handle) == 12 ); C_ASSERT( FIELD_OFFSET(struct remove_hook_request, proc) == 16 ); C_ASSERT( FIELD_OFFSET(struct remove_hook_request, id) == 24 ); C_ASSERT( sizeof(struct remove_hook_request) == 32 ); -C_ASSERT( FIELD_OFFSET(struct remove_hook_reply, active_hooks) == 8 ); -C_ASSERT( sizeof(struct remove_hook_reply) == 16 ); +C_ASSERT( sizeof(struct remove_hook_reply) == 8 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_request, id) == 12 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_request, event) == 16 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_request, window) == 20 ); @@ -1882,8 +1879,7 @@ C_ASSERT( FIELD_OFFSET(struct start_hook_chain_reply, pid) == 12 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_reply, tid) == 16 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_reply, unicode) == 20 ); C_ASSERT( FIELD_OFFSET(struct start_hook_chain_reply, proc) == 24 ); -C_ASSERT( FIELD_OFFSET(struct start_hook_chain_reply, active_hooks) == 32 ); -C_ASSERT( sizeof(struct start_hook_chain_reply) == 40 ); +C_ASSERT( sizeof(struct start_hook_chain_reply) == 32 ); C_ASSERT( FIELD_OFFSET(struct finish_hook_chain_request, id) == 12 ); C_ASSERT( sizeof(struct finish_hook_chain_request) == 16 ); C_ASSERT( FIELD_OFFSET(struct get_hook_info_request, handle) == 12 ); diff --git a/server/trace.c b/server/trace.c index c1d25247611..36ff25afe6a 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2805,7 +2805,6 @@ static void dump_get_message_reply( const struct get_message_reply *req ) fprintf( stderr, ", x=%d", req->x ); fprintf( stderr, ", y=%d", req->y ); fprintf( stderr, ", time=%08x", req->time ); - fprintf( stderr, ", active_hooks=%08x", req->active_hooks ); fprintf( stderr, ", total=%u", req->total ); dump_varargs_message_data( ", data=", cur_size ); } @@ -3656,7 +3655,6 @@ static void dump_set_hook_request( const struct set_hook_request *req ) static void dump_set_hook_reply( const struct set_hook_reply *req ) { fprintf( stderr, " handle=%08x", req->handle ); - fprintf( stderr, ", active_hooks=%08x", req->active_hooks ); }
static void dump_remove_hook_request( const struct remove_hook_request *req ) @@ -3666,11 +3664,6 @@ static void dump_remove_hook_request( const struct remove_hook_request *req ) fprintf( stderr, ", id=%d", req->id ); }
-static void dump_remove_hook_reply( const struct remove_hook_reply *req ) -{ - fprintf( stderr, " active_hooks=%08x", req->active_hooks ); -} - static void dump_start_hook_chain_request( const struct start_hook_chain_request *req ) { fprintf( stderr, " id=%d", req->id ); @@ -3687,7 +3680,6 @@ static void dump_start_hook_chain_reply( const struct start_hook_chain_reply *re fprintf( stderr, ", tid=%04x", req->tid ); fprintf( stderr, ", unicode=%d", req->unicode ); dump_uint64( ", proc=", &req->proc ); - fprintf( stderr, ", active_hooks=%08x", req->active_hooks ); dump_varargs_unicode_str( ", module=", cur_size ); }
@@ -5143,7 +5135,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_set_caret_window_reply, (dump_func)dump_set_caret_info_reply, (dump_func)dump_set_hook_reply, - (dump_func)dump_remove_hook_reply, + NULL, (dump_func)dump_start_hook_chain_reply, NULL, (dump_func)dump_get_hook_info_reply,