From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winemac.drv/macdrv.h | 4 +--- dlls/winemac.drv/macdrv_main.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 68ab74dc56e..04a8af81c53 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -114,13 +114,11 @@ struct macdrv_thread_data WORD keyc2scan[128]; };
-extern DWORD thread_data_tls_index DECLSPEC_HIDDEN; - extern struct macdrv_thread_data *macdrv_init_thread_data(void) DECLSPEC_HIDDEN;
static inline struct macdrv_thread_data *macdrv_thread_data(void) { - return TlsGetValue(thread_data_tls_index); + return NtUserGetThreadInfo()->driver_data; }
diff --git a/dlls/winemac.drv/macdrv_main.c b/dlls/winemac.drv/macdrv_main.c index 2f05e55cb23..8c101576e99 100644 --- a/dlls/winemac.drv/macdrv_main.c +++ b/dlls/winemac.drv/macdrv_main.c @@ -46,8 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(macdrv);
C_ASSERT(NUM_EVENT_TYPES <= sizeof(macdrv_event_mask) * 8);
-DWORD thread_data_tls_index = TLS_OUT_OF_INDEXES; - int topmost_float_inactive = TOPMOST_FLOAT_INACTIVE_NONFULLSCREEN; int capture_displays_for_fullscreen = 0; BOOL skip_single_buffer_flushes = FALSE; @@ -463,8 +461,6 @@ static BOOL process_attach(void) setup_options(); load_strings(macdrv_module);
- if ((thread_data_tls_index = TlsAlloc()) == TLS_OUT_OF_INDEXES) return FALSE; - macdrv_err_on = ERR_ON(macdrv); if (macdrv_start_cocoa_app(GetTickCount64())) { @@ -493,7 +489,7 @@ void macdrv_ThreadDetach(void) CFRelease(data->keyboard_layout_uchr); HeapFree(GetProcessHeap(), 0, data); /* clear data in case we get re-entered from user32 before the thread is truly dead */ - TlsSetValue(thread_data_tls_index, NULL); + NtUserGetThreadInfo()->driver_data = 0; } }
@@ -556,7 +552,7 @@ struct macdrv_thread_data *macdrv_init_thread_data(void) macdrv_compute_keyboard_layout(data);
set_queue_display_fd(macdrv_get_event_queue_fd(data->queue)); - TlsSetValue(thread_data_tls_index, data); + NtUserGetThreadInfo()->driver_data = data;
NtUserActivateKeyboardLayout(data->active_keyboard_layout, 0); return data;