59 ERR(
"couldn't create IPID for stub manager %p\n",
m);
65 ipid->Data2 = !
m->apt->multi_threaded ? (
USHORT)
m->apt->tid : 0;
72 void *dest_context_data, MSHLFLAGS
flags)
83 hr = IUnknown_QueryInterface(
m->object,
iid, (
void **)&
stub->iface);
93 IUnknown_Release(
stub->iface);
99 if (
sb) IRpcStubBuffer_AddRef(
sb);
107 stub->ipid =
m->oxid_info.ipidRemUnknown;
114 if (
flags & MSHLFLAGS_NORMAL)
m->norm_refs++;
128 if (!
m->disconnected)
186 if (!sm)
return NULL;
193 IUnknown_AddRef(
object);
211 sm->
oxid_info.ipidRemUnknown.Data1 = 0xffffffff;
212 sm->
oxid_info.ipidRemUnknown.Data2 = 0xffff;
213 sm->
oxid_info.ipidRemUnknown.Data3 = 0xffff;
228 hres = IUnknown_QueryInterface(
object, &IID_IExternalConnection, (
void**)&sm->
extern_conn);
247 if (!
m->disconnected)
252 m->disconnected =
TRUE;
272 IExternalConnection_Release(
m->extern_conn);
280 IUnknown_Release(
m->object);
284 ERR(
"Got page fault when releasing stub!\n");
288 m->lock.DebugInfo->Spare[0] = 0;
303 TRACE(
"before %ld\n", refs - 1);
344 ERR(
"QueryInterface(IID_IUnknown failed): %#lx\n",
hres);
351 if (
m->object ==
object)
366 TRACE(
"not found, creating new stub manager...\n");
371 TRACE(
"not found for object %p\n",
object);
374 IUnknown_Release(
object);
408 BOOL first_extern_ref;
413 first_extern_ref =
refs && !
m->extrefs;
417 rc = (
m->extrefs +=
refs);
430 if(first_extern_ref &&
m->extern_conn)
431 IExternalConnection_AddConnection(
m->extern_conn, EXTCONN_STRONG, 0);
439 BOOL last_extern_ref;
446 rc = (
m->extrefs -=
refs);
450 if (!last_unlock_releases)
453 last_extern_ref =
refs && !
m->extrefs;
459 if (last_extern_ref &&
m->extern_conn)
460 IExternalConnection_ReleaseConnection(
m->extern_conn, EXTCONN_STRONG, 0, last_unlock_releases);
463 if (!(
m->extern_conn && last_unlock_releases &&
m->weakrefs))
500 if (ipid->Data2 == 0xffff)
508 TRACE(
"Couldn't find apartment corresponding to TID 0x%04x, PID 0x%04x\n", ipid->Data2, ipid->Data3);
543 IRpcStubBuffer_AddRef(*
stub);
545 IRpcChannelBuffer_AddRef(*chan);
573 *dest_context_data =
data;
603 ERR(
"attempted invalid normal unmarshal, norm_refs is zero\n");
636 return ifstub->
flags & (MSHLFLAGS_TABLESTRONG | MSHLFLAGS_TABLEWEAK);
672 *ppRemUnknown = &
object->IRemUnknown_iface;
684 IRemUnknown_AddRef(iface);
702 TRACE(
"%p before: %ld\n", iface, refs-1);
715 TRACE(
"%p after: %ld\n", iface, refs);
721 REMQIRESULT **ppQIResults )
725 USHORT successful_qis = 0;
730 void *dest_context_data;
732 TRACE(
"%p, %s, %ld, %d, %p, %p.\n",
iface,
debugstr_guid(ripid), cRefs, cIids, iids, ppQIResults);
737 IRpcChannelBuffer_GetDestCtx(
ifstub->
chan, &dest_context, &dest_context_data);
741 for (
i = 0;
i < cIids;
i++)
744 stubmgr->
object, dest_context, dest_context_data, MSHLFLAGS_NORMAL);
747 (*ppQIResults)[
i].hResult = hrobj;
753 if (successful_qis == cIids)
755 else if (successful_qis == 0)
763 REMINTERFACEREF* InterfaceRefs ,
769 TRACE(
"%p, %d, %p, %p\n",
iface, cInterfaceRefs, InterfaceRefs, pResults);
771 for (
i = 0;
i < cInterfaceRefs;
i++)
777 if (pResults[
i] !=
S_OK)
784 if (InterfaceRefs[
i].cPrivateRefs)
785 FIXME(
"Adding %ld refs securely not implemented\n", InterfaceRefs[
i].cPrivateRefs);
796 REMINTERFACEREF* InterfaceRefs )
801 TRACE(
"%p, %d, %p\n", iface, cInterfaceRefs, InterfaceRefs);
803 for (
i = 0;
i < cInterfaceRefs;
i++)
817 if (InterfaceRefs[
i].cPrivateRefs)
818 FIXME(
"Releasing %ld refs securely not implemented\n", InterfaceRefs[
i].cPrivateRefs);
844 if (!
apt->remunk_exported)
855 IRemUnknown_Release(pRemUnknown);
struct apartment * apartment_get_mta(void)
void apartment_release(struct apartment *apt)
struct apartment * apartment_findfromtid(DWORD tid)
struct apartment * apartment_findfromoxid(OXID oxid)
#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)
#define MSHLFLAGSP_REMUNKNOWN
void rpc_unregister_interface(REFIID riid, BOOL wait)
HRESULT marshal_object(struct apartment *apt, STDOBJREF *stdobjref, REFIID riid, IUnknown *object, DWORD dest_context, void *dest_context_data, MSHLFLAGS mshlflags)
HRESULT rpc_create_serverchannel(DWORD dest_context, void *dest_context_data, IRpcChannelBuffer **chan)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
#define __EXCEPT_PAGE_FAULT
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
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 CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
#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)
PRTL_CRITICAL_SECTION_DEBUG DebugInfo
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)
HRESULT ipid_get_dispatch_params(const IPID *ipid, struct apartment **stub_apt, struct stub_manager **manager, IRpcStubBuffer **stub, IRpcChannelBuffer **chan, IID *iid, IUnknown **iface)
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)
static HRESULT WINAPI RemUnknown_QueryInterface(IRemUnknown *iface, REFIID riid, void **ppv)
static struct stub_manager * new_stub_manager(struct apartment *apt, IUnknown *object)
BOOL stub_manager_is_table_marshaled(struct stub_manager *m, const IPID *ipid)
static void stub_manager_delete(struct stub_manager *m)
ULONG stub_manager_int_release(struct stub_manager *m)
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_ifstub(const IPID *ipid, struct apartment **stub_apt, struct stub_manager **stubmgr_ret, struct ifstub **ifstub)
static ULONG stub_manager_int_addref(struct stub_manager *m)
struct stub_manager * get_stub_manager(struct apartment *apt, OID oid)
struct stub_manager * get_stub_manager_from_object(struct apartment *apt, IUnknown *obj, BOOL alloc)
HRESULT ipid_get_dest_context(const IPID *ipid, MSHCTX *dest_context, void **dest_context_data)
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)
static struct stub_manager * get_stub_manager_from_ipid(struct apartment *apt, const IPID *ipid, struct ifstub **ifstub)
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)
HRESULT start_apartment_remote_unknown(struct apartment *apt)
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_stub_manager(const IPID *ipid, struct apartment **stub_apt, struct stub_manager **stub)
static ULONG WINAPI RemUnknown_Release(IRemUnknown *iface)
static HRESULT WINAPI RemUnknown_RemAddRef(IRemUnknown *iface, USHORT cInterfaceRefs, REMINTERFACEREF *InterfaceRefs, HRESULT *pResults)
#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
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO