DCOM: Disconnect Proxies at COM Shutdown

Robert Shearman rob at codeweavers.com
Fri Jul 30 07:35:18 CDT 2004


Changelog:

Mike Hearn <mh at codeweavers.com>
Disconnect proxies at COM shutdown to release the corresponding stubs.


-------------- next part --------------
diff -u -N -r -x '*~' -x '.#*' -x CVS -x Makefile -x '*.o' -x '*.orig' -x '*.diff' wine/dlls/ole32_old/compobj.c wine/dlls/ole32/compobj.c
--- wine/dlls/ole32_old/compobj.c	2004-07-30 13:32:03.069303952 +0100
+++ wine/dlls/ole32/compobj.c	2004-07-30 13:32:32.685801560 +0100
@@ -512,6 +512,11 @@
 
     RunningObjectTableImpl_UnInitialize();
 
+    /* destroy proxies to release the corresponding stubs.
+     * FIXME: native version might not do this and we might just be working
+     * around bugs elsewhere. */
+    MARSHAL_Destroy_Proxies();
+
     /* Release the references to the registered class objects */
     COM_RevokeAllClasses();
 
diff -u -N -r -x '*~' -x '.#*' -x CVS -x Makefile -x '*.o' -x '*.orig' -x '*.diff' wine/dlls/ole32_old/compobj_private.h wine/dlls/ole32/compobj_private.h
--- wine/dlls/ole32_old/compobj_private.h	2004-07-30 13:32:03.084301672 +0100
+++ wine/dlls/ole32/compobj_private.h	2004-07-30 13:32:32.694800192 +0100
@@ -148,6 +148,7 @@
 
 HRESULT MARSHAL_Find_Stub_Buffer(wine_marshal_id *mid,IRpcStubBuffer **stub);
 void    MARSHAL_Invalidate_Stub_From_MID(wine_marshal_id *mid);
+HRESULT MARSHAL_Destroy_Proxies();
 
 HRESULT MARSHAL_GetStandardMarshalCF(LPVOID *ppv);
 
diff -u -N -r -x '*~' -x '.#*' -x CVS -x Makefile -x '*.o' -x '*.orig' -x '*.diff' wine/dlls/ole32_old/marshal.c wine/dlls/ole32/marshal.c
--- wine/dlls/ole32_old/marshal.c	2004-07-30 13:32:03.073303344 +0100
+++ wine/dlls/ole32/marshal.c	2004-07-30 13:32:32.692800496 +0100
@@ -188,6 +188,19 @@
 }
 
 HRESULT
+MARSHAL_Destroy_Proxies() {
+    int i;
+
+    TRACE("Disconnecting %d proxies\n", nrofproxies);
+
+    for (i = 0; i < nrofproxies; i++) {
+        IRpcProxyBuffer_Disconnect((IRpcProxyBuffer*)proxies[i].pUnk);
+    }
+    
+    return S_OK;
+}
+
+HRESULT
 MARSHAL_Find_Proxy_Object(wine_marshal_id *mid,LPUNKNOWN *punk) {
     int i;
 
@@ -359,6 +372,9 @@
     FIXME("Failed to create a proxy for %s\n",debugstr_guid(riid));
     return hres;
   }
+
+  MARSHAL_Register_Proxy(&mid, (LPUNKNOWN) rpcproxy);
+
   hres = PIPE_GetNewPipeBuf(&mid,&chanbuf);
   IPSFactoryBuffer_Release(psfacbuf);
   if (hres) {


More information about the wine-patches mailing list