ReactOS  0.4.14-dev-41-g31d7680
cpsf.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StdProxyImpl
 
struct  cstdstubbuffer_delegating_t
 

Functions

HRESULT StdProxy_Construct (REFIID riid, LPUNKNOWN pUnkOuter, const ProxyFileInfo *ProxyInfo, int Index, LPPSFACTORYBUFFER pPSFactory, LPRPCPROXYBUFFER *ppProxy, LPVOID *ppvObj) DECLSPEC_HIDDEN
 
HRESULT WINAPI StdProxy_QueryInterface (IRpcProxyBuffer *iface, REFIID iid, void **obj) DECLSPEC_HIDDEN
 
ULONG WINAPI StdProxy_AddRef (IRpcProxyBuffer *iface) DECLSPEC_HIDDEN
 
HRESULT WINAPI StdProxy_Connect (IRpcProxyBuffer *iface, IRpcChannelBuffer *channel) DECLSPEC_HIDDEN
 
void WINAPI StdProxy_Disconnect (IRpcProxyBuffer *iface) DECLSPEC_HIDDEN
 
HRESULT CStdStubBuffer_Construct (REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub) DECLSPEC_HIDDEN
 
HRESULT CStdStubBuffer_Delegating_Construct (REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, REFIID delegating_iid, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub) DECLSPEC_HIDDEN
 
const MIDL_SERVER_INFOCStdStubBuffer_GetServerInfo (IRpcStubBuffer *iface) DECLSPEC_HIDDEN
 
BOOL fill_delegated_proxy_table (IUnknownVtbl *vtbl, DWORD num) DECLSPEC_HIDDEN
 
HRESULT create_proxy (REFIID iid, IUnknown *pUnkOuter, IRpcProxyBuffer **pproxy, void **ppv) DECLSPEC_HIDDEN
 
HRESULT create_stub (REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub) DECLSPEC_HIDDEN
 
BOOL fill_stubless_table (IUnknownVtbl *vtbl, DWORD num) DECLSPEC_HIDDEN
 
IUnknownVtbl * get_delegating_vtbl (DWORD num_methods) DECLSPEC_HIDDEN
 
void release_delegating_vtbl (IUnknownVtbl *vtbl) DECLSPEC_HIDDEN
 

Variables

const IRpcStubBufferVtbl CStdStubBuffer_Vtbl DECLSPEC_HIDDEN
 

Function Documentation

◆ create_proxy()

HRESULT create_proxy ( REFIID  iid,
IUnknown pUnkOuter,
IRpcProxyBuffer **  pproxy,
void **  ppv 
)

Definition at line 442 of file ndr_ole.c.

443 {
444  CLSID clsid;
445  IPSFactoryBuffer *psfac;
446  HRESULT r;
447 
448  if(!LoadCOM()) return E_FAIL;
449 
450  r = COM_GetPSClsid( iid, &clsid );
451  if(FAILED(r)) return r;
452 
453  r = COM_GetClassObject( &clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void**)&psfac );
454  if(FAILED(r)) return r;
455 
456  r = IPSFactoryBuffer_CreateProxy(psfac, pUnkOuter, iid, pproxy, ppv);
457 
458  IPSFactoryBuffer_Release(psfac);
459  return r;
460 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
static HMODULE LoadCOM(void)
Definition: ndr_ole.c:58

Referenced by StdProxy_Construct(), and typelib_proxy_init().

◆ create_stub()

HRESULT create_stub ( REFIID  iid,
IUnknown pUnk,
IRpcStubBuffer **  ppstub 
)

Definition at line 466 of file ndr_ole.c.

