From 37cc00608361e188866230eabdab0ef661cfaa31 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Thu, 29 Jul 2004 02:44:09 +0000 Subject: [PATCH] Document wrong behaviour for IRunningObjectTable. --- dlls/ole32/moniker.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c index f5cbcaffe92..7612b1ceb46 100644 --- a/dlls/ole32/moniker.c +++ b/dlls/ole32/moniker.c @@ -17,6 +17,14 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * TODO: + * - IRunningObjectTable should work interprocess, but currently doesn't. + * Native (on Win2k at least) uses an undocumented RPC interface, IROT, to + * communicate with RPCSS which contains the table of marshalled data. + * - IRunningObjectTable should use marshalling instead of simple ref + * counting as there is the possibility of using the running object table + * to access objects in other apartments. */ #include @@ -302,9 +310,12 @@ HRESULT WINAPI RunningObjectTableImpl_Register(IRunningObjectTable* iface, return E_OUTOFMEMORY; } /* add a reference to the object in the strong registration case */ - if ((grfFlags & ROTFLAGS_REGISTRATIONKEEPSALIVE) !=0 ) + if ((grfFlags & ROTFLAGS_REGISTRATIONKEEPSALIVE) !=0 ) { + TRACE("strong registration, reffing %p\n", punkObject); + /* this is wrong; we should always add a reference to the object */ IUnknown_AddRef(punkObject); - + } + IMoniker_AddRef(pmkObjectName); return res; @@ -328,9 +339,12 @@ HRESULT WINAPI RunningObjectTableImpl_Revoke( IRunningObjectTable* iface, return E_INVALIDARG; /* release the object if it was registered with a strong registrantion option */ - if ((This->runObjTab[index].regTypeObj & ROTFLAGS_REGISTRATIONKEEPSALIVE)!=0) + if ((This->runObjTab[index].regTypeObj & ROTFLAGS_REGISTRATIONKEEPSALIVE)!=0) { + TRACE("releasing %p\n", This->runObjTab[index].pObj); + /* this is also wrong; we should always release the object (see above) */ IUnknown_Release(This->runObjTab[index].pObj); - + } + IMoniker_Release(This->runObjTab[index].pmkObj); /* remove the object from the table */ @@ -373,8 +387,10 @@ HRESULT WINAPI RunningObjectTableImpl_GetObject( IRunningObjectTable* iface, *ppunkObject=0; /* verify if the object was registered before or not */ - if (RunningObjectTableImpl_GetObjectIndex(This,-1,pmkObjectName,&index)==S_FALSE) + if (RunningObjectTableImpl_GetObjectIndex(This,-1,pmkObjectName,&index)==S_FALSE) { + WARN("Moniker unavailable - needs to work interprocess?\n"); return MK_E_UNAVAILABLE; + } /* add a reference to the object then set output object argument */ IUnknown_AddRef(This->runObjTab[index].pObj); -- 2.11.4.GIT