From d389b571713f7e7f85d514de3f4d8a1d0aaf0d75 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 20 Sep 2005 11:36:40 +0000 Subject: [PATCH] - Fix a trace to refer to the object ID rather than the legacy MID. - Fix the error case of CoMarshalInterThreadInterface to release the stream. --- dlls/ole32/marshal.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/dlls/ole32/marshal.c b/dlls/ole32/marshal.c index 4342c52f67..6b4679d8b5 100644 --- a/dlls/ole32/marshal.c +++ b/dlls/ole32/marshal.c @@ -1110,7 +1110,7 @@ StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm) if (!(stubmgr = get_stub_manager(apt, stdobjref.oid))) { - ERR("could not map MID to stub manager, oxid=%s, oid=%s\n", + ERR("could not map object ID to stub manager, oxid=%s, oid=%s\n", wine_dbgstr_longlong(stdobjref.oxid), wine_dbgstr_longlong(stdobjref.oid)); return RPC_E_INVALID_OBJREF; } @@ -1621,13 +1621,20 @@ HRESULT WINAPI CoMarshalInterThreadInterfaceInStream( TRACE("(%s, %p, %p)\n",debugstr_guid(riid), pUnk, ppStm); - hres = CreateStreamOnHGlobal(0, TRUE, ppStm); + hres = CreateStreamOnHGlobal(NULL, TRUE, ppStm); if (FAILED(hres)) return hres; hres = CoMarshalInterface(*ppStm, riid, pUnk, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); - /* FIXME: is this needed? */ - memset(&seekto,0,sizeof(seekto)); - IStream_Seek(*ppStm,seekto,SEEK_SET,&xpos); + if (SUCCEEDED(hres)) + { + memset(&seekto, 0, sizeof(seekto)); + IStream_Seek(*ppStm, seekto, SEEK_SET, &xpos); + } + else + { + IStream_Release(*ppStm); + *ppStm = NULL; + } return hres; }