ReactOS  0.4.14-dev-593-g1793dcc
cproxy.c
Go to the documentation of this file.
1 /*
2  * COM proxy implementation
3  *
4  * Copyright 2001 Ove K√•ven, TransGaming Technologies
5  * Copyright 2009 Alexandre Julliard
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21 
22 #include <stdarg.h>
23 
24 #define COBJMACROS
25 
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winerror.h"
29 
30 #include "objbase.h"
31 #include "rpcproxy.h"
32 
33 #include "cpsf.h"
34 #include "ndr_misc.h"
35 #include "ndr_stubless.h"
36 #include "wine/asm.h"
37 #include "wine/debug.h"
38 
40 
41 static const IRpcProxyBufferVtbl StdProxy_Vtbl;
42 
44 {
45  return CONTAINING_RECORD(iface, StdProxyImpl, IRpcProxyBuffer_iface);
46 }
47 
48 static inline StdProxyImpl *impl_from_proxy_obj( void *iface )
49 {
50  return CONTAINING_RECORD(iface, StdProxyImpl, PVtbl);
51 }
52 
53 #ifdef __i386__
54 
55 extern void call_stubless_func(void);
56 __ASM_GLOBAL_FUNC(call_stubless_func,
57  "movl 4(%esp),%ecx\n\t" /* This pointer */
58  "movl (%ecx),%ecx\n\t" /* This->lpVtbl */
59  "movl -8(%ecx),%ecx\n\t" /* MIDL_STUBLESS_PROXY_INFO */
60  "movl 8(%ecx),%edx\n\t" /* info->FormatStringOffset */
61  "movzwl (%edx,%eax,2),%edx\n\t" /* FormatStringOffset[index] */
62  "addl 4(%ecx),%edx\n\t" /* info->ProcFormatString + offset */
63  "movzbl 1(%edx),%eax\n\t" /* Oi_flags */
64  "andl $0x08,%eax\n\t" /* Oi_HAS_RPCFLAGS */
65  "shrl $1,%eax\n\t"
66  "movzwl 4(%edx,%eax),%eax\n\t" /* arguments size */
67  "pushl %eax\n\t"
68  __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
69  "leal 8(%esp),%eax\n\t" /* &This */
70  "pushl %eax\n\t"
71  __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
72  "pushl %edx\n\t" /* format string */
73  __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
74  "pushl (%ecx)\n\t" /* info->pStubDesc */
75  __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
76  "call " __ASM_NAME("ndr_client_call") "\n\t"
77  "leal 12(%esp),%esp\n\t"
78  __ASM_CFI(".cfi_adjust_cfa_offset -12\n\t")
79  "popl %edx\n\t" /* arguments size */
80  __ASM_CFI(".cfi_adjust_cfa_offset -4\n\t")
81  "movl (%esp),%ecx\n\t" /* return address */
82  "addl %edx,%esp\n\t"
83  "jmp *%ecx" );
84 
85 #include "pshpack1.h"
86 struct thunk
87 {
88  BYTE mov_eax;
89  DWORD index;
90  BYTE jmp;
91  LONG handler;
92 };
93 #include "poppack.h"
94 
95 static inline void init_thunk( struct thunk *thunk, unsigned int index )
96 {
97  thunk->mov_eax = 0xb8; /* movl $n,%eax */
98  thunk->index = index;
99  thunk->jmp = 0xe9; /* jmp */
100  thunk->handler = (char *)call_stubless_func - (char *)(&thunk->handler + 1);
101 }
102 
103 #elif defined(__x86_64__)
104 
105 extern void call_stubless_func(void);
106 __ASM_GLOBAL_FUNC(call_stubless_func,
107  "subq $0x38,%rsp\n\t"
108  __ASM_SEH(".seh_stackalloc 0x38\n\t")
109  __ASM_SEH(".seh_endprologue\n\t")
110  __ASM_CFI(".cfi_adjust_cfa_offset 0x38\n\t")
111  "movq %rcx,0x40(%rsp)\n\t"
112  "movq %rdx,0x48(%rsp)\n\t"
113  "movq %r8,0x50(%rsp)\n\t"
114  "movq %r9,0x58(%rsp)\n\t"
115  "leaq 0x40(%rsp),%r8\n\t" /* &This */
116  "movq (%rcx),%rcx\n\t" /* This->lpVtbl */
117  "movq -0x10(%rcx),%rcx\n\t" /* MIDL_STUBLESS_PROXY_INFO */
118  "movq 0x10(%rcx),%rdx\n\t" /* info->FormatStringOffset */
119  "movzwq (%rdx,%r10,2),%rdx\n\t" /* FormatStringOffset[index] */
120  "addq 8(%rcx),%rdx\n\t" /* info->ProcFormatString + offset */
121  "movq (%rcx),%rcx\n\t" /* info->pStubDesc */
122  "movq %xmm1,0x20(%rsp)\n\t"
123  "movq %xmm2,0x28(%rsp)\n\t"
124  "movq %xmm3,0x30(%rsp)\n\t"
125  "leaq 0x18(%rsp),%r9\n\t" /* fpu_args */
126  "call " __ASM_NAME("ndr_client_call") "\n\t"
127  "addq $0x38,%rsp\n\t"
128  __ASM_CFI(".cfi_adjust_cfa_offset -0x38\n\t")
129  "ret" );
130 
131 #include "pshpack1.h"
132 struct thunk
133 {
134  BYTE mov_r10[3];
135  DWORD index;
136  BYTE mov_rax[2];
137  void *call_stubless;
138  BYTE jmp_rax[2];
139 };
140 #include "poppack.h"
141 
142 static const struct thunk thunk_template =
143 {
144  { 0x49, 0xc7, 0xc2 }, 0, /* movq $index,%r10 */
145  { 0x48, 0xb8 }, 0, /* movq $call_stubless_func,%rax */
146  { 0xff, 0xe0 } /* jmp *%rax */
147 };
148 
149 static inline void init_thunk( struct thunk *thunk, unsigned int index )
150 {
152  thunk->index = index;
153  thunk->call_stubless = call_stubless_func;
154 }
155 
156 #elif defined(__arm__)
157 
158 extern void call_stubless_func(void);
159 __ASM_GLOBAL_FUNC(call_stubless_func,
160  "push {r0-r3}\n\t"
161  "mov r2, sp\n\t" /* stack_top */
162  "push {fp,lr}\n\t"
163  "mov fp, sp\n\t"
164  "ldr r0, [r0]\n\t" /* This->lpVtbl */
165  "ldr r0, [r0,#-8]\n\t" /* MIDL_STUBLESS_PROXY_INFO */
166  "ldr r1, [r0,#8]\n\t" /* info->FormatStringOffset */
167  "ldrh r1, [r1,ip]\n\t" /* info->FormatStringOffset[index] */
168  "ldr ip, [r0,#4]\n\t" /* info->ProcFormatString */
169  "add r1, ip\n\t" /* info->ProcFormatString + offset */
170  "ldr r0, [r0]\n\t" /* info->pStubDesc */
171 #ifdef __SOFTFP__
172  "mov r3, #0\n\t"
173 #else
174  "vpush {s0-s15}\n\t" /* store the s0-s15/d0-d7 arguments */
175  "mov r3, sp\n\t" /* fpu_stack */
176 #endif
177  "bl " __ASM_NAME("ndr_client_call") "\n\t"
178  "mov sp, fp\n\t"
179  "pop {fp,lr}\n\t"
180  "add sp, #16\n\t"
181  "bx lr" );
182 
183 struct thunk
184 {
185  DWORD ldr_ip; /* ldr ip,[pc] */
186  DWORD ldr_pc; /* ldr pc,[pc] */
187  DWORD index;
188  void *func;
189 };
190 
191 static inline void init_thunk( struct thunk *thunk, unsigned int index )
192 {
193  thunk->ldr_ip = 0xe59fc000; /* ldr ip,[pc] */
194  thunk->ldr_pc = 0xe59ff000; /* ldr pc,[pc] */
195  thunk->index = index * sizeof(unsigned short);
196  thunk->func = call_stubless_func;
197 }
198 
199 #elif defined(__aarch64__)
200 
201 extern void call_stubless_func(void);
202 __ASM_GLOBAL_FUNC( call_stubless_func,
203  "stp x29, x30, [sp, #-0x90]!\n\t"
204  "mov x29, sp\n\t"
205  "stp d0, d1, [sp, #0x10]\n\t"
206  "stp d2, d3, [sp, #0x20]\n\t"
207  "stp d4, d5, [sp, #0x30]\n\t"
208  "stp d6, d7, [sp, #0x40]\n\t"
209  "stp x0, x1, [sp, #0x50]\n\t"
210  "stp x2, x3, [sp, #0x60]\n\t"
211  "stp x4, x5, [sp, #0x70]\n\t"
212  "stp x6, x7, [sp, #0x80]\n\t"
213  "ldr x0, [x0]\n\t" /* This->lpVtbl */
214  "ldr x0, [x0, #-16]\n\t" /* MIDL_STUBLESS_PROXY_INFO */
215  "ldp x1, x4, [x0, #8]\n\t" /* info->ProcFormatString, FormatStringOffset */
216  "ldrh w4, [x4, x16, lsl #1]\n\t" /* info->FormatStringOffset[index] */
217  "add x1, x1, x4\n\t" /* info->ProcFormatString + offset */
218  "ldr x0, [x0]\n\t" /* info->pStubDesc */
219  "add x2, sp, #0x50\n\t" /* stack */
220  "add x3, sp, #0x10\n\t" /* fpu_stack */
221  "bl " __ASM_NAME("ndr_client_call") "\n\t"
222  "ldp x29, x30, [sp], #0x90\n\t"
223  "ret" )
224 
226 {
227  DWORD ldr_index; /* ldr w16, index */
228  DWORD ldr_func; /* ldr x17, func */
229  DWORD br; /* br x17 */
230  DWORD index;
231  void *func;
232 };
233 
234 static inline void init_thunk( struct thunk *thunk, unsigned int index )
235 {
236  thunk->ldr_index = 0x18000070; /* ldr w16,index */
237  thunk->ldr_func = 0x58000071; /* ldr x17,func */
238  thunk->br = 0xd61f0220; /* br x17 */
239  thunk->index = index;
240  thunk->func = call_stubless_func;
241 }
242 
243 #else /* __i386__ */
244 
245 #warning You must implement stubless proxies for your CPU
246 
247 struct thunk
248 {
250 };
251 
252 static inline void init_thunk( struct thunk *thunk, unsigned int index )
253 {
254  thunk->index = index;
255 }
256 
257 #endif /* __i386__ */
258 
259 #define BLOCK_SIZE 1024
260 #define MAX_BLOCKS 64 /* 64k methods should be enough for anybody */
261 
262 static const struct thunk *method_blocks[MAX_BLOCKS];
263 
264 static const struct thunk *allocate_block( unsigned int num )
265 {
266  unsigned int i;
267  struct thunk *prev, *block;
268  DWORD oldprot;
269 
270  block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block),
272  if (!block) return NULL;
273 
274  for (i = 0; i < BLOCK_SIZE; i++) init_thunk( &block[i], BLOCK_SIZE * num + i + 3 );
275  VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, &oldprot );
277  if (prev) /* someone beat us to it */
278  {
280  block = prev;
281  }
282  return block;
283 }
284 
285 BOOL fill_stubless_table( IUnknownVtbl *vtbl, DWORD num )
286 {
287  const void **entry = (const void **)(vtbl + 1);
288  DWORD i, j;
289 
290  if (num - 3 > BLOCK_SIZE * MAX_BLOCKS)
291  {
292  FIXME( "%u methods not supported\n", num );
293  return FALSE;
294  }
295  for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++)
296  {
297  const struct thunk *block = method_blocks[i];
298  if (!block && !(block = allocate_block( i ))) return FALSE;
299  for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++, entry++)
300  if (*entry == (LPVOID)-1) *entry = &block[j];
301  }
302  return TRUE;
303 }
304 
306  LPUNKNOWN pUnkOuter,
307  const ProxyFileInfo *ProxyInfo,
308  int Index,
309  LPPSFACTORYBUFFER pPSFactory,
310  LPRPCPROXYBUFFER *ppProxy,
311  LPVOID *ppvObj)
312 {
314  PCInterfaceName name = ProxyInfo->pNamesArray[Index];
315  CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index];
316 
317  TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name);
318 
319  /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */
320  if (ProxyInfo->TableVersion > 1) {
322  vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1);
323  TRACE("stubless vtbl %p: count=%d\n", vtbl->Vtbl, count );
324  fill_stubless_table( (IUnknownVtbl *)vtbl->Vtbl, count );
325  }
326 
327  if (!IsEqualGUID(vtbl->header.piid, riid)) {
328  ERR("IID mismatch during proxy creation\n");
329  return RPC_E_UNEXPECTED;
330  }
331 
333  if (!This) return E_OUTOFMEMORY;
334 
335  if (!pUnkOuter) pUnkOuter = (IUnknown *)This;
336  This->IRpcProxyBuffer_iface.lpVtbl = &StdProxy_Vtbl;
337  This->PVtbl = vtbl->Vtbl;
338  /* one reference for the proxy */
339  This->RefCount = 1;
340  This->piid = vtbl->header.piid;
341  This->base_object = NULL;
342  This->base_proxy = NULL;
343  This->pUnkOuter = pUnkOuter;
344  This->name = name;
345  This->pPSFactory = pPSFactory;
346  This->pChannel = NULL;
347 
348  if(ProxyInfo->pDelegatedIIDs && ProxyInfo->pDelegatedIIDs[Index])
349  {
350  HRESULT r = create_proxy( ProxyInfo->pDelegatedIIDs[Index], NULL,
351  &This->base_proxy, (void **)&This->base_object );
352  if (FAILED(r))
353  {
354  HeapFree( GetProcessHeap(), 0, This );
355  return r;
356  }
357  }
358 
359  *ppProxy = &This->IRpcProxyBuffer_iface;
360  *ppvObj = &This->PVtbl;
361  IUnknown_AddRef((IUnknown *)*ppvObj);
362  IPSFactoryBuffer_AddRef(pPSFactory);
363 
364  TRACE( "iid=%s this %p proxy %p obj %p vtbl %p base proxy %p base obj %p\n",
365  debugstr_guid(riid), This, *ppProxy, *ppvObj, This->PVtbl, This->base_proxy, This->base_object );
366  return S_OK;
367 }
368 
370 {
372  TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj);
373 
374  if (IsEqualGUID(&IID_IUnknown,riid) ||
375  IsEqualGUID(This->piid,riid)) {
376  *obj = &This->PVtbl;
377  InterlockedIncrement(&This->RefCount);
378  return S_OK;
379  }
380 
381  if (IsEqualGUID(&IID_IRpcProxyBuffer,riid)) {
382  *obj = &This->IRpcProxyBuffer_iface;
383  InterlockedIncrement(&This->RefCount);
384  return S_OK;
385  }
386 
387  return E_NOINTERFACE;
388 }
389 
391 {
393  TRACE("(%p)->AddRef()\n",This);
394 
395  return InterlockedIncrement(&This->RefCount);
396 }
397 
399 {
400  ULONG refs;
402  TRACE("(%p)->Release()\n",This);
403 
404  refs = InterlockedDecrement(&This->RefCount);
405  if (!refs)
406  {
407  if (This->pChannel)
408  IRpcProxyBuffer_Disconnect(&This->IRpcProxyBuffer_iface);
409 
410  if (This->base_object) IUnknown_Release( This->base_object );
411  if (This->base_proxy) IRpcProxyBuffer_Release( This->base_proxy );
412 
413  IPSFactoryBuffer_Release(This->pPSFactory);
415  }
416 
417  return refs;
418 }
419 
421 {
423  TRACE("(%p)->Connect(%p)\n",This,pChannel);
424 
425  This->pChannel = pChannel;
426  IRpcChannelBuffer_AddRef(pChannel);
427  if (This->base_proxy) IRpcProxyBuffer_Connect( This->base_proxy, pChannel );
428  return S_OK;
429 }
430 
432 {
434  TRACE("(%p)->Disconnect()\n",This);
435 
436  if (This->base_proxy) IRpcProxyBuffer_Disconnect( This->base_proxy );
437 
438  IRpcChannelBuffer_Release(This->pChannel);
439  This->pChannel = NULL;
440 }
441 
442 static const IRpcProxyBufferVtbl StdProxy_Vtbl =
443 {
449 };
450 
451 static void StdProxy_GetChannel(LPVOID iface,
452  LPRPCCHANNELBUFFER *ppChannel)
453 {
455  TRACE("(%p)->GetChannel(%p) %s\n",This,ppChannel,This->name);
456 
457  *ppChannel = This->pChannel;
458 }
459 
460 static void StdProxy_GetIID(LPVOID iface,
461  const IID **ppiid)
462 {
464  TRACE("(%p)->GetIID(%p) %s\n",This,ppiid,This->name);
465 
466  *ppiid = This->piid;
467 }
468 
470  REFIID riid,
471  LPVOID *ppvObj)
472 {
474  TRACE("(%p)->QueryInterface(%s,%p) %s\n",This,debugstr_guid(riid),ppvObj,This->name);
475  return IUnknown_QueryInterface(This->pUnkOuter,riid,ppvObj);
476 }
477 
479 {
481  TRACE("(%p)->AddRef() %s\n",This,This->name);
482  return IUnknown_AddRef(This->pUnkOuter);
483 }
484 
486 {
488  TRACE("(%p)->Release() %s\n",This,This->name);
489  return IUnknown_Release(This->pUnkOuter);
490 }
491 
492 /***********************************************************************
493  * NdrProxyInitialize [RPCRT4.@]
494  */
496  PRPC_MESSAGE pRpcMsg,
497  PMIDL_STUB_MESSAGE pStubMsg,
498  PMIDL_STUB_DESC pStubDescriptor,
499  unsigned int ProcNum)
500 {
501  TRACE("(%p,%p,%p,%p,%d)\n", This, pRpcMsg, pStubMsg, pStubDescriptor, ProcNum);
502  NdrClientInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor, ProcNum);
504  if (!pStubMsg->pRpcChannelBuffer)
506  IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer,
507  &pStubMsg->dwDestContext,
508  &pStubMsg->pvDestContext);
509  TRACE("channel=%p\n", pStubMsg->pRpcChannelBuffer);
510 }
511 
512 /***********************************************************************
513  * NdrProxyGetBuffer [RPCRT4.@]
514  */
516  PMIDL_STUB_MESSAGE pStubMsg)
517 {
518  HRESULT hr;
519  const IID *riid = NULL;
520 
521  TRACE("(%p,%p)\n", This, pStubMsg);
522  pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength;
523  pStubMsg->dwStubPhase = PROXY_GETBUFFER;
525  hr = IRpcChannelBuffer_GetBuffer(pStubMsg->pRpcChannelBuffer,
526  (RPCOLEMESSAGE*)pStubMsg->RpcMsg,
527  riid);
528  if (FAILED(hr))
529  {
531  return;
532  }
533  pStubMsg->fBufferValid = TRUE;
534  pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer;
535  pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength;
536  pStubMsg->Buffer = pStubMsg->BufferStart;
537  pStubMsg->dwStubPhase = PROXY_MARSHAL;
538 }
539 
540 /***********************************************************************
541  * NdrProxySendReceive [RPCRT4.@]
542  */
544  PMIDL_STUB_MESSAGE pStubMsg)
545 {
546  ULONG Status = 0;
547  HRESULT hr;
548 
549  TRACE("(%p,%p)\n", This, pStubMsg);
550 
551  if (!pStubMsg->pRpcChannelBuffer)
552  {
553  WARN("Trying to use disconnected proxy %p\n", This);
555  }
556 
557  pStubMsg->dwStubPhase = PROXY_SENDRECEIVE;
558  /* avoid sending uninitialised parts of the buffer on the wire */
559  pStubMsg->RpcMsg->BufferLength = pStubMsg->Buffer - (unsigned char *)pStubMsg->RpcMsg->Buffer;
560  hr = IRpcChannelBuffer_SendReceive(pStubMsg->pRpcChannelBuffer,
561  (RPCOLEMESSAGE*)pStubMsg->RpcMsg,
562  &Status);
563  pStubMsg->dwStubPhase = PROXY_UNMARSHAL;
564  pStubMsg->BufferLength = pStubMsg->RpcMsg->BufferLength;
565  pStubMsg->BufferStart = pStubMsg->RpcMsg->Buffer;
566  pStubMsg->BufferEnd = pStubMsg->BufferStart + pStubMsg->BufferLength;
567  pStubMsg->Buffer = pStubMsg->BufferStart;
568 
569  /* raise exception if call failed */
570  if (hr == RPC_S_CALL_FAILED) RpcRaiseException(*(DWORD*)pStubMsg->Buffer);
571  else if (FAILED(hr)) RpcRaiseException(hr);
572 }
573 
574 /***********************************************************************
575  * NdrProxyFreeBuffer [RPCRT4.@]
576  */
578  PMIDL_STUB_MESSAGE pStubMsg)
579 {
580  TRACE("(%p,%p)\n", This, pStubMsg);
581 
582  if (pStubMsg->fBufferValid)
583  {
584  IRpcChannelBuffer_FreeBuffer(pStubMsg->pRpcChannelBuffer,
585  (RPCOLEMESSAGE*)pStubMsg->RpcMsg);
586  pStubMsg->fBufferValid = TRUE;
587  }
588 }
589 
590 /***********************************************************************
591  * NdrProxyErrorHandler [RPCRT4.@]
592  */
594 {
595  WARN("(0x%08x): a proxy call failed\n", dwExceptionCode);
596 
597  if (FAILED(dwExceptionCode))
598  return dwExceptionCode;
599  else
600  return HRESULT_FROM_WIN32(dwExceptionCode);
601 }
static unsigned int block
Definition: xmlmemory.c:118
GLenum func
Definition: glext.h:6028
DWORD index
Definition: cproxy.c:249
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:478
HRESULT hr
Definition: shlfolder.c:183
Definition: cproxy.c:247
static StdProxyImpl * impl_from_proxy_obj(void *iface)
Definition: cproxy.c:48
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
void WINAPI NdrProxyFreeBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:577
interface IRpcProxyBuffer * LPRPCPROXYBUFFER
Definition: objfwd.h:40
GLuint GLuint GLsizei count
Definition: gl.h:1545
void WINAPI NdrProxySendReceive(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:543
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:186
#define WARN(fmt,...)
Definition: debug.h:111
unsigned char * Buffer
Definition: rpcndr.h:203
static const IRpcProxyBufferVtbl StdProxy_Vtbl
Definition: cproxy.c:41
static void StdProxy_GetIID(LPVOID iface, const IID **ppiid)
Definition: cproxy.c:460
PRPC_MESSAGE RpcMsg
Definition: rpcndr.h:202
HRESULT StdProxy_Construct(REFIID riid, LPUNKNOWN pUnkOuter, const ProxyFileInfo *ProxyInfo, int Index, LPPSFACTORYBUFFER pPSFactory, LPRPCPROXYBUFFER *ppProxy, LPVOID *ppvObj)
Definition: cproxy.c:305
#define MEM_COMMIT
Definition: nt_native.h:1313
#define CO_E_OBJNOTCONNECTED
Definition: winerror.h:2816
void WINAPI NdrProxyGetBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:515
void WINAPI StdProxy_Disconnect(IRpcProxyBuffer *iface)
Definition: cproxy.c:431
unsigned short TableVersion
Definition: rpcproxy.h:54
const PCInterfaceName * pNamesArray
Definition: rpcproxy.h:50
#define __ASM_GLOBAL_FUNC(name, code)
Definition: port.h:201
unsigned int BufferLength
Definition: rpcdcep.h:41
CInterfaceStubHeader header
Definition: rpcproxy.h:104
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
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
Definition: glfuncs.h:248
void * Buffer
Definition: rpcdcep.h:40
LPVOID NTAPI VirtualAlloc(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flAllocationType, IN DWORD flProtect)
Definition: virtmem.c:74
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static ULONG WINAPI StdProxy_Release(LPRPCPROXYBUFFER iface)
Definition: cproxy.c:398
static LPUNKNOWN
Definition: ndr_ole.c:49
ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:485
DWORD dwDestContext
Definition: rpcndr.h:249
#define __ASM_NAME(name)
Definition: config.h:934
#define MEM_RESERVE
Definition: nt_native.h:1314
#define FIXME(fmt,...)
Definition: debug.h:110
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
HRESULT WINAPI NdrProxyErrorHandler(DWORD dwExceptionCode)
Definition: cproxy.c:593
static const struct thunk * allocate_block(unsigned int num)
Definition: cproxy.c:264
smooth NULL
Definition: ftsmooth.c:416
ULONG WINAPI StdProxy_AddRef(IRpcProxyBuffer *iface)
Definition: cproxy.c:390
BOOL fill_stubless_table(IUnknownVtbl *vtbl, DWORD num)
Definition: cproxy.c:285
GLuint index
Definition: glext.h:6031
#define RPC_E_UNEXPECTED
Definition: winerror.h:2509
const PCInterfaceStubVtblList * pStubVtblList
Definition: rpcproxy.h:49
HRESULT WINAPI StdProxy_Connect(IRpcProxyBuffer *iface, IRpcChannelBuffer *pChannel)
Definition: cproxy.c:420
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define __ASM_CFI(str)
Definition: asm.h:39
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
Definition: glfuncs.h:250
CInterfaceProxyHeader header
Definition: rpcproxy.h:80
#define BLOCK_SIZE
Definition: cproxy.c:259
#define TRACE(s)
Definition: solgame.cpp:4
DWORD dwStubPhase
Definition: rpcndr.h:259
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
void * pvDestContext
Definition: rpcndr.h:250
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
static const UCHAR Index[8]
Definition: usbohci.c:18
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
BOOL NTAPI VirtualProtect(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD flNewProtect, OUT PDWORD lpflOldProtect)
Definition: virtmem.c:144
static void StdProxy_GetChannel(LPVOID iface, LPRPCCHANNELBUFFER *ppChannel)
Definition: cproxy.c:451
#define RPC_E_DISCONNECTED
Definition: winerror.h:2484
HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj)
Definition: cproxy.c:469
unsigned char * BufferStart
Definition: rpcndr.h:204
static StdProxyImpl * impl_from_IRpcProxyBuffer(IRpcProxyBuffer *iface)
Definition: cproxy.c:43
ULONG BufferLength
Definition: rpcndr.h:207
unsigned char * BufferEnd
Definition: rpcndr.h:205
#define index(s, c)
Definition: various.h:29
unsigned int fBufferValid
Definition: rpcndr.h:243
#define InterlockedDecrement
Definition: armddk.h:52
uint32_t entry
Definition: isohybrid.c:63
unsigned char BYTE
Definition: mem.h:68
static const struct vtable_fixup_thunk thunk_template
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
const PCInterfaceProxyVtblList * pProxyVtblList
Definition: rpcproxy.h:48
static const struct thunk * method_blocks[MAX_BLOCKS]
Definition: cproxy.c:262
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
WINE_DEFAULT_DEBUG_CHANNEL(ole)
const char * PCInterfaceName
Definition: rpcproxy.h:42
HRESULT create_proxy(REFIID iid, IUnknown *pUnkOuter, IRpcProxyBuffer **pproxy, void **ppv) DECLSPEC_HIDDEN
Definition: ndr_ole.c:442
const IID ** pDelegatedIIDs
Definition: rpcproxy.h:51
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MAX_BLOCKS
Definition: cproxy.c:260
#define MEM_RELEASE
Definition: nt_native.h:1316
Definition: name.c:38
void WINAPI NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum)
unsigned int ULONG
Definition: retypes.h:1
HRESULT WINAPI StdProxy_QueryInterface(IRpcProxyBuffer *iface, REFIID riid, void **obj)
Definition: cproxy.c:369
void WINAPI NdrProxyInitialize(void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum)
Definition: cproxy.c:495
#define PAGE_EXECUTE_READ
Definition: nt_native.h:1307
interface IRpcChannelBuffer * LPRPCCHANNELBUFFER
Definition: objfwd.h:39
BOOL NTAPI VirtualFree(IN LPVOID lpAddress, IN SIZE_T dwSize, IN DWORD dwFreeType)
Definition: virtmem.c:128
#define PAGE_EXECUTE_READWRITE
Definition: nt_native.h:1308
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
static void init_thunk(struct thunk *thunk, unsigned int index)
Definition: cproxy.c:252
#define RPC_S_CALL_FAILED
Definition: winerror.h:1037
#define HeapFree(x, y, z)
Definition: compat.h:402
#define __ASM_SEH(str)
Definition: asm.h:45
struct IRpcChannelBuffer * pRpcChannelBuffer
Definition: rpcndr.h:253
jmp_buf jmp
Definition: mach.c:35
GLuint const GLchar * name
Definition: glext.h:6031