58 ERR(
"couldn't create IPID for stub manager %p\n",
m);
64 ipid->Data2 = (
USHORT)
m->apt->tid;
71 void *dest_context_data, MSHLFLAGS
flags)
82 hr = IUnknown_QueryInterface(
m->object,
iid, (
void **)&
stub->iface);
92 IUnknown_Release(
stub->iface);
98 if (
sb) IRpcStubBuffer_AddRef(
sb);
106 stub->ipid =
m->oxid_info.ipidRemUnknown;
113 if (
flags & MSHLFLAGS_NORMAL)
m->norm_refs++;
127 if (!
m->disconnected)
188 if (!sm)
return NULL;
195 IUnknown_AddRef(
object);
213 sm->
oxid_info.ipidRemUnknown.Data1 = 0xffffffff;
214 sm->
oxid_info.ipidRemUnknown.Data2 = 0xffff;
215 sm->
oxid_info.ipidRemUnknown.Data3 = 0xffff;
230 hres = IUnknown_QueryInterface(
object, &IID_IExternalConnection, (
void**)&sm->
extern_conn);
249 if (!
m->disconnected)
254 m->disconnected =
TRUE;
274 IExternalConnection_Release(
m->extern_conn);
282 IUnknown_Release(
m->object);
286 ERR(
"Got page fault when releasing stub!\n");
305 TRACE(
"before %d\n", refs - 1);
319 TRACE(
"after %d\n", refs);
346 ERR(
"QueryInterface(IID_IUnknown failed): %08x\n",
hres);
355 if (
m->object ==
object)
367 TRACE(
"not found, creating new stub manager...\n");
370 TRACE(
"not found for object %p\n",
object);
373 IUnknown_Release(
object);
410 BOOL first_extern_ref;
415 first_extern_ref =
refs && !
m->extrefs;
419 rc = (
m->extrefs +=
refs);
432 if(first_extern_ref &&
m->extern_conn)
433 IExternalConnection_AddConnection(
m->extern_conn, EXTCONN_STRONG, 0);
441 BOOL last_extern_ref;
448 rc = (
m->extrefs -=
refs);
452 if (!last_unlock_releases)
455 last_extern_ref =
refs && !
m->extrefs;
461 if (last_extern_ref &&
m->extern_conn)
462 IExternalConnection_ReleaseConnection(
m->extern_conn, EXTCONN_STRONG, 0, last_unlock_releases);
465 if (!(
m->extern_conn && last_unlock_releases &&
m->weakrefs))
505 if (ipid->Data2 == 0xffff)
511 TRACE(
"Couldn't find apartment corresponding to TID 0x%04x\n", ipid->Data2);
547 IRpcStubBuffer_AddRef(*
stub);
549 IRpcChannelBuffer_AddRef(*
chan);
582 ERR(
"attempted invalid normal unmarshal, norm_refs is zero\n");
615 return ifstub->
flags & (MSHLFLAGS_TABLESTRONG | MSHLFLAGS_TABLEWEAK);
652 *ppRemUnknown = &
This->IRemUnknown_iface;
664 IRemUnknown_AddRef(iface);
682 TRACE(
"%p before: %d\n", iface, refs-1);
695 TRACE(
"%p after: %d\n", iface, refs);
701 REMQIRESULT **ppQIResults )
705 USHORT successful_qis = 0;
710 void *dest_context_data;
712 TRACE(
"(%p)->(%s, %d, %d, %p, %p)\n",
iface,
debugstr_guid(ripid), cRefs, cIids, iids, ppQIResults);
717 IRpcChannelBuffer_GetDestCtx(
ifstub->
chan, &dest_context, &dest_context_data);
721 for (
i = 0;
i < cIids;
i++)
724 stubmgr->
object, dest_context, dest_context_data, MSHLFLAGS_NORMAL);
727 (*ppQIResults)[
i].hResult = hrobj;
733 if (successful_qis == cIids)
735 else if (successful_qis == 0)
743 REMINTERFACEREF* InterfaceRefs ,
749 TRACE(
"(%p)->(%d, %p, %p)\n",
iface, cInterfaceRefs, InterfaceRefs, pResults);
751 for (
i = 0;
i < cInterfaceRefs;
i++)
757 if (pResults[
i] !=
S_OK)
764 if (InterfaceRefs[
i].cPrivateRefs)
765 FIXME(
"Adding %d refs securely not implemented\n", InterfaceRefs[
i].cPrivateRefs);
776 REMINTERFACEREF* InterfaceRefs )
781 TRACE(
"(%p)->(%d, %p)\n", iface, cInterfaceRefs, InterfaceRefs);
783 for (
i = 0;
i < cInterfaceRefs;
i++)
797 if (InterfaceRefs[
i].cPrivateRefs)
798 FIXME(
"Releasing %d refs securely not implemented\n", InterfaceRefs[
i].cPrivateRefs);
834 IRemUnknown_Release(pRemUnknown);
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
HRESULT RPC_CreateServerChannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan) DECLSPEC_HIDDEN
#define MSHLFLAGSP_REMUNKNOWN
#define DEBUG_SET_CRITSEC_NAME(cs, name)
#define DEBUG_CLEAR_CRITSEC_NAME(cs)
void RPC_UnregisterInterface(REFIID riid, BOOL wait) DECLSPEC_HIDDEN
HRESULT marshal_object(APARTMENT *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *obj, DWORD dest_context, void *dest_context_data, MSHLFLAGS mshlflags) DECLSPEC_HIDDEN
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define HeapFree(x, y, z)
#define __EXCEPT_PAGE_FAULT
DWORD apartment_release(struct apartment *apt)
APARTMENT * apartment_findfromoxid(OXID oxid, BOOL ref)
APARTMENT * apartment_findfromtid(DWORD tid)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
#define memcpy(s1, s2, n)
static const IID IID_IRemUnknown
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define RPC_C_AUTHN_LEVEL_NONE
RPC_STATUS WINAPI UuidCreateNil(UUID *Uuid)
RPC_STATUS WINAPI UuidCreate(UUID *Uuid)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH(cursor, list)
IRpcStubBuffer * stubbuffer
IRemUnknown IRemUnknown_iface
IExternalConnection * extern_conn
static const IRemUnknownVtbl RemUnknown_Vtbl
struct ifstub * stub_manager_new_ifstub(struct stub_manager *m, IRpcStubBuffer *sb, REFIID iid, DWORD dest_context, void *dest_context_data, MSHLFLAGS flags)
struct stub_manager * get_stub_manager(APARTMENT *apt, OID oid)
static void stub_manager_delete_ifstub(struct stub_manager *m, struct ifstub *ifstub)
ULONG stub_manager_ext_release(struct stub_manager *m, ULONG refs, BOOL tableweak, BOOL last_unlock_releases)
ULONG stub_manager_int_release(struct stub_manager *This)
static ULONG stub_manager_int_addref(struct stub_manager *This)
static struct stub_manager * get_stub_manager_from_ipid(APARTMENT *apt, const IPID *ipid, struct ifstub **ifstub)
static HRESULT WINAPI RemUnknown_QueryInterface(IRemUnknown *iface, REFIID riid, void **ppv)
BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid)
static void stub_manager_delete(struct stub_manager *m)
struct stub_manager * get_stub_manager_from_object(APARTMENT *apt, IUnknown *obj, BOOL alloc)
static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface, REFIPID ripid, ULONG cRefs, USHORT cIids, IID *iids, REMQIRESULT **ppQIResults)
static HRESULT generate_ipid(struct stub_manager *m, IPID *ipid)
static struct ifstub * stub_manager_ipid_to_ifstub(struct stub_manager *m, const IPID *ipid)
static HRESULT ipid_to_stub_manager(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stub)
HRESULT ipid_get_dispatch_params(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **manager, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface)
void stub_manager_disconnect(struct stub_manager *m)
BOOL stub_manager_notify_unmarshal(struct stub_manager *m, const IPID *ipid)
static ULONG WINAPI RemUnknown_AddRef(IRemUnknown *iface)
static HRESULT WINAPI RemUnknown_RemRelease(IRemUnknown *iface, USHORT cInterfaceRefs, REMINTERFACEREF *InterfaceRefs)
HRESULT start_apartment_remote_unknown(APARTMENT *apt)
struct ifstub * stub_manager_find_ifstub(struct stub_manager *m, REFIID iid, MSHLFLAGS flags)
struct rem_unknown RemUnknown
void stub_manager_release_marshal_data(struct stub_manager *m, ULONG refs, const IPID *ipid, BOOL tableweak)
static struct stub_manager * new_stub_manager(APARTMENT *apt, IUnknown *object)
static HRESULT RemUnknown_Construct(IRemUnknown **ppRemUnknown)
static RemUnknown * impl_from_IRemUnknown(IRemUnknown *iface)
ULONG stub_manager_ext_addref(struct stub_manager *m, ULONG refs, BOOL tableweak)
static HRESULT ipid_to_ifstub(const IPID *ipid, APARTMENT **stub_apt, struct stub_manager **stubmgr_ret, struct ifstub **ifstub)
static ULONG WINAPI RemUnknown_Release(IRemUnknown *iface)
static HRESULT WINAPI RemUnknown_RemAddRef(IRemUnknown *iface, USHORT cInterfaceRefs, REMINTERFACEREF *InterfaceRefs, HRESULT *pResults)
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
#define CONTAINING_RECORD(address, type, field)
DWORD WINAPI GetCurrentThreadId(void)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
DWORD WINAPI GetCurrentProcessId(void)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
#define RPC_E_INVALID_OBJECT
#define RPC_E_DISCONNECTED