atl: Added locking to AtlModuleExtractCreateWndData.

This commit is contained in:
Jacek Caban 2012-12-27 15:19:26 +01:00 committed by Alexandre Julliard
parent dc160df8e9
commit 8dc7a72a14
1 changed files with 9 additions and 4 deletions

View File

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