Re: (try 5)[1/4] imm32: Move thread data from TLSEntry to an internal list
Aric Stewart <aric(a)codeweavers.com> writes:
@@ -530,12 +591,18 @@ static BOOL CALLBACK _ImmAssociateContextExEnumProc(HWND hwnd, LPARAM lParam) */ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags) { + IMMThreadData* thread_data = NULL; + TRACE("(%p, %p, 0x%x):\n", hWnd, hIMC, dwFlags);
- if (!IMM_GetThreadData()->defaultContext) - IMM_GetThreadData()->defaultContext = ImmCreateContext(); + thread_data = IMM_GetInitializedThreadData(); + if (!thread_data) + return FALSE;
- if (!hWnd) return FALSE; + LeaveCriticalSection(&threaddata_cs); + + if (!hWnd) + return FALSE;
switch (dwFlags) { @@ -543,7 +610,7 @@ BOOL WINAPI ImmAssociateContextEx(HWND hWnd, HIMC hIMC, DWORD dwFlags) ImmAssociateContext(hWnd,hIMC); return TRUE; case IACE_DEFAULT: - ImmAssociateContext(hWnd,IMM_GetThreadData()->defaultContext); + ImmAssociateContext(hWnd,thread_data->defaultContext); return TRUE; case IACE_IGNORENOCONTEXT: if (GetPropW(hWnd,szwWineIMCProperty))
You shouldn't be accessing thread data outside of the critical section. -- Alexandre Julliard julliard(a)winehq.org
participants (1)
-
Alexandre Julliard