From 9da8128e4f3e0a340752053c03efda749b4126b4 Mon Sep 17 00:00:00 2001 From: Ulrich Czekalla Date: Mon, 26 Dec 2005 12:55:22 +0100 Subject: [PATCH] atl: Implement AtlComPtrAssign. According to MSDN AtlModuleInit should initialize the modules critical sections. --- dlls/atl/atl.spec | 2 +- dlls/atl/atl_main.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index 471a1946a82..9d0b48253dd 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -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 diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index bcf25f04e48..a620f9e0844 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -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;