41#define STUB_HEADER(This) (((const CInterfaceStubHeader*)((This)->lpVtbl))[-1])
59 LPPSFACTORYBUFFER pPSFactory,
65 TRACE(
"(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub,
name);
70 ERR(
"IID mismatch during stub creation\n");
74 r = IUnknown_QueryInterface(pUnkServer,
riid, (
void**)&pvServer);
80 IUnknown_Release(pvServer);
86 This->pvServerObject = pvServer;
87 This->pPSFactory = pPSFactory;
90 IPSFactoryBuffer_AddRef(pPSFactory);
99 0, 0, { (
DWORD_PTR)(__FILE__
": delegating_vtbl_section") }
149static const BYTE opcodes[20] = { 0x8b, 0x44, 0x24, 0x04, 0x8b, 0x40, 0x10, 0x89, 0x44, 0x24, 0x04,
150 0x8b, 0x00, 0xff, 0xa0, 0, 0, 0, 0, 0x90 };
152#elif defined(__x86_64__)
165static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01,
166 0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 };
167#elif defined(__arm__)
186#elif defined(__aarch64__)
205#warning You must implement delegated proxies/stubs for your CPU
214#define BLOCK_SIZE 1024
246 const void **
entry = (
const void **)(vtbl + 1);
251 FIXME(
"%u methods not supported\n",
num );
268 const void **
entry = (
const void **)(vtbl + 1);
273 FIXME(
"%u methods not supported\n",
num );
293 if (num_methods < 256) num_methods = 256;
308 table->size = num_methods;
313 TRACE(
"freeing old table\n");
334 TRACE(
"... and we're not current so free'ing\n");
345 LPPSFACTORYBUFFER pPSFactory,
352 TRACE(
"(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub,
name);
358 ERR(
"IID mismatch during stub creation\n");
362 r = IUnknown_QueryInterface(pUnkServer,
riid, (
void**)&pvServer);
368 IUnknown_Release(pvServer);
378 IUnknown_Release(pvServer);
382 This->stub_buffer.lpVtbl = &vtbl->
Vtbl;
383 This->stub_buffer.RefCount = 1;
384 This->stub_buffer.pvServerObject = pvServer;
385 This->stub_buffer.pPSFactory = pPSFactory;
388 IPSFactoryBuffer_AddRef(pPSFactory);
402 IRpcStubBuffer_AddRef(iface);
418 LPPSFACTORYBUFFER pPSF)
430 IRpcStubBuffer_Disconnect(iface);
432 IPSFactoryBuffer_Release(pPSF);
439 LPPSFACTORYBUFFER pPSF)
453 IRpcStubBuffer_Release(
This->base_stub);
456 IPSFactoryBuffer_Release(pPSF);
470 TRACE(
"(%p)->Connect(%p)\n",
This,lpUnkServer);
472 r = IUnknown_QueryInterface(lpUnkServer,
STUB_HEADER(
This).piid, (
void**)&
new);
475 IUnknown_Release(
new);
488 IUnknown_Release(old);
499 TRACE(
"(%p)->Invoke(%p,%p)\n",
This,pMsg,pChannel);
511 WARN(
"a stub call failed with exception 0x%08x (%d)\n", dwExceptionCode, dwExceptionCode);
512 if (
FAILED(dwExceptionCode))
513 hr = dwExceptionCode;
534 return This->RefCount;
541 TRACE(
"(%p)->DebugServerQueryInterface(%p)\n",
This,
ppv);
549 TRACE(
"(%p)->DebugServerRelease(%p)\n",
This,pv);
571 TRACE(
"(%p)->Connect(%p)\n",
This, lpUnkServer);
585 IRpcStubBuffer_Disconnect(
This->base_stub);
596 ret += IRpcStubBuffer_CountRefs(
This->base_stub);
630 HRESULT r = IRpcStubBuffer_Invoke(
This->base_stub, (RPCOLEMESSAGE*)pMsg, pChannel);
643 TRACE(
"(%p,%p,%p,%p)\n", pRpcMsg, pStubMsg, pStubDescriptor, pRpcChannelBuffer);
661 TRACE(
"(%p, %p, %p)\n",
This, pRpcChannelBuffer, pStubMsg);
664 hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer,
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface)
ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface)
HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj)
HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub) DECLSPEC_HIDDEN
#define HeapFree(x, y, z)
static const BYTE opcodes[1]
#define STUB_HEADER(This)
static void WINAPI CStdStubBuffer_Delegating_Disconnect(LPRPCSTUBBUFFER iface)
static CRITICAL_SECTION delegating_vtbl_section
const MIDL_SERVER_INFO * CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface)
static const vtbl_method_t * method_blocks[MAX_BLOCKS]
ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface)
void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface, LPVOID pv)
HRESULT WINAPI CStdStubBuffer_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *obj)
static HRESULT WINAPI delegating_QueryInterface(IUnknown *pUnk, REFIID iid, void **ppv)
HRESULT CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl
ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface)
static CRITICAL_SECTION_DEBUG critsect_debug
static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num)
BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num)
HRESULT CStdStubBuffer_Delegating_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, REFIID delegating_iid, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
static ULONG WINAPI delegating_Release(IUnknown *pUnk)
void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, LPRPCCHANNELBUFFER pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg)
static ULONG WINAPI delegating_AddRef(IUnknown *pUnk)
static const vtbl_method_t * allocate_block(unsigned int num)
void __RPC_STUB NdrStubForwardingFunction(IRpcStubBuffer *iface, IRpcChannelBuffer *pChannel, PRPC_MESSAGE pMsg, DWORD *pdwStubPhase)
void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, LPRPCCHANNELBUFFER pRpcChannelBuffer)
void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface)
static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs(LPRPCSTUBBUFFER iface)
static HRESULT WINAPI CStdStubBuffer_Delegating_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported(LPRPCSTUBBUFFER iface, REFIID riid)
const IRpcStubBufferVtbl CStdStubBuffer_Vtbl
static ref_counted_vtbl * current_vtbl
void release_delegating_vtbl(IUnknownVtbl *vtbl)
IUnknownVtbl * get_delegating_vtbl(DWORD num_methods)
HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface, PRPCOLEMESSAGE pMsg, LPRPCCHANNELBUFFER pChannel)
static LONG WINAPI stub_filter(EXCEPTION_POINTERS *eptr)
static cstdstubbuffer_delegating_t * impl_from_delegating(IRpcStubBuffer *iface)
ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(LPRPCSTUBBUFFER iface, LPVOID *ppv)
ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
#define InterlockedExchangePointer(Target, Value)
GLdouble GLdouble GLdouble r
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
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 GLint GLint j
#define EXCEPTION_EXECUTE_HANDLER
#define EXCEPTION_CONTINUE_SEARCH
#define InterlockedCompareExchangePointer
#define memcpy(s1, s2, n)
unsigned char *WINAPI NdrServerInitializeNew(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc)
LONG WINAPI NdrStubCall2(struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg, DWORD *pdwStubPhase)
#define PAGE_EXECUTE_READ
#define PAGE_EXECUTE_READWRITE
interface IRpcStubBuffer * LPRPCSTUBBUFFER
interface IRpcChannelBuffer * LPRPCCHANNELBUFFER
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
struct _RPC_MESSAGE * PRPC_MESSAGE
const char * PCInterfaceName
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
LIST_ENTRY ProcessLocksList
PEXCEPTION_RECORD ExceptionRecord
struct IRpcChannelBuffer * pRpcChannelBuffer
unsigned int BufferLength
CInterfaceStubHeader header
#define EXCEPTION_NONCONTINUABLE
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define HRESULT_FROM_WIN32(x)
static unsigned int block