user32: Store current spy indent in user_thread_info struct.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-03-21 14:14:39 +01:00 committed by Alexandre Julliard
parent 0b87623819
commit 65fe0f6521
2 changed files with 3 additions and 11 deletions

View File

@ -2028,14 +2028,12 @@ typedef struct
WCHAR wnd_name[16]; /* window name for message */
} SPY_INSTANCE;
static LONG indent_tls_index = TLS_OUT_OF_INDEXES;
/***********************************************************************
* get_indent_level
*/
static inline INT_PTR get_indent_level(void)
{
return (INT_PTR)TlsGetValue( indent_tls_index );
return get_user_thread_info()->spy_indent;
}
@ -2044,7 +2042,7 @@ static inline INT_PTR get_indent_level(void)
*/
static inline void set_indent_level( INT_PTR level )
{
TlsSetValue( indent_tls_index, (void *)level );
get_user_thread_info()->spy_indent = level;
}
@ -2539,13 +2537,6 @@ static BOOL spy_init(void)
if (!TRACE_ON(message)) return FALSE;
if (indent_tls_index == TLS_OUT_OF_INDEXES)
{
DWORD index = TlsAlloc();
if (InterlockedCompareExchange( &indent_tls_index, index, TLS_OUT_OF_INDEXES ) != TLS_OUT_OF_INDEXES)
TlsFree( index );
}
if (spy_exclude) return TRUE;
exclude = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, SPY_MAX_MSGNUM + 2 );

View File

@ -159,6 +159,7 @@ struct user_thread_info
HWND top_window; /* Desktop window */
HWND msg_window; /* HWND_MESSAGE parent window */
struct rawinput_thread_data *rawinput; /* RawInput thread local data / buffer */
UINT spy_indent; /* Current spy indent */
};
C_ASSERT( sizeof(struct user_thread_info) <= sizeof(((TEB *)0)->Win32ClientInfo) );