Rename iid in wine_marshal_id to ipid and use IPIDs instead of IIDs in

the stub manager.
This commit is contained in:
Robert Shearman 2005-01-07 15:33:41 +00:00 committed by Alexandre Julliard
parent 090003360f
commit 86d63bbbac
3 changed files with 28 additions and 25 deletions

View File

@ -124,7 +124,7 @@ extern void* StdGlobalInterfaceTableInstance;
typedef struct _wine_marshal_id {
OXID oxid; /* id of apartment */
OID oid; /* id of stub manager */
IID iid; /* id of interface (NOT ifptr) */
IPID ipid; /* id of interface pointer */
} wine_marshal_id;
inline static BOOL
@ -132,7 +132,7 @@ MARSHAL_Compare_Mids(wine_marshal_id *mid1,wine_marshal_id *mid2) {
return
(mid1->oxid == mid2->oxid) &&
(mid1->oid == mid2->oid) &&
IsEqualIID(&(mid1->iid),&(mid2->iid))
IsEqualGUID(&(mid1->ipid),&(mid2->ipid))
;
}
@ -144,7 +144,8 @@ struct ifstub
{
struct list entry;
IRpcStubBuffer *stubbuffer;
IID iid; /* fixme: this should be an IPID not an IID */
IID iid;
IPID ipid;
IUnknown *iface;
BOOL table;
@ -168,11 +169,11 @@ struct stub_manager
struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object);
int stub_manager_ref(struct stub_manager *m, int refs);
int stub_manager_unref(struct stub_manager *m, int refs);
IRpcStubBuffer *stub_manager_iid_to_stubbuffer(struct stub_manager *m, IID *iid);
struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, IID *iid, BOOL tablemarshal);
IRpcStubBuffer *stub_manager_ipid_to_stubbuffer(struct stub_manager *m, IPID *iid);
struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, BOOL tablemarshal);
struct stub_manager *get_stub_manager(OXID oxid, OID oid);
struct stub_manager *get_stub_manager_from_object(OXID oxid, void *object);
void stub_manager_delete_ifstub(struct stub_manager *m, IID *iid); /* fixme: should be ipid */
void stub_manager_delete_ifstub(struct stub_manager *m, IPID *ipid);
IRpcStubBuffer *mid_to_stubbuffer(wine_marshal_id *mid);

View File

