ole32: Added IExternalConnection support.

This commit is contained in:
Jacek Caban 2013-05-23 13:21:12 +02:00 committed by Alexandre Julliard
parent 889112a29a
commit a30cc75fe0
2 changed files with 18 additions and 0 deletions

View File

@ -98,6 +98,8 @@ struct stub_manager
ULONG next_ipid; /* currently unused (LOCK) */
OXID_INFO oxid_info; /* string binding, ipid of rem unknown and other information (RO) */
IExternalConnection *extern_conn;
/* We need to keep a count of the outstanding marshals, so we can enforce the
* marshalling rules (ie, you can only unmarshal normal marshals once). Note
* that these counts do NOT include unmarshalled interfaces, once a stream is

View File

@ -173,6 +173,7 @@ struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHL
struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object)
{
struct stub_manager *sm;
HRESULT hres;
assert( apt );
@ -218,6 +219,16 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object)
*/
sm->extrefs = 0;
/*
* NOTE: According to tests, creating a stub causes two AddConnection calls followed by
* one ReleaseConnection call (with fLastReleaseCloses=FALSE).
*/
hres = IUnknown_QueryInterface(object, &IID_IExternalConnection, (void**)&sm->extern_conn);
if(SUCCEEDED(hres))
IExternalConnection_AddConnection(sm->extern_conn, EXTCONN_STRONG, 0);
else
sm->extern_conn = NULL;
EnterCriticalSection(&apt->cs);
sm->oid = apt->oidc++;
list_add_head(&apt->stubmgrs, &sm->entry);
@ -242,6 +253,11 @@ static void stub_manager_delete(struct stub_manager *m)
stub_manager_delete_ifstub(m, ifstub);
}
if(m->extern_conn) {
IExternalConnection_ReleaseConnection(m->extern_conn, EXTCONN_STRONG, 0, TRUE);
IExternalConnection_Release(m->extern_conn);
}
CoTaskMemFree(m->oxid_info.psa);
IUnknown_Release(m->object);