[Atl] AtlComPtrAssign

Ulrich Czekalla ulrich.czekalla at utoronto.ca
Thu Dec 22 11:59:45 CST 2005


ChangeLog:
    Ulrich Czekalla <ulrich at codeweavers.com>
    * Implement AtlComPtrAssign
    * According to MSDN AtlModuleInit should initialize the modules critical sections
-------------- next part --------------
---

 dlls/atl/atl.spec   |    2 +-
 dlls/atl/atl_main.c |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)

applies-to: d00c8f5946b7bfa2358c3999de4c63d13df497e2
fe9304942c48dfa242b23b6ec2767b020e06aec4
diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec
index 471a194..9d0b482 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 bcf25f0..77af4e1 100644
--- a/dlls/atl/atl_main.c
+++ b/dlls/atl/atl_main.c
@@ -73,6 +73,10 @@ HRESULT WINAPI AtlModuleInit(_ATL_MODULE
     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,27 @@ BOOL WINAPI AtlAxWinInit(void)
 }
 
 
+IUnknown* AtlComPtrAssign(IUnknown** pp, IUnknown *p)
+{
+    TRACE("(%p %p)\n", pp, p);
+
+    if (*pp)
+    {
+        IUnknown_Release(*pp);
+        *pp = NULL;
+    }
+
+    if (p)
+    {
+        IUnknown_AddRef(p);
+        *pp = p;
+    }
+
+    return p;
+}
+
+
+
 HRESULT WINAPI AtlInternalQueryInterface(LPVOID this, const _ATL_INTMAP_ENTRY* pEntries,  REFIID iid, LPVOID* ppvObject)
 {
     int i = 0;
---
0.99.9i


More information about the wine-patches mailing list