IUnknown isn't a remotable interface so the stub manager shouldn't

need a marshaller for it.
This commit is contained in:
Robert Shearman 2005-06-09 09:45:59 +00:00 committed by Alexandre Julliard
parent 0c5118144a
commit 037bdc0dc0
2 changed files with 24 additions and 16 deletions

View File

@ -90,28 +90,36 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
struct stub_manager *manager;
struct ifstub *ifstub;
BOOL tablemarshal;
IRpcStubBuffer *stub;
IPSFactoryBuffer *psfb;
IRpcStubBuffer *stub = NULL;
HRESULT hr;
hr = apartment_getoxid(apt, &stdobjref->oxid);
if (hr != S_OK)
return hr;
hr = get_facbuf_for_iid(riid, &psfb);
if (hr != S_OK)
/* IUnknown doesn't require a stub buffer, because it never goes out on
* the wire */
if (!IsEqualIID(riid, &IID_IUnknown))
{
ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid));
return hr;
}
IPSFactoryBuffer *psfb;
hr = IPSFactoryBuffer_CreateStub(psfb, riid, obj, &stub);
IPSFactoryBuffer_Release(psfb);
if (hr != S_OK)
{
ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s\n", debugstr_guid(riid));
return hr;
hr = get_facbuf_for_iid(riid, &psfb);
if (hr != S_OK)
{
ERR("couldn't get IPSFactory buffer for interface %s\n", debugstr_guid(riid));
return hr;
}
hr = IPSFactoryBuffer_CreateStub(psfb, riid, obj, &stub);
IPSFactoryBuffer_Release(psfb);
if (hr != S_OK)
{
ERR("Failed to create an IRpcStubBuffer from IPSFactory for %s\n", debugstr_guid(riid));
return hr;
}
}
else /* need to addref object anyway */
IUnknown_AddRef(obj);
if (mshlflags & MSHLFLAGS_NOPING)
stdobjref->flags = SORF_NOPING;
@ -129,7 +137,7 @@ HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkno
manager = new_stub_manager(apt, obj, mshlflags);
if (!manager)
{
IRpcStubBuffer_Release(stub);
if (stub) IRpcStubBuffer_Release(stub);
return E_OUTOFMEMORY;
}
}

View File

@ -409,7 +409,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
if (!stub) return NULL;
stub->stubbuffer = sb;
IUnknown_AddRef(sb);
if (sb) IRpcStubBuffer_AddRef(sb);
/* no need to ref this, same object as sb */
stub->iface = iptr;
@ -446,7 +446,7 @@ static void stub_manager_delete_ifstub(struct stub_manager *m, struct ifstub *if
RPC_UnregisterInterface(&ifstub->iid);
IUnknown_Release(ifstub->stubbuffer);
if (ifstub->stubbuffer) IUnknown_Release(ifstub->stubbuffer);
IUnknown_Release(ifstub->iface);
HeapFree(GetProcessHeap(), 0, ifstub);