win32u: Store wmchar_data in ntuser_thread_info.

This commit is contained in:
Jacek Caban 2022-07-29 21:13:39 +02:00 committed by Alexandre Julliard
parent f390b5b884
commit da2c400edc
4 changed files with 7 additions and 7 deletions

View file

@ -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)
{

View file

@ -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 );

View file

@ -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 */

View file

@ -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)