user32: Store the prev_unicode hook flag on the client side.

This commit is contained in:
Alexandre Julliard 2006-10-05 14:04:25 +02:00
parent ffa4e572ee
commit 533f519950
6 changed files with 25 additions and 24 deletions

View File

@ -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(); struct user_thread_info *thread_info = get_user_thread_info();
HHOOK prev = thread_info->hook; HHOOK prev = thread_info->hook;
BOOL prev_unicode = thread_info->hook_unicode;
thread_info->hook = info->handle; thread_info->hook = info->handle;
thread_info->hook_unicode = info->next_unicode;
ret = call_hook_proc( (HOOKPROC)info->proc, info->id, code, wparam, lparam, ret = call_hook_proc( (HOOKPROC)info->proc, info->id, code, wparam, lparam,
info->prev_unicode, info->next_unicode ); info->prev_unicode, info->next_unicode );
thread_info->hook = prev; thread_info->hook = prev;
thread_info->hook_unicode = prev_unicode;
} }
} }
return ret; return ret;
@ -537,12 +540,12 @@ LRESULT WINAPI CallNextHookEx( HHOOK hhook, INT code, WPARAM wparam, LPARAM lpar
info.pid = reply->pid; info.pid = reply->pid;
info.tid = reply->tid; info.tid = reply->tid;
info.proc = reply->proc; info.proc = reply->proc;
info.prev_unicode = reply->prev_unicode; info.next_unicode = reply->unicode;
info.next_unicode = reply->next_unicode;
} }
} }
SERVER_END_REQ; SERVER_END_REQ;
info.prev_unicode = thread_info->hook_unicode;
return call_hook( &info, code, wparam, lparam ); return call_hook( &info, code, wparam, lparam );
} }

View File

@ -167,19 +167,21 @@ struct hook16_queue_info;
/* no attempt is made to keep the layout compatible with the Windows one */ /* no attempt is made to keep the layout compatible with the Windows one */
struct user_thread_info struct user_thread_info
{ {
HANDLE server_queue; /* 00 Handle to server-side queue */ HANDLE server_queue; /* Handle to server-side queue */
DWORD recursion_count; /* 04 SendMessage recursion counter */ DWORD recursion_count; /* SendMessage recursion counter */
HHOOK hook; /* 08 Current hook */ BOOL hook_unicode; /* Is current hook unicode? */
struct received_message_info *receive_info; /* 0c Message being currently received */ HHOOK hook; /* Current hook */
struct hook16_queue_info *hook16_info; /* 10 Opaque pointer for 16-bit hook support */ struct received_message_info *receive_info; /* Message being currently received */
DWORD GetMessageTimeVal; /* 14 Value for GetMessageTime */ struct hook16_queue_info *hook16_info; /* Opaque pointer for 16-bit hook support */
DWORD GetMessagePosVal; /* 18 Value for GetMessagePos */ DWORD GetMessageTimeVal; /* Value for GetMessageTime */
ULONG_PTR GetMessageExtraInfoVal; /* 1c Value for GetMessageExtraInfo */ DWORD GetMessagePosVal; /* Value for GetMessagePos */
HCURSOR cursor; /* 20 Current cursor */ ULONG_PTR GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
INT cursor_count; /* 24 Cursor show count */ HCURSOR cursor; /* Current cursor */
UINT active_hooks; /* 28 Bitmap of active hooks */ INT cursor_count; /* Cursor show count */
HWND desktop; /* 2c Desktop window */ UINT active_hooks; /* Bitmap of active hooks */
/* 30-7c Available for more data */ HWND desktop; /* Desktop window */
ULONG pad[11]; /* Available for more data */
}; };
static inline struct user_thread_info *get_user_thread_info(void) static inline struct user_thread_info *get_user_thread_info(void)

View File

@ -3392,8 +3392,7 @@ struct get_next_hook_reply
process_id_t pid; process_id_t pid;
thread_id_t tid; thread_id_t tid;
void* proc; void* proc;
int prev_unicode; int unicode;
int next_unicode;
/* VARARG(module,unicode_str); */ /* VARARG(module,unicode_str); */
}; };
@ -4426,6 +4425,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply; struct query_symlink_reply query_symlink_reply;
}; };
#define SERVER_PROTOCOL_VERSION 252 #define SERVER_PROTOCOL_VERSION 253
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */ #endif /* __WINE_WINE_SERVER_PROTOCOL_H */

View File

@ -551,8 +551,7 @@ DECL_HANDLER(get_next_hook)
{ {
reply->next = next->handle; reply->next = next->handle;
reply->id = next->index + WH_MINHOOK; reply->id = next->index + WH_MINHOOK;
reply->prev_unicode = hook->unicode; reply->unicode = next->unicode;
reply->next_unicode = next->unicode;
if (next->module) set_reply_data( next->module, next->module_size ); if (next->module) set_reply_data( next->module, next->module_size );
if (run_hook_in_owner_thread( next )) if (run_hook_in_owner_thread( next ))
{ {

View File

@ -2382,8 +2382,7 @@ enum message_type
process_id_t pid; /* process id for low-level keyboard/mouse hooks */ process_id_t pid; /* process id for low-level keyboard/mouse hooks */
thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */ thread_id_t tid; /* thread id for low-level keyboard/mouse hooks */
void* proc; /* next hook procedure */ void* proc; /* next hook procedure */
int prev_unicode; /* was the previous a unicode hook? */ int unicode; /* is it a unicode hook? */
int next_unicode; /* is the next a unicode hook? */
VARARG(module,unicode_str); /* module name */ VARARG(module,unicode_str); /* module name */
@END @END

View File

@ -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, " pid=%04x,", req->pid );
fprintf( stderr, " tid=%04x,", req->tid ); fprintf( stderr, " tid=%04x,", req->tid );
fprintf( stderr, " proc=%p,", req->proc ); fprintf( stderr, " proc=%p,", req->proc );
fprintf( stderr, " prev_unicode=%d,", req->prev_unicode ); fprintf( stderr, " unicode=%d,", req->unicode );
fprintf( stderr, " next_unicode=%d,", req->next_unicode );
fprintf( stderr, " module=" ); fprintf( stderr, " module=" );
dump_varargs_unicode_str( cur_size ); dump_varargs_unicode_str( cur_size );
} }