467 {
468  CLSID clsid;
469  IPSFactoryBuffer *psfac;
470  HRESULT r;
471 
472  if(!LoadCOM()) return E_FAIL;
473 
474  r = COM_GetPSClsid( iid, &clsid );
475  if(FAILED(r)) return r;
476 
477  r = COM_GetClassObject( &clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IPSFactoryBuffer, (void**)&psfac );
478  if(FAILED(r)) return r;
479 
480  r = IPSFactoryBuffer_CreateStub(psfac, iid, pUnk, ppstub);
481 
482  IPSFactoryBuffer_Release(psfac);
483  return r;
484 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
REFCLSID clsid
Definition: msctf.c:84
static HMODULE LoadCOM(void)
Definition: ndr_ole.c:58
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

Referenced by typelib_stub_init().

◆ CStdStubBuffer_Construct()

HRESULT CStdStubBuffer_Construct ( REFIID  riid,
LPUNKNOWN  pUnkServer,
PCInterfaceName  name,
CInterfaceStubVtbl vtbl,
LPPSFACTORYBUFFER  pPSFactory,
LPRPCSTUBBUFFER ppStub 
)

Definition at line 58 of file cstub.c.

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 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
CInterfaceStubHeader header
Definition: rpcproxy.h:104
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const IID * piid
Definition: rpcproxy.h:96
#define RPC_E_UNEXPECTED
Definition: winerror.h:2509
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
interface IRpcStubBuffer * LPRPCSTUBBUFFER
Definition: objfwd.h:41
IRpcStubBufferVtbl Vtbl
Definition: rpcproxy.h:105

Referenced by CStdPSFactory_CreateStub().

◆ CStdStubBuffer_Delegating_Construct()

HRESULT CStdStubBuffer_Delegating_Construct ( REFIID  riid,
LPUNKNOWN  pUnkServer,
PCInterfaceName  name,
CInterfaceStubVtbl vtbl,
REFIID  delegating_iid,
LPPSFACTORYBUFFER  pPSFactory,
LPRPCSTUBBUFFER ppStub 
)

Definition at line 326 of file cstub.c.

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 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
void release_delegating_vtbl(IUnknownVtbl *vtbl)
Definition: cstub.c:311
IUnknownVtbl * get_delegating_vtbl(DWORD num_methods)
Definition: cstub.c:275
CInterfaceStubHeader header
Definition: rpcproxy.h:104
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const IID * piid
Definition: rpcproxy.h:96
#define RPC_E_UNEXPECTED
Definition: winerror.h:2509
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static IRpcStubBuffer * create_stub(IPSFactoryBuffer *ppsf, REFIID iid, IUnknown *obj, HRESULT expected_result)
Definition: cstub.c:712
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
interface IRpcStubBuffer * LPRPCSTUBBUFFER
Definition: objfwd.h:41
#define HeapFree(x, y, z)
Definition: compat.h:394
IRpcStubBufferVtbl Vtbl
Definition: rpcproxy.h:105

Referenced by CStdPSFactory_CreateStub().

◆ CStdStubBuffer_GetServerInfo()

const MIDL_SERVER_INFO* CStdStubBuffer_GetServerInfo ( IRpcStubBuffer iface)

Definition at line 601 of file cstub.c.

602 {
603  CStdStubBuffer *This = (CStdStubBuffer *)iface;
604  return STUB_HEADER(This).pServerInfo;
605 }
#define STUB_HEADER(This)
Definition: cstub.c:44

Referenced by NdrStubCall2().

◆ fill_delegated_proxy_table()

BOOL fill_delegated_proxy_table ( IUnknownVtbl *  vtbl,
DWORD  num 
)

Definition at line 252 of file cstub.c.

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 }
static unsigned int block
Definition: xmlmemory.c:118
#define TRUE
Definition: types.h:120
ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:434
static const vtbl_method_t * allocate_block(unsigned int num)
Definition: cstub.c:205
#define BLOCK_SIZE
Definition: cstub.c:200
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
ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:441
#define FIXME(fmt,...)
Definition: debug.h:110
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
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
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
uint32_t entry
Definition: isohybrid.c:63
#define MAX_BLOCKS
Definition: cstub.c:201

Referenced by CreateProxyFromTypeInfo(), and init_psfactory().

◆ fill_stubless_table()

BOOL fill_stubless_table ( IUnknownVtbl *  vtbl,
DWORD  num 
)

Definition at line 241 of file cproxy.c.

242 {
243  const void **entry = (const void **)(vtbl + 1);
244  DWORD i, j;
245 
246  if (num - 3 > BLOCK_SIZE * MAX_BLOCKS)
247  {
248  FIXME( "%u methods not supported\n", num );
249  return FALSE;
250  }
251  for (i = 0; i < (num - 3 + BLOCK_SIZE - 1) / BLOCK_SIZE; i++)
252  {
253  const struct thunk *block = method_blocks[i];
254  if (!block && !(block = allocate_block( i ))) return FALSE;
255  for (j = 0; j < BLOCK_SIZE && j < num - 3 - i * BLOCK_SIZE; j++, entry++)
256  if (*entry == (LPVOID)-1) *entry = &block[j];
257  }
258  return TRUE;
259 }
static unsigned int block
Definition: xmlmemory.c:118
#define TRUE
Definition: types.h:120
Definition: cproxy.c:203
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
#define FIXME(fmt,...)
Definition: debug.h:110
static const struct thunk * allocate_block(unsigned int num)
Definition: cproxy.c:220
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
#define BLOCK_SIZE
Definition: cproxy.c:215
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint num
Definition: glext.h:9618
uint32_t entry
Definition: isohybrid.c:63
static const struct thunk * method_blocks[MAX_BLOCKS]
Definition: cproxy.c:218
#define MAX_BLOCKS
Definition: cproxy.c:216

