ReactOS  0.4.13-dev-92-gf251225
cstub.c
Go to the documentation of this file.
1 /*
2  * COM stub (CStdStubBuffer) 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 "config.h"
23 #include "wine/port.h"
24 
25 #include <stdarg.h>
26 
27 #define COBJMACROS
28 
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winerror.h"
32 #include "excpt.h"
33 
34 #include "objbase.h"
35 #include "rpcproxy.h"
36 
37 #include "wine/debug.h"
38 #include "wine/exception.h"
39 
40 #include "cpsf.h"
41 
43 
44 #define STUB_HEADER(This) (((const CInterfaceStubHeader*)((This)->lpVtbl))[-1])
45 
47 {
51 }
52 
54 {
55  return CONTAINING_RECORD((void *)iface, cstdstubbuffer_delegating_t, stub_buffer);
56 }
57 
59  LPUNKNOWN pUnkServer,
61  CInterfaceStubVtbl *vtbl,
62  LPPSFACTORYBUFFER pPSFactory,
63  LPRPCSTUBBUFFER *ppStub)
64 {
66  IUnknown *pvServer;
67  HRESULT r;
68  TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name);
69  TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid));
70  TRACE("vtbl=%p\n", &vtbl->Vtbl);
71 
72  if (!IsEqualGUID(vtbl->header.piid, riid)) {
73  ERR("IID mismatch during stub creation\n");
74  return RPC_E_UNEXPECTED;
75  }
76 
77  r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer);
78  if(FAILED(r))
79  return r;
80 
82  if (!This) {
83  IUnknown_Release(pvServer);
84  return E_OUTOFMEMORY;
85  }
86 
87  This->lpVtbl = &vtbl->Vtbl;
88  This->RefCount = 1;
89  This->pvServerObject = pvServer;
90  This->pPSFactory = pPSFactory;
91  *ppStub = (LPRPCSTUBBUFFER)This;
92 
93  IPSFactoryBuffer_AddRef(pPSFactory);
94  return S_OK;
95 }
96 
99 {
102  0, 0, { (DWORD_PTR)(__FILE__ ": delegating_vtbl_section") }
103 };
104 static CRITICAL_SECTION delegating_vtbl_section = { &critsect_debug, -1, 0, 0, 0, 0 };
105 
106 typedef struct
107 {
110  IUnknownVtbl vtbl;
111  /* remaining entries in vtbl */
113 
115 
116 
118 {
119  *ppv = pUnk;
120  return S_OK;
121 }
122 
124 {
125  return 1;
126 }
127 
129 {
130  return 1;
131 }
132 
133 /* The idea here is to replace the first param on the stack
134  ie. This (which will point to cstdstubbuffer_delegating_t)
135  with This->stub_buffer.pvServerObject and then jump to the
136  relevant offset in This->stub_buffer.pvServerObject's vtbl.
137 */
138 #ifdef __i386__
139 
140 #include "pshpack1.h"
141 typedef struct {
142  BYTE mov1[4]; /* mov 0x4(%esp),%eax 8b 44 24 04 */
143  BYTE mov2[3]; /* mov 0x10(%eax),%eax 8b 40 10 */
144  BYTE mov3[4]; /* mov %eax,0x4(%esp) 89 44 24 04 */
145  BYTE mov4[2]; /* mov (%eax),%eax 8b 00 */
146  BYTE mov5[2]; /* jmp *offset(%eax) ff a0 offset */
147  DWORD offset;
148  BYTE pad[1]; /* nop 90 */
149 } vtbl_method_t;
150 #include "poppack.h"
151 
152 static const BYTE opcodes[20] = { 0x8b, 0x44, 0x24, 0x04, 0x8b, 0x40, 0x10, 0x89, 0x44, 0x24, 0x04,
153  0x8b, 0x00, 0xff, 0xa0, 0, 0, 0, 0, 0x90 };
154 
155 #elif defined(__x86_64__)
156 
157 #include "pshpack1.h"
158 typedef struct
159 {
160  BYTE mov1[4]; /* movq 0x20(%rcx),%rcx 48 8b 49 20 */
161  BYTE mov2[3]; /* movq (%rcx),%rax 48 8b 01 */
162  BYTE jmp[2]; /* jmp *offset(%rax) ff a0 offset */
163  DWORD offset;
164  BYTE pad[3]; /* lea 0x0(%rsi),%rsi 48 8d 36 */
165 } vtbl_method_t;
166 #include "poppack.h"
167 
168 static const BYTE opcodes[16] = { 0x48, 0x8b, 0x49, 0x20, 0x48, 0x8b, 0x01,
169  0xff, 0xa0, 0, 0, 0, 0, 0x48, 0x8d, 0x36 };
170 #elif defined(__arm__)
171 
172 static const DWORD opcodes[] =
173 {
174  0xe52d4004, /* push {r4} */
175  0xe5900010, /* ldr r0, [r0, #16] */
176  0xe5904000, /* ldr r4, [r0] */
177  0xe59fc008, /* ldr ip, [pc, #8] */
178  0xe08cc004, /* add ip, ip, r4 */
179  0xe49d4004, /* pop {r4} */
180  0xe59cf000 /* ldr pc, [ip] */
181 };
182 
183 typedef struct
184 {
186  DWORD offset;
187 } vtbl_method_t;
188 
189 #else
190 
191 #warning You must implement delegated proxies/stubs for your CPU
192 typedef struct
193 {
195 } vtbl_method_t;
196 static const BYTE opcodes[1];
197 
198 #endif
199 
200 #define BLOCK_SIZE 1024
201 #define MAX_BLOCKS 64 /* 64k methods should be enough for anybody */
202 
204 
205 static const vtbl_method_t *allocate_block( unsigned int num )
206 {
207  unsigned int i;
208  vtbl_method_t *prev, *block;
209  DWORD oldprot;
210 
211  block = VirtualAlloc( NULL, BLOCK_SIZE * sizeof(*block),
213  if (!block) return NULL;
214 
215  for (i = 0; i < BLOCK_SIZE; i++)
216  {
217  memcpy( &block[i], opcodes, sizeof(opcodes) );
218  block[i].offset = (BLOCK_SIZE * num + i + 3) * sizeof(void *);
219  }
220  VirtualProtect( block, BLOCK_SIZE * sizeof(*block), PAGE_EXECUTE_READ, &oldprot );
222  if (prev) /* someone beat us to it */
223  {
225  block = prev;
226  }
227  return block;
228 }
229 
230 static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num)
231 {
232  const void **entry = (const void **)(vtbl + 1);
233  DWORD i, j;
234 
235  if (num - 3 > BLOCK_SIZE * MAX_BLOCKS)
236  {
237  FIXME( "%u methods not supported\n", num );
238  return FALSE;
239  }
240  vtbl->QueryInterface = delegating_QueryInterface;
241  vtbl->AddRef = delegating_AddRef;
242  vtbl->Release = delegating_Release;
243  for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++)
244  {
246  if (!block && !(block = allocate_block( i ))) return FALSE;
247  for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++) *entry++ = &block[j];
248  }
249  return TRUE;
250 }
251 
253 {
254  const void **entry = (const void **)(vtbl + 1);
255  DWORD i, j;
256 
257  if (num - 3 > BLOCK_SIZE * MAX_BLOCKS)
258  {
259  FIXME( "%u methods not supported\n", num );
260  return FALSE;
261  }
262  vtbl->QueryInterface = IUnknown_QueryInterface_Proxy;
263  vtbl->AddRef = IUnknown_AddRef_Proxy;
264  vtbl->Release = IUnknown_Release_Proxy;
265  for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++)
266  {
268  if (!block && !(block = allocate_block( i ))) return FALSE;
269  for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++, entry++)
270  if (!*entry) *entry = &block[j];
271  }
272  return TRUE;
273 }
274 
275 IUnknownVtbl *get_delegating_vtbl(DWORD num_methods)
276 {
277  IUnknownVtbl *ret;
278 
279  if (num_methods < 256) num_methods = 256; /* avoid frequent reallocations */
280 
282 
283  if(!current_vtbl || num_methods > current_vtbl->size)
284  {
286  FIELD_OFFSET(ref_counted_vtbl, vtbl) + num_methods * sizeof(void*));
287  if (!table)
288  {
290  return NULL;
291  }
292 
293  table->ref = 0;
294  table->size = num_methods;
295  fill_delegated_stub_table(&table->vtbl, num_methods);
296 
297  if (current_vtbl && current_vtbl->ref == 0)
298  {
299  TRACE("freeing old table\n");
301  }
303  }
304 
305  current_vtbl->ref++;
306  ret = &current_vtbl->vtbl;
308  return ret;
309 }
310 
311 void release_delegating_vtbl(IUnknownVtbl *vtbl)
312 {
313  ref_counted_vtbl *table = (ref_counted_vtbl*)((DWORD *)vtbl - 1);
314 
316  table->ref--;
317  TRACE("ref now %d\n", table->ref);
318  if(table->ref == 0 && table != current_vtbl)
319  {
320  TRACE("... and we're not current so free'ing\n");
322  }
324 }
325 
327  LPUNKNOWN pUnkServer,
329  CInterfaceStubVtbl *vtbl,
330  REFIID delegating_iid,
331  LPPSFACTORYBUFFER pPSFactory,
332  LPRPCSTUBBUFFER *ppStub)
333 {
335  IUnknown *pvServer;
336  HRESULT r;
337 
338  TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name);
339  TRACE("iid=%s delegating to %s\n", debugstr_guid(vtbl->header.piid), debugstr_guid(delegating_iid));
340  TRACE("vtbl=%p\n", &vtbl->Vtbl);
341 
342  if (!IsEqualGUID(vtbl->header.piid, riid))
343  {
344  ERR("IID mismatch during stub creation\n");
345  return RPC_E_UNEXPECTED;
346  }
347 
348  r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer);
349  if(FAILED(r)) return r;
350 
352  if (!This)
353  {
354  IUnknown_Release(pvServer);
355  return E_OUTOFMEMORY;
356  }
357 
358  This->base_obj = get_delegating_vtbl( vtbl->header.DispatchTableCount );
359  r = create_stub(delegating_iid, (IUnknown*)&This->base_obj, &This->base_stub);
360  if(FAILED(r))
361  {
362  release_delegating_vtbl(This->base_obj);
364  IUnknown_Release(pvServer);
365  return r;
366  }
367 
368  This->stub_buffer.lpVtbl = &vtbl->Vtbl;
369  This->stub_buffer.RefCount = 1;
370  This->stub_buffer.pvServerObject = pvServer;
371  This->stub_buffer.pPSFactory = pPSFactory;
372  *ppStub = (LPRPCSTUBBUFFER)&This->stub_buffer;
373 
374  IPSFactoryBuffer_AddRef(pPSFactory);
375  return S_OK;
376 }
377 
379  REFIID riid,
380  LPVOID *obj)
381 {
382  CStdStubBuffer *This = (CStdStubBuffer *)iface;
383  TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj);
384 
385  if (IsEqualIID(&IID_IUnknown, riid) ||
386  IsEqualIID(&IID_IRpcStubBuffer, riid))
387  {
388  IRpcStubBuffer_AddRef(iface);
389  *obj = iface;
390  return S_OK;
391  }
392  *obj = NULL;
393  return E_NOINTERFACE;
394 }
395 
397 {
398  CStdStubBuffer *This = (CStdStubBuffer *)iface;
399  TRACE("(%p)->AddRef()\n",This);
400  return InterlockedIncrement(&This->RefCount);
401 }
402 
404  LPPSFACTORYBUFFER pPSF)
405 {
406  CStdStubBuffer *This = (CStdStubBuffer *)iface;
407  ULONG refs;
408 
409  TRACE("(%p)->Release()\n",This);
410 
411  refs = InterlockedDecrement(&This->RefCount);
412  if (!refs)
413  {
414  /* test_Release shows that native doesn't call Disconnect here.
415  We'll leave it in for the time being. */
416  IRpcStubBuffer_Disconnect(iface);
417 
418  IPSFactoryBuffer_Release(pPSF);
420  }
421  return refs;
422 }
423 
425  LPPSFACTORYBUFFER pPSF)
426 {
428  ULONG refs;
429 
430  TRACE("(%p)->Release()\n", This);
431 
432  refs = InterlockedDecrement(&This->stub_buffer.RefCount);
433  if (!refs)
434  {
435  /* Just like NdrCStdStubBuffer_Release, we shouldn't call
436  Disconnect here */
437  IRpcStubBuffer_Disconnect((IRpcStubBuffer *)&This->stub_buffer);
438 
439  IRpcStubBuffer_Release(This->base_stub);
440  release_delegating_vtbl(This->base_obj);
441 
442  IPSFactoryBuffer_Release(pPSF);
444  }
445 
446  return refs;
447 }
448 
450  LPUNKNOWN lpUnkServer)
451 {
452  CStdStubBuffer *This = (CStdStubBuffer *)iface;
453  HRESULT r;
454  IUnknown *new = NULL;
455 
456  TRACE("(%p)->Connect(%p)\n",This,lpUnkServer);
457 
458  r = IUnknown_QueryInterface(lpUnkServer, STUB_HEADER(This).piid, (void**)&new);
459  new = InterlockedExchangePointer((void**)&This->pvServerObject, new);
460  if(new)
461  IUnknown_Release(new);
462  return r;
463 }
464 
466 {
467  CStdStubBuffer *This = (CStdStubBuffer *)iface;
468  IUnknown *old;
469  TRACE("(%p)->Disconnect()\n",This);
470 
471  old = InterlockedExchangePointer((void**)&This->pvServerObject, NULL);
472 
473  if(old)
474  IUnknown_Release(old);
475 }
476 
478  PRPCOLEMESSAGE pMsg,
479  LPRPCCHANNELBUFFER pChannel)
480 {
481  CStdStubBuffer *This = (CStdStubBuffer *)iface;
482  DWORD dwPhase = STUB_UNMARSHAL;
483  HRESULT hr = S_OK;
484 
485  TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel);
486 
487  __TRY
488  {
489  if (STUB_HEADER(This).pDispatchTable)
490  STUB_HEADER(This).pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
491  else /* pure interpreted */
492  NdrStubCall2(iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
493  }
495  {
496  DWORD dwExceptionCode = GetExceptionCode();
497  WARN("a stub call failed with exception 0x%08x (%d)\n", dwExceptionCode, dwExceptionCode);
498  if (FAILED(dwExceptionCode))
499  hr = dwExceptionCode;
500  else
501  hr = HRESULT_FROM_WIN32(dwExceptionCode);
502  }
503  __ENDTRY
504 
505  return hr;
506 }
507 
509  REFIID riid)
510 {
511  CStdStubBuffer *This = (CStdStubBuffer *)iface;
512  TRACE("(%p)->IsIIDSupported(%s)\n",This,debugstr_guid(riid));
513  return IsEqualGUID(STUB_HEADER(This).piid, riid) ? iface : NULL;
514 }
515 
517 {
518  CStdStubBuffer *This = (CStdStubBuffer *)iface;
519  TRACE("(%p)->CountRefs()\n",This);
520  return This->RefCount;
521 }
522 
524  LPVOID *ppv)
525 {
526  CStdStubBuffer *This = (CStdStubBuffer *)iface;
527  TRACE("(%p)->DebugServerQueryInterface(%p)\n",This,ppv);
528  return S_OK;
529 }
530 
532  LPVOID pv)
533 {
534  CStdStubBuffer *This = (CStdStubBuffer *)iface;
535  TRACE("(%p)->DebugServerRelease(%p)\n",This,pv);
536 }
537 
538 const IRpcStubBufferVtbl CStdStubBuffer_Vtbl =
539 {
542  NULL,
550 };
551 
553  LPUNKNOWN lpUnkServer)
554 {
556  HRESULT r;
557  TRACE("(%p)->Connect(%p)\n", This, lpUnkServer);
558 
559  r = CStdStubBuffer_Connect(iface, lpUnkServer);
560  if(SUCCEEDED(r))
561  r = IRpcStubBuffer_Connect(This->base_stub, (IUnknown*)&This->base_obj);
562 
563  return r;
564 }
565 
567 {
569  TRACE("(%p)->Disconnect()\n", This);
570 
571  IRpcStubBuffer_Disconnect(This->base_stub);
573 }
574 
576 {
578  ULONG ret;
579  TRACE("(%p)->CountRefs()\n", This);
580 
581  ret = CStdStubBuffer_CountRefs(iface);
582  ret += IRpcStubBuffer_CountRefs(This->base_stub);
583 
584  return ret;
585 }
586 
587 const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl =
588 {
591  NULL,
599 };
600 
602 {
603  CStdStubBuffer *This = (CStdStubBuffer *)iface;
604  return STUB_HEADER(This).pServerInfo;
605 }
606 
607 /************************************************************************
608  * NdrStubForwardingFunction [RPCRT4.@]
609  */
611  PRPC_MESSAGE pMsg, DWORD *pdwStubPhase )
612 {
613  /* Note pMsg is passed intact since RPCOLEMESSAGE is basically a RPC_MESSAGE. */
614 
616  HRESULT r = IRpcStubBuffer_Invoke(This->base_stub, (RPCOLEMESSAGE*)pMsg, pChannel);
617  if(FAILED(r)) RpcRaiseException(r);
618  return;
619 }
620 
621 /***********************************************************************
622  * NdrStubInitialize [RPCRT4.@]
623  */
625  PMIDL_STUB_MESSAGE pStubMsg,
626  PMIDL_STUB_DESC pStubDescriptor,
627  LPRPCCHANNELBUFFER pRpcChannelBuffer)
628 {
629  TRACE("(%p,%p,%p,%p)\n", pRpcMsg, pStubMsg, pStubDescriptor, pRpcChannelBuffer);
630  NdrServerInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor);
631  pStubMsg->pRpcChannelBuffer = pRpcChannelBuffer;
632  IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer,
633  &pStubMsg->dwDestContext,
634  &pStubMsg->pvDestContext);
635 }
636 
637 /***********************************************************************
638  * NdrStubGetBuffer [RPCRT4.@]
639  */
641  LPRPCCHANNELBUFFER pRpcChannelBuffer,
642  PMIDL_STUB_MESSAGE pStubMsg)
643 {
644  CStdStubBuffer *This = (CStdStubBuffer *)iface;
645  HRESULT hr;
646 
647  TRACE("(%p, %p, %p)\n", This, pRpcChannelBuffer, pStubMsg);
648 
649  pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength;
650  hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer,
651  (RPCOLEMESSAGE *)pStubMsg->RpcMsg, STUB_HEADER(This).piid);
652  if (FAILED(hr))
653  {
655  return;
656  }
657 
658  pStubMsg->Buffer = pStubMsg->RpcMsg->Buffer;
659 }
static unsigned int block
Definition: xmlmemory.c:118
#define __EXCEPT(func)
Definition: exception.h:58
HRESULT WINAPI CStdStubBuffer_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *obj)
Definition: cstub.c:378
static HRESULT WINAPI CStdStubBuffer_Delegating_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
Definition: cstub.c:552
LONG WINAPI NdrStubCall2(struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg, DWORD *pdwStubPhase)
#define REFIID
Definition: guiddef.h:113
#define TRUE
Definition: types.h:120
#define E_NOINTERFACE
Definition: winerror.h:2364
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#define DWORD_PTR
Definition: treelist.c:76
ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:434
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs(LPRPCSTUBBUFFER iface)
Definition: cstub.c:575
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:189
uint8_t entry
Definition: isohybrid.c:63
#define WARN(fmt,...)
Definition: debug.h:111
unsigned char *WINAPI NdrServerInitializeNew(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc)
unsigned char * Buffer
Definition: rpcndr.h:203
static ULONG WINAPI delegating_Release(IUnknown *pUnk)
Definition: cstub.c:128
GLintptr offset
Definition: glext.h:5920
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define EXCEPTION_NONCONTINUABLE
Definition: rtltypes.h:150
static ref_counted_vtbl * current_vtbl
Definition: cstub.c:114
static const vtbl_method_t * allocate_block(unsigned int num)
Definition: cstub.c:205
HRESULT CStdStubBuffer_Delegating_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, REFIID delegating_iid, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
Definition: cstub.c:326
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
#define BLOCK_SIZE
Definition: cstub.c:200
static void WINAPI CStdStubBuffer_Delegating_Disconnect(LPRPCSTUBBUFFER iface)
Definition: cstub.c:566
BOOL fill_delegated_proxy_table(IUnknownVtbl *vtbl, DWORD num)
Definition: cstub.c:252
PRPC_MESSAGE RpcMsg
Definition: rpcndr.h:202
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define MEM_COMMIT
Definition: nt_native.h:1313
void release_delegating_vtbl(IUnknownVtbl *vtbl)
Definition: cstub.c:311
IUnknownVtbl * get_delegating_vtbl(DWORD num_methods)
Definition: cstub.c:275
unsigned int BufferLength
Definition: rpcdcep.h:41
CInterfaceStubHeader header
Definition: rpcproxy.h:104
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86
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
static CRITICAL_SECTION delegating_vtbl_section
Definition: cstub.c:97
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
struct _RPC_MESSAGE * PRPC_MESSAGE
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: cstub.c:98
static LPUNKNOWN
Definition: ndr_ole.c:49
ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:441
static HRESULT WINAPI delegating_QueryInterface(IUnknown *pUnk, REFIID iid, void **ppv)
Definition: cstub.c:117
DWORD dwDestContext
Definition: rpcndr.h:249
#define MEM_RESERVE
Definition: nt_native.h:1314
#define FIXME(fmt,...)
Definition: debug.h:110
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
void WINAPI NdrStubInitialize(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, LPRPCCHANNELBUFFER pRpcChannelBuffer)
Definition: cstub.c:624
smooth NULL
Definition: ftsmooth.c:416
ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface)
Definition: cstub.c:516
static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num)
Definition: cstub.c:230
const IID * piid
Definition: rpcproxy.h:96
void WINAPI NdrStubGetBuffer(LPRPCSTUBBUFFER iface, LPRPCCHANNELBUFFER pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cstub.c:640
#define RPC_E_UNEXPECTED
Definition: winerror.h:2509
#define __TRY
Definition: compat.h:70
#define __RPC_STUB
Definition: rpc.h:66
#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
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
void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface, LPVOID pv)
Definition: cstub.c:531
#define GetExceptionCode()
Definition: exception.h:65
void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface)
Definition: cstub.c:465
static void pad(Char *s)
Definition: bzip2.c:908
HRESULT CStdStubBuffer_Construct(REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
Definition: cstub.c:58
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static const BYTE opcodes[1]
Definition: cstub.c:196
void * pvDestContext
Definition: rpcndr.h:250
DWORD offset
Definition: cstub.c:194
LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported(LPRPCSTUBBUFFER iface, REFIID riid)
Definition: cstub.c:508
const IRpcStubBufferVtbl CStdStubBuffer_Vtbl
Definition: cstub.c:538
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
WINE_DEFAULT_DEBUG_CHANNEL(ole)
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
ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
Definition: cstub.c:424
HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj)
Definition: cproxy.c:425
static const vtbl_method_t * method_blocks[MAX_BLOCKS]
Definition: cstub.c:203
const MIDL_SERVER_INFO * CStdStubBuffer_GetServerInfo(IRpcStubBuffer *iface)
Definition: cstub.c:601
ULONG BufferLength
Definition: rpcndr.h:207
#define __ENDTRY
Definition: compat.h:72
int ret
void __RPC_STUB NdrStubForwardingFunction(IRpcStubBuffer *iface, IRpcChannelBuffer *pChannel, PRPC_MESSAGE pMsg, DWORD *pdwStubPhase)
Definition: cstub.c:610
#define InterlockedDecrement
Definition: armddk.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
static IRpcStubBuffer * create_stub(IPSFactoryBuffer *ppsf, REFIID iid, IUnknown *obj, HRESULT expected_result)
Definition: cstub.c:712
LIST_ENTRY ProcessLocksList
Definition: winbase.h:848
ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface)
Definition: cstub.c:396
#define ERR(fmt,...)
Definition: debug.h:109
DWORD size
Definition: cstub.c:109
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
const char * PCInterfaceName
Definition: rpcproxy.h:42
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(LPRPCSTUBBUFFER iface, LPVOID *ppv)
Definition: cstub.c:523
#define MAX_BLOCKS
Definition: cstub.c:201
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
static ULONG WINAPI delegating_AddRef(IUnknown *pUnk)
Definition: cstub.c:123
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface, PRPCOLEMESSAGE pMsg, LPRPCCHANNELBUFFER pChannel)
Definition: cstub.c:477
static cstdstubbuffer_delegating_t * impl_from_delegating(IRpcStubBuffer *iface)
Definition: cstub.c:53
#define MEM_RELEASE
Definition: nt_native.h:1316
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
DWORD ExceptionFlags
Definition: compat.h:197
#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
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:196
#define PAGE_EXECUTE_READWRITE
Definition: nt_native.h:1308
static LONG WINAPI stub_filter(EXCEPTION_POINTERS *eptr)
Definition: cstub.c:46
interface IRpcStubBuffer * LPRPCSTUBBUFFER
Definition: objfwd.h:41
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define STUB_HEADER(This)
Definition: cstub.c:44
IUnknownVtbl vtbl
Definition: cstub.c:110
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30
#define HeapFree(x, y, z)
Definition: compat.h:394
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:90
struct IRpcChannelBuffer * pRpcChannelBuffer
Definition: rpcndr.h:253
#define SUCCEEDED(hr)
Definition: intsafe.h:57
IRpcStubBufferVtbl Vtbl
Definition: rpcproxy.h:105
HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
Definition: cstub.c:449
ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
Definition: cstub.c:403
const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl
Definition: cstub.c:587
jmp_buf jmp
Definition: mach.c:36