atl: Implement AtlComPtrAssign.

According to MSDN AtlModuleInit should initialize the modules critical
sections.
This commit is contained in:
Ulrich Czekalla 2005-12-26 12:55:22 +01:00 committed by Alexandre Julliard
parent 4d05f2444a
commit 9da8128e4f
2 changed files with 16 additions and 1 deletions

View File

@ -22,7 +22,7 @@
27 stub AtlHiMetricToPixel
28 stub AtlPixelToHiMetric
29 stub AtlDevModeW2A
30 stub AtlComPtrAssign
30 stdcall AtlComPtrAssign(ptr ptr)
31 stub AtlComQIPtrAssign
32 stdcall AtlInternalQueryInterface(ptr ptr ptr ptr)
34 stub AtlGetVersion

View File

@ -73,6 +73,10 @@ HRESULT WINAPI AtlModuleInit(_ATL_MODULEA* pM, _ATL_OBJMAP_ENTRYA* p, HINSTANCE
pM->m_pObjMap = p;
pM->m_hHeap = GetProcessHeap();
InitializeCriticalSection(&pM->u.m_csTypeInfoHolder);
InitializeCriticalSection(&pM->m_csWindowCreate);
InitializeCriticalSection(&pM->m_csObjMap);
/* call mains */
i = 0;
if (pM->m_pObjMap != NULL && size > ATLVer1Size)
@ -181,6 +185,17 @@ BOOL WINAPI AtlAxWinInit(void)
}
IUnknown* WINAPI AtlComPtrAssign(IUnknown** pp, IUnknown *p)
{
TRACE("(%p %p)\n", pp, p);
if (p) IUnknown_AddRef(p);
if (*pp) IUnknown_Release(*pp);
*pp = p;
return p;
}
HRESULT WINAPI AtlInternalQueryInterface(LPVOID this, const _ATL_INTMAP_ENTRY* pEntries, REFIID iid, LPVOID* ppvObject)
{
int i = 0;