Commit 514af6ce authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

Move object-to-stub-manager mapping rule to register_ifstub.

parent ef1d367b
...@@ -85,10 +85,10 @@ get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) { ...@@ -85,10 +85,10 @@ get_facbuf_for_iid(REFIID riid,IPSFactoryBuffer **facbuf) {
return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf); return CoGetClassObject(&pxclsid,CLSCTX_INPROC_SERVER,NULL,&IID_IPSFactoryBuffer,(LPVOID*)facbuf);
} }
/* creates a new stub manager and sets stdobjref->oid when stdobjref->oid == 0 */ /* creates a new stub manager */
HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, MSHLFLAGS mshlflags) HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, MSHLFLAGS mshlflags)
{ {
struct stub_manager *manager = NULL; struct stub_manager *manager;
struct ifstub *ifstub; struct ifstub *ifstub;
BOOL tablemarshal; BOOL tablemarshal;
IRpcStubBuffer *stub; IRpcStubBuffer *stub;
...@@ -117,12 +117,8 @@ HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkn ...@@ -117,12 +117,8 @@ HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkn
stdobjref->oxid = apt->oxid; stdobjref->oxid = apt->oxid;
/* mid->oid of zero means create a new stub manager */ if ((manager = get_stub_manager_from_object(apt, obj)))
if (stdobjref->oid && (manager = get_stub_manager(apt, stdobjref->oid)))
{
TRACE("registering new ifstub on pre-existing manager\n"); TRACE("registering new ifstub on pre-existing manager\n");
}
else else
{ {
TRACE("constructing new stub manager\n"); TRACE("constructing new stub manager\n");
...@@ -130,9 +126,8 @@ HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkn ...@@ -130,9 +126,8 @@ HRESULT register_ifstub(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnkn
manager = new_stub_manager(apt, obj); manager = new_stub_manager(apt, obj);
if (!manager) if (!manager)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
stdobjref->oid = manager->oid;
} }
stdobjref->oid = manager->oid;
tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK)); tablemarshal = ((mshlflags & MSHLFLAGS_TABLESTRONG) || (mshlflags & MSHLFLAGS_TABLEWEAK));
...@@ -787,7 +782,6 @@ StdMarshalImpl_MarshalInterface( ...@@ -787,7 +782,6 @@ StdMarshalImpl_MarshalInterface(
IUnknown *pUnk; IUnknown *pUnk;
ULONG res; ULONG res;
HRESULT hres; HRESULT hres;
struct stub_manager *manager;
APARTMENT *apt = COM_CurrentApt(); APARTMENT *apt = COM_CurrentApt();
TRACE("(...,%s,...)\n",debugstr_guid(riid)); TRACE("(...,%s,...)\n",debugstr_guid(riid));
...@@ -809,16 +803,6 @@ StdMarshalImpl_MarshalInterface( ...@@ -809,16 +803,6 @@ StdMarshalImpl_MarshalInterface(
return E_NOINTERFACE; return E_NOINTERFACE;
} }
if ((manager = get_stub_manager_from_object(apt, pUnk)))
{
stdobjref.oid = manager->oid;
stub_manager_int_release(manager);
}
else
{
stdobjref.oid = 0; /* will be set by register_ifstub */
}
hres = register_ifstub(apt, &stdobjref, riid, pUnk, mshlflags); hres = register_ifstub(apt, &stdobjref, riid, pUnk, mshlflags);
IUnknown_Release(pUnk); IUnknown_Release(pUnk);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment