Commit a30cc75f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ole32: Added IExternalConnection support.

parent 889112a2
...@@ -98,6 +98,8 @@ struct stub_manager ...@@ -98,6 +98,8 @@ struct stub_manager
ULONG next_ipid; /* currently unused (LOCK) */ ULONG next_ipid; /* currently unused (LOCK) */
OXID_INFO oxid_info; /* string binding, ipid of rem unknown and other information (RO) */ 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 /* 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 * marshalling rules (ie, you can only unmarshal normal marshals once). Note
* that these counts do NOT include unmarshalled interfaces, once a stream is * that these counts do NOT include unmarshalled interfaces, once a stream is
......
...@@ -173,6 +173,7 @@ struct ifstub *stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHL ...@@ -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 *new_stub_manager(APARTMENT *apt, IUnknown *object)
{ {
struct stub_manager *sm; struct stub_manager *sm;
HRESULT hres;
assert( apt ); assert( apt );
...@@ -218,6 +219,16 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object) ...@@ -218,6 +219,16 @@ struct stub_manager *new_stub_manager(APARTMENT *apt, IUnknown *object)
*/ */
sm->extrefs = 0; 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); EnterCriticalSection(&apt->cs);
sm->oid = apt->oidc++; sm->oid = apt->oidc++;
list_add_head(&apt->stubmgrs, &sm->entry); list_add_head(&apt->stubmgrs, &sm->entry);
...@@ -242,6 +253,11 @@ static void stub_manager_delete(struct stub_manager *m) ...@@ -242,6 +253,11 @@ static void stub_manager_delete(struct stub_manager *m)
stub_manager_delete_ifstub(m, ifstub); 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); CoTaskMemFree(m->oxid_info.psa);
IUnknown_Release(m->object); IUnknown_Release(m->object);
......
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