Referenced by StdProxy_Construct(), and typelib_proxy_init().

◆ get_delegating_vtbl()

IUnknownVtbl* get_delegating_vtbl ( DWORD  num_methods)

Definition at line 275 of file cstub.c.

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 }
static ref_counted_vtbl * current_vtbl
Definition: cstub.c:114
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION delegating_vtbl_section
Definition: cstub.c:97
smooth NULL
Definition: ftsmooth.c:416
static BOOL fill_delegated_stub_table(IUnknownVtbl *vtbl, DWORD num)
Definition: cstub.c:230
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int ret
DWORD size
Definition: cstub.c:109
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
IUnknownVtbl vtbl
Definition: cstub.c:110
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by CStdStubBuffer_Delegating_Construct(), and typelib_stub_init().

◆ release_delegating_vtbl()

void release_delegating_vtbl ( IUnknownVtbl *  vtbl)

Definition at line 311 of file cstub.c.

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 }
static ref_counted_vtbl * current_vtbl
Definition: cstub.c:114
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
static CRITICAL_SECTION delegating_vtbl_section
Definition: cstub.c:97
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
unsigned long DWORD
Definition: ntddk_ex.h:95
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by CStdStubBuffer_Delegating_Construct(), NdrCStdStubBuffer2_Release(), typelib_stub_init(), and typelib_stub_Release().

◆ StdProxy_AddRef()

ULONG WINAPI StdProxy_AddRef ( IRpcProxyBuffer iface)

Definition at line 346 of file cproxy.c.

347 {
349  TRACE("(%p)->AddRef()\n",This);
350 
351  return InterlockedIncrement(&This->RefCount);
352 }
#define TRACE(s)
Definition: solgame.cpp:4
static StdProxyImpl * impl_from_IRpcProxyBuffer(IRpcProxyBuffer *iface)
Definition: cproxy.c:45
#define InterlockedIncrement
Definition: armddk.h:53

◆ StdProxy_Connect()

HRESULT WINAPI StdProxy_Connect ( IRpcProxyBuffer iface,
IRpcChannelBuffer channel 
)

Definition at line 376 of file cproxy.c.

377 {
379  TRACE("(%p)->Connect(%p)\n",This,pChannel);
380 
381  This->pChannel = pChannel;
382  IRpcChannelBuffer_AddRef(pChannel);
383  if (This->base_proxy) IRpcProxyBuffer_Connect( This->base_proxy, pChannel );
384  return S_OK;
385 }
#define TRACE(s)
Definition: solgame.cpp:4
static StdProxyImpl * impl_from_IRpcProxyBuffer(IRpcProxyBuffer *iface)
Definition: cproxy.c:45
#define S_OK
Definition: intsafe.h:59

◆ StdProxy_Construct()

HRESULT StdProxy_Construct ( REFIID  riid,
LPUNKNOWN  pUnkOuter,
const ProxyFileInfo ProxyInfo,
int  Index,
LPPSFACTORYBUFFER  pPSFactory,
LPRPCPROXYBUFFER ppProxy,
LPVOID ppvObj 
)

Definition at line 261 of file cproxy.c.

