Module: wine Branch: master Commit: 8dc7a72a145ba8026c0745f21e8e275675e36e28 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8dc7a72a145ba8026c0745f21e...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Dec 27 15:19:26 2012 +0100
atl: Added locking to AtlModuleExtractCreateWndData.
---
dlls/atl/atl_main.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 41b33ce..5ef083e 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -440,27 +440,32 @@ void WINAPI AtlModuleAddCreateWndData(_ATL_MODULEW *pM, _AtlCreateWndData *pData /*********************************************************************** * AtlModuleExtractCreateWndData [ATL.@] * - * NOTE: I failed to find any good description of this function. - * Tests show that this function extracts one of _AtlCreateWndData + * NOTE: Tests show that this function extracts one of _AtlCreateWndData * records from the current thread from a list * */ void* WINAPI AtlModuleExtractCreateWndData(_ATL_MODULEW *pM) { _AtlCreateWndData **ppData; + void *ret = NULL;
TRACE("(%p)\n", pM);
+ EnterCriticalSection(&pM->m_csWindowCreate); + for(ppData = &pM->m_pCreateWndList; *ppData!=NULL; ppData = &(*ppData)->m_pNext) { if ((*ppData)->m_dwThreadID == GetCurrentThreadId()) { _AtlCreateWndData *pData = *ppData; *ppData = pData->m_pNext; - return pData->m_pThis; + ret = pData->m_pThis; + break; } } - return NULL; + + LeaveCriticalSection(&pM->m_csWindowCreate); + return ret; }
/***********************************************************************