Module: wine Branch: master Commit: da2c400edcf2d552b06369143103d20fcb3cddb3 URL: https://gitlab.winehq.org/wine/wine/-/commit/da2c400edcf2d552b06369143103d20...
Author: Jacek Caban jacek@codeweavers.com Date: Fri Jul 29 21:13:39 2022 +0200
win32u: Store wmchar_data in ntuser_thread_info.
---
dlls/user32/message.c | 10 +++++----- dlls/user32/user_main.c | 2 +- dlls/win32u/ntuser_private.h | 1 - include/ntuser.h | 1 + 4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 42cab89da05..d1a211bb281 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -63,7 +63,7 @@ static inline void *unpack_ptr( ULONGLONG ptr64 ) /* check for pending WM_CHAR message with DBCS trailing byte */ static inline BOOL get_pending_wmchar( MSG *msg, UINT first, UINT last, BOOL remove ) { - struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data; + struct wm_char_mapping_data *data = NtUserGetThreadInfo()->wmchar_data;
if (!data || !data->get_msg.message) return FALSE; if ((first || last) && (first > WM_CHAR || last < WM_CHAR)) return FALSE; @@ -119,7 +119,7 @@ BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping */ if (mapping != WMCHAR_MAP_NOMAPPING) { - struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data; + struct wm_char_mapping_data *data = NtUserGetThreadInfo()->wmchar_data; BYTE low = LOBYTE(*wparam); cp = get_input_codepage();
@@ -152,7 +152,7 @@ BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping { if (!(data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data) ))) return FALSE; - get_user_thread_info()->wmchar_data = data; + NtUserGetThreadInfo()->wmchar_data = data; } TRACE( "storing lead byte %02x mapping %u\n", low, mapping ); data->lead_byte[mapping] = low; @@ -210,11 +210,11 @@ static void map_wparam_WtoA( MSG *msg, BOOL remove ) len = WideCharToMultiByte( cp, 0, wch, 1, (LPSTR)ch, 2, NULL, NULL ); if (len == 2) /* DBCS char */ { - struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data; + struct wm_char_mapping_data *data = NtUserGetThreadInfo()->wmchar_data; if (!data) { if (!(data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data) ))) return; - get_user_thread_info()->wmchar_data = data; + NtUserGetThreadInfo()->wmchar_data = data; } if (remove) { diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 269fdede708..139d9b5f46e 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -233,7 +233,7 @@ static BOOL process_attach(void) */ static void thread_detach(void) { - struct user_thread_info *thread_info = get_user_thread_info(); + struct ntuser_thread_info *thread_info = NtUserGetThreadInfo();
NtUserCallNoParam( NtUserExitingThread );
diff --git a/dlls/win32u/ntuser_private.h b/dlls/win32u/ntuser_private.h index b048d194a4e..c62bb0d457f 100644 --- a/dlls/win32u/ntuser_private.h +++ b/dlls/win32u/ntuser_private.h @@ -131,7 +131,6 @@ struct user_thread_info UINT active_hooks; /* Bitmap of active hooks */ INPUT_MESSAGE_SOURCE msg_source; /* Message source for current message */ struct received_message_info *receive_info; /* Message being currently received */ - struct wm_char_mapping_data *wmchar_data; /* Data for WM_CHAR mappings */ struct user_key_state_info *key_state; /* Cache of global key state */ struct imm_thread_data *imm_thread_data; /* IMM thread data */ HKL kbd_layout; /* Current keyboard layout */ diff --git a/include/ntuser.h b/include/ntuser.h index b36b630ce7f..ec6f58a2f2e 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -70,6 +70,7 @@ struct ntuser_thread_info DPI_AWARENESS dpi_awareness; /* DPI awareness */ HIMC default_imc; /* default input context */ void *client_imm; /* client IMM thread info */ + struct wm_char_mapping_data *wmchar_data; /* Data for WM_CHAR mappings */ };
static inline struct ntuser_thread_info *NtUserGetThreadInfo(void)