DCOM: Disconnect Proxies at COM Shutdown (Try 2)
Robert Shearman
rob at codeweavers.com
Fri Jul 30 07:40:47 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:37:30.432537176 +0100
@@ -512,6 +512,11 @@
RunningObjectTableImpl_UnInitialize();
+ /* disconnect proxies to release the corresponding stubs.
+ * FIXME: native version might not do this and we might just be working
+ * around bugs elsewhere. */
+ MARSHAL_Disconnect_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:37:30.433537024 +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_Disconnect_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:37:30.434536872 +0100
@@ -188,6 +188,18 @@
}
HRESULT
+MARSHAL_Disconnect_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 +371,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