268 {
270  PCInterfaceName name = ProxyInfo->pNamesArray[Index];
271  CInterfaceProxyVtbl *vtbl = ProxyInfo->pProxyVtblList[Index];
272 
273  TRACE("(%p,%p,%p,%p,%p) %s\n", pUnkOuter, vtbl, pPSFactory, ppProxy, ppvObj, name);
274 
275  /* TableVersion = 2 means it is the stubless version of CInterfaceProxyVtbl */
276  if (ProxyInfo->TableVersion > 1) {
278  vtbl = (CInterfaceProxyVtbl *)((const void **)vtbl + 1);
279  TRACE("stubless vtbl %p: count=%d\n", vtbl->Vtbl, count );
280  fill_stubless_table( (IUnknownVtbl *)vtbl->Vtbl, count );
281  }
282 
283  if (!IsEqualGUID(vtbl->header.piid, riid)) {
284  ERR("IID mismatch during proxy creation\n");
285  return RPC_E_UNEXPECTED;
286  }
287 
289  if (!This) return E_OUTOFMEMORY;
290 
291  if (!pUnkOuter) pUnkOuter = (IUnknown *)This;
292  This->IRpcProxyBuffer_iface.lpVtbl = &StdProxy_Vtbl;
293  This->PVtbl = vtbl->Vtbl;
294  /* one reference for the proxy */
295  This->RefCount = 1;
296  This->piid = vtbl->header.piid;
297  This->base_object = NULL;
298  This->base_proxy = NULL;
299  This->pUnkOuter = pUnkOuter;
300  This->name = name;
301  This->pPSFactory = pPSFactory;
302  This->pChannel = NULL;
303 
304  if(ProxyInfo->pDelegatedIIDs && ProxyInfo->pDelegatedIIDs[Index])
305  {
306  HRESULT r = create_proxy( ProxyInfo->pDelegatedIIDs[Index], NULL,
307  &This->base_proxy, (void **)&This->base_object );
308  if (FAILED(r))
309  {
310  HeapFree( GetProcessHeap(), 0, This );
311  return r;
312  }
313  }
314 
315  *ppProxy = &This->IRpcProxyBuffer_iface;
316  *ppvObj = &This->PVtbl;
317  IUnknown_AddRef((IUnknown *)*ppvObj);
318  IPSFactoryBuffer_AddRef(pPSFactory);
319 
320  TRACE( "iid=%s this %p proxy %p obj %p vtbl %p base proxy %p base obj %p\n",
321  debugstr_guid(riid), This, *ppProxy, *ppvObj, This->PVtbl, This->base_proxy, This->base_object );
322  return S_OK;
323 }
REFIID riid
Definition: precomp.h:44
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint GLsizei count
Definition: gl.h:1545
static const IRpcProxyBufferVtbl StdProxy_Vtbl
Definition: cproxy.c:43
unsigned short TableVersion
Definition: rpcproxy.h:54
const PCInterfaceName * pNamesArray
Definition: rpcproxy.h:50
CInterfaceStubHeader header
Definition: rpcproxy.h:104
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
BOOL fill_stubless_table(IUnknownVtbl *vtbl, DWORD num)
Definition: cproxy.c:241
#define RPC_E_UNEXPECTED
Definition: winerror.h:2509
const PCInterfaceStubVtblList * pStubVtblList
Definition: rpcproxy.h:49
#define debugstr_guid
Definition: kernel32.h:35
CInterfaceProxyHeader header
Definition: rpcproxy.h:80
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static const UCHAR Index[8]
Definition: usbohci.c:18
#define ERR(fmt,...)
Definition: debug.h:109
const PCInterfaceProxyVtblList * pProxyVtblList
Definition: rpcproxy.h:48
#define S_OK
Definition: intsafe.h:59
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:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
Definition: name.c:36
unsigned int ULONG
Definition: retypes.h:1
#define HeapFree(x, y, z)
Definition: compat.h:394
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by CStdPSFactory_CreateProxy().

◆ StdProxy_Disconnect()

void WINAPI StdProxy_Disconnect ( IRpcProxyBuffer iface)

Definition at line 387 of file cproxy.c.

388 {
390  TRACE("(%p)->Disconnect()\n",This);
391 
392  if (This->base_proxy) IRpcProxyBuffer_Disconnect( This->base_proxy );
393 
394  IRpcChannelBuffer_Release(This->pChannel);
395  This->pChannel = NULL;
396 }
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static StdProxyImpl * impl_from_IRpcProxyBuffer(IRpcProxyBuffer *iface)
Definition: cproxy.c:45

◆ StdProxy_QueryInterface()

HRESULT WINAPI StdProxy_QueryInterface ( IRpcProxyBuffer iface,
REFIID  iid,
void **  obj 
)

Definition at line 325 of file cproxy.c.

326 {
328  TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj);
329 
330  if (IsEqualGUID(&IID_IUnknown,riid) ||
331  IsEqualGUID(This->piid,riid)) {
332  *obj = &This->PVtbl;
333  InterlockedIncrement(&This->RefCount);
334  return S_OK;
335  }
336 
337  if (IsEqualGUID(&IID_IRpcProxyBuffer,riid)) {
338  *obj = &This->IRpcProxyBuffer_iface;
339  InterlockedIncrement(&This->RefCount);
340  return S_OK;
341  }
342 
343  return E_NOINTERFACE;
344 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static StdProxyImpl * impl_from_IRpcProxyBuffer(IRpcProxyBuffer *iface)
Definition: cproxy.c:45
#define S_OK
Definition: intsafe.h:59
#define InterlockedIncrement
Definition: armddk.h:53
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

Variable Documentation

◆ DECLSPEC_HIDDEN

const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl DECLSPEC_HIDDEN

Definition at line 66 of file cpsf.h.