diff --git a/dlls/user/hook.c b/dlls/user/hook.c index 4ba1d82073..b8996aa560 100644 --- a/dlls/user/hook.c +++ b/dlls/user/hook.c @@ -359,11 +359,14 @@ static LRESULT call_hook( struct hook_info *info, INT code, WPARAM wparam, LPARA { struct user_thread_info *thread_info = get_user_thread_info(); HHOOK prev = thread_info->hook; + BOOL prev_unicode = thread_info->hook_unicode; thread_info->hook = info->handle; + thread_info->hook_unicode = info->next_unicode; ret = call_hook_proc( (HOOKPROC)info->proc, info->id, code, wparam, lparam, info->prev_unicode, info->next_unicode ); thread_info->hook = prev; + thread_info->hook_unicode = prev_unicode; } } return ret; @@ -537,12 +540,12 @@ LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lpar info.pid = reply->pid; info.tid = reply->tid; info.proc = reply->proc; - info.prev_unicode = reply->prev_unicode; - info.next_unicode = reply->next_unicode; + info.next_unicode = reply->unicode; } } SERVER_END_REQ; + info.prev_unicode = thread_info->hook_unicode; return call_hook( &info, code, wparam, lparam ); } diff --git a/dlls/user/user_private.h b/dlls/user/user_private.h index 00e9b45d69..332e8f0e8e 100644 --- a/dlls/user/user_private.h +++ b/dlls/user/user_private.h @@ -167,19 +167,21 @@ struct hook16_queue_info; /* no attempt is made to keep the layout compatible with the Windows one */ struct user_thread_info { - HANDLE server_queue; /* 00 Handle to server-side queue */ - DWORD recursion_count; /* 04 SendMessage recursion counter */ - HHOOK hook; /* 08 Current hook */ - struct received_message_info *receive_info; /* 0c Message being currently received */ - struct hook16_queue_info *hook16_info; /* 10 Opaque pointer for 16-bit hook support */ - DWORD GetMessageTimeVal; /* 14 Value for GetMessageTime */ - DWORD GetMessagePosVal; /* 18 Value for GetMessagePos */ - ULONG_PTR GetMessageExtraInfoVal; /* 1c Value for GetMessageExtraInfo */ - HCURSOR cursor; /* 20 Current cursor */ - INT cursor_count; /* 24 Cursor show count */ - UINT active_hooks; /* 28 Bitmap of active hooks */ - HWND desktop; /* 2c Desktop window */ - /* 30-7c Available for more data */ + HANDLE server_queue; /* Handle to server-side queue */ + DWORD recursion_count; /* SendMessage recursion counter */ + BOOL hook_unicode; /* Is current hook unicode? */ + HHOOK hook; /* Current hook */ + struct received_message_info *receive_info; /* Message being currently received */ + struct hook16_queue_info *hook16_info; /* Opaque pointer for 16-bit hook support */ + DWORD GetMessageTimeVal; /* Value for GetMessageTime */ + DWORD GetMessagePosVal; /* Value for GetMessagePos */ + ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */ + HCURSOR cursor; /* Current cursor */ + INT cursor_count; /* Cursor show count */ + UINT active_hooks; /* Bitmap of active hooks */ + HWND desktop; /* Desktop window */ + + ULONG pad[11]; /* Available for more data */ }; static inline struct user_thread_info *get_user_thread_info(void) diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index f88f416f3a..84ad984b9f 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3392,8 +3392,7 @@ struct get_next_hook_reply process_id_t pid; thread_id_t tid; void* proc; - int prev_unicode; - int next_unicode; + int unicode; /* VARARG(module,unicode_str); */ }; @@ -4426,6 +4425,6 @@ union generic_reply struct query_symlink_reply query_symlink_reply; }; -#define SERVER_PROTOCOL_VERSION 252 +#define SERVER_PROTOCOL_VERSION 253 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/server/hook.c b/server/hook.c index b2cb0b8e00..14ad968339 100644 --- a/server/hook.c +++ b/server/hook.c @@ -551,8 +551,7 @@ DECL_HANDLER(get_next_hook) { reply->next = next->handle; reply->id = next->index + WH_MINHOOK; - reply->prev_unicode = hook->unicode; - reply->next_unicode = next->unicode; + reply->unicode = next->unicode; if (next->module) set_reply_data( next->module, next->module_size ); if (run_hook_in_owner_thread( next )) { diff --git a/server/protocol.def b/server/protocol.def index 7934e48bf8..583c757875 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2382,8 +2382,7 @@ enum message_type process_id_t pid; /* process id for low-level keyboard/mouse hooks */ thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */ void* proc; /* next hook procedure */ - int prev_unicode; /* was the previous a unicode hook? */ - int next_unicode; /* is the next a unicode hook? */ + int unicode; /* is it a unicode hook? */ VARARG(module,unicode_str); /* module name */ @END diff --git a/server/trace.c b/server/trace.c index f6aafcb66c..2c5b3e04df 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2967,8 +2967,7 @@ static void dump_get_next_hook_reply( const struct get_next_hook_reply *req ) fprintf( stderr, " pid=%04x,", req->pid ); fprintf( stderr, " tid=%04x,", req->tid ); fprintf( stderr, " proc=%p,", req->proc ); - fprintf( stderr, " prev_unicode=%d,", req->prev_unicode ); - fprintf( stderr, " next_unicode=%d,", req->next_unicode ); + fprintf( stderr, " unicode=%d,", req->unicode ); fprintf( stderr, " module=" ); dump_varargs_unicode_str( cur_size ); }