@ -91,12 +91,11 @@ IRpcStubBuffer *mid_to_stubbuffer(wine_marshal_id *mid)
return NULL;
}
return stub_manager_iid_to_stubbuffer(m, &mid->iid);
return stub_manager_ipid_to_stubbuffer(m, &mid->ipid);
}
/* fixme: this should return an IPID */
/* creates a new stub manager and sets mid->oid when mid->oid == 0 */
static HRESULT register_ifstub(wine_marshal_id *mid, IUnknown *obj, IRpcStubBuffer *stub, BOOL tablemarshal)
static HRESULT register_ifstub(wine_marshal_id *mid, REFIID riid, IUnknown *obj, IRpcStubBuffer *stub, BOOL tablemarshal)
{
struct stub_manager *manager = NULL;
struct ifstub *ifstub;
@ -123,9 +122,12 @@ static HRESULT register_ifstub(wine_marshal_id *mid, IUnknown *obj, IRpcStubBuff
mid->oid = manager->oid;
}
ifstub = stub_manager_new_ifstub(manager, stub, obj, &mid->iid, tablemarshal);
ifstub = stub_manager_new_ifstub(manager, stub, obj, riid, tablemarshal);
if (!ifstub)
return E_OUTOFMEMORY;
return ifstub ? S_OK : E_OUTOFMEMORY;
mid->ipid = ifstub->ipid;
return S_OK;
}
@ -502,7 +504,6 @@ StdMarshalImpl_MarshalInterface(
/* now fill out the MID */
mid.oxid = COM_CurrentApt()->oxid;
memcpy(&mid.iid,riid,sizeof(mid.iid));
IUnknown_QueryInterface((LPUNKNOWN)pv, riid, (LPVOID*)&pUnk);
@ -515,7 +516,7 @@ StdMarshalImpl_MarshalInterface(
mid.oid = 0; /* will be set by register_ifstub */
}
hres = register_ifstub(&mid, pUnk, stubbuffer, tablemarshal);
hres = register_ifstub(&mid, riid, pUnk, stubbuffer, tablemarshal);
IUnknown_Release(pUnk);
@ -568,7 +569,7 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v
FIXME("table marshalling unimplemented\n");
/* clean up the stubs */
stub_manager_delete_ifstub(stubmgr, &mid.iid);
stub_manager_delete_ifstub(stubmgr, &mid.ipid);
stub_manager_unref(stubmgr, 1);
return hres;
}
@ -587,7 +588,7 @@ StdMarshalImpl_UnmarshalInterface(LPMARSHAL iface, IStream *pStm, REFIID riid, v
if (hres == S_OK)
IUnknown_AddRef((IUnknown *)ifproxy->iface);
else if (hres == E_NOINTERFACE)
hres = proxy_manager_create_ifproxy(proxy_manager, mid.iid /* FIXME: ipid */, riid, 1, &ifproxy);
hres = proxy_manager_create_ifproxy(proxy_manager, mid.ipid, riid, 1, &ifproxy);
if (hres == S_OK)
*ppv = ifproxy->iface; /* AddRef'd above */
@ -618,7 +619,7 @@ StdMarshalImpl_ReleaseMarshalData(LPMARSHAL iface, IStream *pStm) {
/* currently, each marshal has its own interface stub. this might
* not be correct. but, it means we don't need to refcount anything
* here. */
stub_manager_delete_ifstub(stubmgr, &mid.iid);
stub_manager_delete_ifstub(stubmgr, &mid.ipid);
stub_manager_unref(stubmgr, 1);

View File

@ -192,7 +192,7 @@ int stub_manager_unref(struct stub_manager *m, int refs)
return refs;
}
static struct ifstub *stub_manager_iid_to_ifstub(struct stub_manager *m, IID *iid)
static struct ifstub *stub_manager_ipid_to_ifstub(struct stub_manager *m, IPID *ipid)
{
struct list *cursor;
struct ifstub *result = NULL;
@ -202,7 +202,7 @@ static struct ifstub *stub_manager_iid_to_ifstub(struct stub_manager *m, IID *ii
{
struct ifstub *ifstub = LIST_ENTRY( cursor, struct ifstub, entry );
if (IsEqualIID(iid, &ifstub->iid))
if (IsEqualGUID(ipid, &ifstub->ipid))
{
result = ifstub;
break;
@ -213,15 +213,15 @@ static struct ifstub *stub_manager_iid_to_ifstub(struct stub_manager *m, IID *ii
return result;
}
IRpcStubBuffer *stub_manager_iid_to_stubbuffer(struct stub_manager *m, IID *iid)
IRpcStubBuffer *stub_manager_ipid_to_stubbuffer(struct stub_manager *m, IPID *ipid)
{
struct ifstub *ifstub = stub_manager_iid_to_ifstub(m, iid);
struct ifstub *ifstub = stub_manager_ipid_to_ifstub(m, ipid);
return ifstub ? ifstub->stubbuffer : NULL;
}
/* registers a new interface stub COM object with the stub manager and returns registration record */
struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, IID *iid, BOOL tablemarshal)
struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, IUnknown *iptr, REFIID iid, BOOL tablemarshal)
{
struct ifstub *stub;
@ -238,6 +238,7 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
stub->iface = iptr;
stub->table = tablemarshal;
stub->iid = *iid;
stub->ipid = *iid; /* FIXME: should be globally unique */
EnterCriticalSection(&m->lock);
list_add_head(&m->ifstubs, &stub->entry);
@ -247,15 +248,15 @@ struct ifstub *stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *s
}
/* fixme: should ifstubs be refcounted? iid should be ipid */
void stub_manager_delete_ifstub(struct stub_manager *m, IID *iid)
void stub_manager_delete_ifstub(struct stub_manager *m, IPID *ipid)
{
struct ifstub *ifstub;
TRACE("m=%p, m->oid=%s, iid=%s\n", m, wine_dbgstr_longlong(m->oid), debugstr_guid(iid));
TRACE("m=%p, m->oid=%s, ipid=%s\n", m, wine_dbgstr_longlong(m->oid), debugstr_guid(ipid));
EnterCriticalSection(&m->lock);
if ((ifstub = stub_manager_iid_to_ifstub(m, iid)))
if ((ifstub = stub_manager_ipid_to_ifstub(m, ipid)))
{
list_remove(&ifstub->entry);
@ -266,7 +267,7 @@ void stub_manager_delete_ifstub(struct stub_manager *m, IID *iid)
}
else
{
WARN("could not map iid %s to ifstub\n", debugstr_guid(iid));
WARN("could not map ipid %s to ifstub\n", debugstr_guid(ipid));
}
LeaveCriticalSection(&m->lock);