Jacek Caban : ole32: Added IExternalConnection support.

Alexandre Julliard julliard at winehq.org
Thu May 23 14:42:19 CDT 2013


Module: wine
Branch: master
Commit: a30cc75fe08b0d1a35af009fbbdf61fa87b79061
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a30cc75fe08b0d1a35af009fbbdf61fa87b79061

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu May 23 13:21:12 2013 +0200

ole32: Added IExternalConnection support.

---

 dlls/ole32/compobj_private.h |    2 ++
 dlls/ole32/stubmanager.c     |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index f2c9d31..c4379cb 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -98,6 +98,8 @@ struct stub_manager
     ULONG             next_ipid;  /* currently unused (LOCK) */
     OXID_INFO         oxid_info;  /* string binding, ipid of rem unknown and other information (RO) */
 
+    IExternalConnection *extern_conn;
+
     /* We need to keep a count of the outstanding marshals, so we can enforce the
      * marshalling rules (ie, you can only unmarshal normal marshals once). Note
      * that these counts do NOT include unmarshalled interfaces, once a stream is
diff --git a/dlls/ole32/stubmanager.c b/dlls/ole32/stubmanager.c
index e7018b9..822b299 100644
--- a/dlls/ole32/stubmanager.c
+++ b/dlls/ole32/stubmanager.c
@@ -173,6 +173,7 @@ struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHL
 struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object)
 {
     struct stub_manager *sm;
+    HRESULT hres;
 
     assert( apt );
     
@@ -218,6 +219,16 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object)
      */
     sm->extrefs = 0;
 
+    /*
+     * NOTE: According to tests, creating a stub causes two AddConnection calls followed by
+     * one ReleaseConnection call (with fLastReleaseCloses=FALSE).
+     */
+    hres = IUnknown_QueryInterface(object, &IID_IExternalConnection, (void**)&sm->extern_conn);
+    if(SUCCEEDED(hres))
+        IExternalConnection_AddConnection(sm->extern_conn, EXTCONN_STRONG, 0);
+    else
+        sm->extern_conn = NULL;
+
     EnterCriticalSection(&apt->cs);
     sm->oid = apt->oidc++;
     list_add_head(&apt->stubmgrs, &sm->entry);
@@ -242,6 +253,11 @@ static void stub_manager_delete(struct stub_manager *m)
         stub_manager_delete_ifstub(m, ifstub);
     }
 
+    if(m->extern_conn) {
+        IExternalConnection_ReleaseConnection(m->extern_conn, EXTCONN_STRONG, 0, TRUE);
+        IExternalConnection_Release(m->extern_conn);
+    }
+
     CoTaskMemFree(m->oxid_info.psa);
     IUnknown_Release(m->object);
 




More information about the wine-cvs mailing list