ReactOS 0.4.16-dev-1946-g52006dd
cstub.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "excpt.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "wine/debug.h"
#include "wine/asm.h"
#include "wine/exception.h"
#include "cpsf.h"
Include dependency graph for cstub.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static LONG WINAPI stub_filter (EXCEPTION_POINTERS *eptr)
 
static CStdStubBufferimpl_from_IRpcStubBuffer (IRpcStubBuffer *iface)
 
static cstdstubbuffer_delegating_timpl_from_delegating (IRpcStubBuffer *iface)
 
static const CInterfaceStubHeaderget_stub_header (const CStdStubBuffer *stub)
 
HRESULT CStdStubBuffer_Construct (REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
 
BOOL fill_delegated_proxy_table (IUnknownVtbl *vtbl, DWORD num)
 
const IUnknownVtbl * get_delegating_vtbl (DWORD num)
 
HRESULT CStdStubBuffer_Delegating_Construct (REFIID riid, LPUNKNOWN pUnkServer, PCInterfaceName name, CInterfaceStubVtbl *vtbl, REFIID delegating_iid, LPPSFACTORYBUFFER pPSFactory, LPRPCSTUBBUFFER *ppStub)
 
HRESULT WINAPI CStdStubBuffer_QueryInterface (LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *obj)
 
ULONG WINAPI CStdStubBuffer_AddRef (LPRPCSTUBBUFFER iface)
 
ULONG WINAPI NdrCStdStubBuffer_Release (LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
 
ULONG WINAPI NdrCStdStubBuffer2_Release (LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
 
HRESULT WINAPI CStdStubBuffer_Connect (LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
 
void WINAPI CStdStubBuffer_Disconnect (LPRPCSTUBBUFFER iface)
 
HRESULT WINAPI CStdStubBuffer_Invoke (LPRPCSTUBBUFFER iface, PRPCOLEMESSAGE pMsg, LPRPCCHANNELBUFFER pChannel)
 
LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported (LPRPCSTUBBUFFER iface, REFIID riid)
 
ULONG WINAPI CStdStubBuffer_CountRefs (LPRPCSTUBBUFFER iface)
 
HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface (LPRPCSTUBBUFFER iface, LPVOID *ppv)
 
void WINAPI CStdStubBuffer_DebugServerRelease (LPRPCSTUBBUFFER iface, LPVOID pv)
 
static HRESULT WINAPI CStdStubBuffer_Delegating_Connect (LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
 
static void WINAPI CStdStubBuffer_Delegating_Disconnect (LPRPCSTUBBUFFER iface)
 
static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs (LPRPCSTUBBUFFER iface)
 
const MIDL_SERVER_INFOCStdStubBuffer_GetServerInfo (IRpcStubBuffer *iface)
 
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 NdrStubGetBuffer (LPRPCSTUBBUFFER iface, LPRPCCHANNELBUFFER pRpcChannelBuffer, PMIDL_STUB_MESSAGE pStubMsg)
 

Variables

const IRpcStubBufferVtbl CStdStubBuffer_Vtbl
 
const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file cstub.c.

Function Documentation

◆ CStdStubBuffer_AddRef()

ULONG WINAPI CStdStubBuffer_AddRef ( LPRPCSTUBBUFFER  iface)

Definition at line 203 of file cstub.c.

204{
206 TRACE("(%p)->AddRef()\n",This);
207 return InterlockedIncrement(&This->RefCount);
208}
#define InterlockedIncrement
Definition: armddk.h:53
static CStdStubBuffer * impl_from_IRpcStubBuffer(IRpcStubBuffer *iface)
Definition: cstub.c:49
#define TRACE(s)
Definition: solgame.cpp:4

◆ CStdStubBuffer_Connect()

HRESULT WINAPI CStdStubBuffer_Connect ( LPRPCSTUBBUFFER  iface,
LPUNKNOWN  lpUnkServer 
)

Definition at line 254 of file cstub.c.

256{
258 HRESULT r;
259 IUnknown *new = NULL;
260
261 TRACE("(%p)->Connect(%p)\n",This,lpUnkServer);
262
263 r = IUnknown_QueryInterface(lpUnkServer, get_stub_header(This)->piid, (void**)&new);
264 new = InterlockedExchangePointer((void**)&This->pvServerObject, new);
265 if(new)
266 IUnknown_Release(new);
267 return r;
268}
#define NULL
Definition: types.h:112
static const CInterfaceStubHeader * get_stub_header(const CStdStubBuffer *stub)
Definition: cstub.c:59
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

Referenced by CStdStubBuffer_Delegating_Connect().

◆ CStdStubBuffer_Construct()

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

Definition at line 66 of file cstub.c.

72{
74 IUnknown *pvServer;
75 HRESULT r;
76 TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name);
77 TRACE("iid=%s\n", debugstr_guid(vtbl->header.piid));
78 TRACE("vtbl=%p\n", &vtbl->Vtbl);
79
80 if (!IsEqualGUID(vtbl->header.piid, riid)) {
81 ERR("IID mismatch during stub creation\n");
82 return RPC_E_UNEXPECTED;
83 }
84
85 r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer);
86 if(FAILED(r))
87 return r;
88
89 This = calloc(1, sizeof(CStdStubBuffer));
90 if (!This) {
91 IUnknown_Release(pvServer);
92 return E_OUTOFMEMORY;
93 }
94
95 This->lpVtbl = &vtbl->Vtbl;
96 This->RefCount = 1;
97 This->pvServerObject = pvServer;
98 This->pPSFactory = pPSFactory;
99 *ppStub = (LPRPCSTUBBUFFER)This;
100
101 IPSFactoryBuffer_AddRef(pPSFactory);
102 return S_OK;
103}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
REFIID riid
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
interface IRpcStubBuffer * LPRPCSTUBBUFFER
Definition: objfwd.h:41
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define calloc
Definition: rosglue.h:14
Definition: name.c:39
const IID * piid
Definition: rpcproxy.h:91
CInterfaceStubHeader header
Definition: rpcproxy.h:99
IRpcStubBufferVtbl Vtbl
Definition: rpcproxy.h:100
#define RPC_E_UNEXPECTED
Definition: winerror.h:3612

Referenced by CStdPSFactory_CreateStub().

◆ CStdStubBuffer_CountRefs()

ULONG WINAPI CStdStubBuffer_CountRefs ( LPRPCSTUBBUFFER  iface)

Definition at line 326 of file cstub.c.

327{
329 TRACE("(%p)->CountRefs()\n",This);
330 return This->RefCount;
331}

Referenced by CStdStubBuffer_Delegating_CountRefs().

◆ CStdStubBuffer_DebugServerQueryInterface()

HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface ( LPRPCSTUBBUFFER  iface,
LPVOID ppv 
)

Definition at line 333 of file cstub.c.

335{
337 TRACE("(%p)->DebugServerQueryInterface(%p)\n",This,ppv);
338 return S_OK;
339}
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ CStdStubBuffer_DebugServerRelease()

void WINAPI CStdStubBuffer_DebugServerRelease ( LPRPCSTUBBUFFER  iface,
LPVOID  pv 
)

Definition at line 341 of file cstub.c.

343{
345 TRACE("(%p)->DebugServerRelease(%p)\n",This,pv);
346}

◆ CStdStubBuffer_Delegating_Connect()

static HRESULT WINAPI CStdStubBuffer_Delegating_Connect ( LPRPCSTUBBUFFER  iface,
LPUNKNOWN  lpUnkServer 
)
static

Definition at line 362 of file cstub.c.

364{
366 HRESULT r;
367 TRACE("(%p)->Connect(%p)\n", This, lpUnkServer);
368
369 r = CStdStubBuffer_Connect(iface, lpUnkServer);
370 if(SUCCEEDED(r))
371 r = IRpcStubBuffer_Connect(This->base_stub, (IUnknown*)&This->base_obj);
372
373 return r;
374}
static cstdstubbuffer_delegating_t * impl_from_delegating(IRpcStubBuffer *iface)
Definition: cstub.c:54
HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
Definition: cstub.c:254
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ 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 134 of file cstub.c.

141{
143 IUnknown *pvServer;
144 HRESULT r;
145
146 TRACE("(%p,%p,%p,%p) %s\n", pUnkServer, vtbl, pPSFactory, ppStub, name);
147 TRACE("iid=%s delegating to %s\n", debugstr_guid(vtbl->header.piid), debugstr_guid(delegating_iid));
148 TRACE("vtbl=%p\n", &vtbl->Vtbl);
149
150 if (!IsEqualGUID(vtbl->header.piid, riid))
151 {
152 ERR("IID mismatch during stub creation\n");
153 return RPC_E_UNEXPECTED;
154 }
155
156 r = IUnknown_QueryInterface(pUnkServer, riid, (void**)&pvServer);
157 if(FAILED(r)) return r;
158
159 This = calloc(1, sizeof(*This));
160 if (!This)
161 {
162 IUnknown_Release(pvServer);
163 return E_OUTOFMEMORY;
164 }
165
166 This->base_obj.lpVtbl = get_delegating_vtbl( vtbl->header.DispatchTableCount );
167 r = create_stub(delegating_iid, &This->base_obj, &This->base_stub);
168 if(FAILED(r))
169 {
170 free(This);
171 IUnknown_Release(pvServer);
172 return r;
173 }
174
175 This->stub_buffer.lpVtbl = &vtbl->Vtbl;
176 This->stub_buffer.RefCount = 1;
177 This->stub_buffer.pvServerObject = pvServer;
178 This->stub_buffer.pPSFactory = pPSFactory;
179 *ppStub = (LPRPCSTUBBUFFER)&This->stub_buffer;
180
181 IPSFactoryBuffer_AddRef(pPSFactory);
182 return S_OK;
183}
HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub)
Definition: ndr_ole.c:430
#define free
Definition: debug_ros.c:5
const IUnknownVtbl * get_delegating_vtbl(DWORD num)
Definition: cstub.c:124

Referenced by CStdPSFactory_CreateStub().

◆ CStdStubBuffer_Delegating_CountRefs()

static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs ( LPRPCSTUBBUFFER  iface)
static

Definition at line 385 of file cstub.c.

386{
388 ULONG ret;
389 TRACE("(%p)->CountRefs()\n", This);
390
392 ret += IRpcStubBuffer_CountRefs(This->base_stub);
393
394 return ret;
395}
ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface)
Definition: cstub.c:326
return ret
Definition: mutex.c:146
uint32_t ULONG
Definition: typedefs.h:59

◆ CStdStubBuffer_Delegating_Disconnect()

static void WINAPI CStdStubBuffer_Delegating_Disconnect ( LPRPCSTUBBUFFER  iface)
static

Definition at line 376 of file cstub.c.

377{
379 TRACE("(%p)->Disconnect()\n", This);
380
381 IRpcStubBuffer_Disconnect(This->base_stub);
383}
void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface)
Definition: cstub.c:270

◆ CStdStubBuffer_Disconnect()

void WINAPI CStdStubBuffer_Disconnect ( LPRPCSTUBBUFFER  iface)

Definition at line 270 of file cstub.c.

271{
273 IUnknown *old;
274 TRACE("(%p)->Disconnect()\n",This);
275
276 old = InterlockedExchangePointer((void**)&This->pvServerObject, NULL);
277
278 if(old)
279 IUnknown_Release(old);
280}

Referenced by CStdStubBuffer_Delegating_Disconnect().

◆ CStdStubBuffer_GetServerInfo()

const MIDL_SERVER_INFO * CStdStubBuffer_GetServerInfo ( IRpcStubBuffer iface)

Definition at line 411 of file cstub.c.

412{
414
416}
Definition: stubgen.c:11
const MIDL_SERVER_INFO * pServerInfo
Definition: rpcproxy.h:92

Referenced by NdrStubCall2().

◆ CStdStubBuffer_Invoke()

HRESULT WINAPI CStdStubBuffer_Invoke ( LPRPCSTUBBUFFER  iface,
PRPCOLEMESSAGE  pMsg,
LPRPCCHANNELBUFFER  pChannel 
)

Definition at line 282 of file cstub.c.

285{
288 DWORD dwPhase = STUB_UNMARSHAL;
289 HRESULT hr = S_OK;
290
291 TRACE("(%p)->Invoke(%p,%p)\n",This,pMsg,pChannel);
292
293 __TRY
294 {
295 if (header->pDispatchTable)
296 header->pDispatchTable[pMsg->iMethod](iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
297 else /* pure interpreted */
298 NdrStubCall2(iface, pChannel, (PRPC_MESSAGE)pMsg, &dwPhase);
299 }
301 {
302 DWORD dwExceptionCode = GetExceptionCode();
303 WARN("a stub call failed with exception 0x%08lx (%ld)\n", dwExceptionCode, dwExceptionCode);
304 if (FAILED(dwExceptionCode))
305 hr = dwExceptionCode;
306 else
307 hr = HRESULT_FROM_WIN32(dwExceptionCode);
308 }
310
311 return hr;
312}
#define WARN(fmt,...)
Definition: precomp.h:61
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
static LONG WINAPI stub_filter(EXCEPTION_POINTERS *eptr)
Definition: cstub.c:42
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GetExceptionCode
Definition: excpt.h:83
LONG WINAPI NdrStubCall2(struct IRpcStubBuffer *pThis, struct IRpcChannelBuffer *pChannel, PRPC_MESSAGE pRpcMsg, DWORD *pdwStubPhase)
struct _RPC_MESSAGE * PRPC_MESSAGE
@ STUB_UNMARSHAL
Definition: rpcndr.h:484
HRESULT hr
Definition: shlfolder.c:183
#define __EXCEPT(func)
Definition: exception.h:62
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

◆ CStdStubBuffer_IsIIDSupported()

LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported ( LPRPCSTUBBUFFER  iface,
REFIID  riid 
)

Definition at line 314 of file cstub.c.

316{
318
319 TRACE("(%p)->IsIIDSupported(%s)\n", stub, debugstr_guid(riid));
320
322 return iface;
323 return NULL;
324}

◆ CStdStubBuffer_QueryInterface()

HRESULT WINAPI CStdStubBuffer_QueryInterface ( LPRPCSTUBBUFFER  iface,
REFIID  riid,
LPVOID obj 
)

Definition at line 185 of file cstub.c.

188{
190 TRACE("(%p)->QueryInterface(%s,%p)\n",This,debugstr_guid(riid),obj);
191
193 IsEqualIID(&IID_IRpcStubBuffer, riid))
194 {
195 IRpcStubBuffer_AddRef(iface);
196 *obj = iface;
197 return S_OK;
198 }
199 *obj = NULL;
200 return E_NOINTERFACE;
201}
const GUID IID_IUnknown
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ fill_delegated_proxy_table()

BOOL fill_delegated_proxy_table ( IUnknownVtbl *  vtbl,
DWORD  num 
)

Definition at line 106 of file cstub.c.

107{
108 const void **entry = (const void **)(vtbl + 1);
109 DWORD i;
110
111 if (num > NB_THUNK_ENTRIES)
112 {
113 FIXME( "%lu methods not supported\n", num );
114 return FALSE;
115 }
116 vtbl->QueryInterface = IUnknown_QueryInterface_Proxy;
118 vtbl->Release = IUnknown_Release_Proxy;
119 for (i = 0; i < num - 3; i++)
121 return TRUE;
122}
#define FIXME(fmt,...)
Definition: precomp.h:53
ULONG WINAPI IUnknown_AddRef_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:249
ULONG WINAPI IUnknown_Release_Proxy(LPUNKNOWN iface)
Definition: cproxy.c:256
HRESULT WINAPI IUnknown_QueryInterface_Proxy(LPUNKNOWN iface, REFIID riid, LPVOID *ppvObj)
Definition: cproxy.c:240
#define NB_THUNK_ENTRIES
Definition: cpsf.h:74
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLuint GLuint num
Definition: glext.h:9618
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 AddRef()
uint32_t entry
Definition: isohybrid.c:63
const void * methods[NB_THUNK_ENTRIES - 3]
Definition: cpsf.h:79

Referenced by CreateProxyFromTypeInfo(), and init_psfactory().

◆ get_delegating_vtbl()

const IUnknownVtbl * get_delegating_vtbl ( DWORD  num)

Definition at line 124 of file cstub.c.

125{
126 if (num > NB_THUNK_ENTRIES)
127 {
128 FIXME( "%lu methods not supported\n", num );
129 return NULL;
130 }
131 return &delegating_vtbl.vtbl;
132}
IUnknownVtbl vtbl
Definition: cpsf.h:78

Referenced by CStdStubBuffer_Delegating_Construct(), and typelib_stub_init().

◆ get_stub_header()

static const CInterfaceStubHeader * get_stub_header ( const CStdStubBuffer stub)
static

Definition at line 59 of file cstub.c.

60{
61 const CInterfaceStubVtbl *vtbl = CONTAINING_RECORD(stub->lpVtbl, CInterfaceStubVtbl, Vtbl);
62
63 return &vtbl->header;
64}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by CStdStubBuffer_Connect(), CStdStubBuffer_GetServerInfo(), CStdStubBuffer_Invoke(), CStdStubBuffer_IsIIDSupported(), and NdrStubGetBuffer().

◆ impl_from_delegating()

◆ impl_from_IRpcStubBuffer()

◆ NdrCStdStubBuffer2_Release()

ULONG WINAPI NdrCStdStubBuffer2_Release ( LPRPCSTUBBUFFER  iface,
LPPSFACTORYBUFFER  pPSF 
)

Definition at line 231 of file cstub.c.

233{
235 ULONG refs;
236
237 TRACE("(%p)->Release()\n", This);
238
239 refs = InterlockedDecrement(&This->stub_buffer.RefCount);
240 if (!refs)
241 {
242 /* Just like NdrCStdStubBuffer_Release, we shouldn't call
243 Disconnect here */
244 IRpcStubBuffer_Disconnect((IRpcStubBuffer *)&This->stub_buffer);
245
246 IRpcStubBuffer_Release(This->base_stub);
247 IPSFactoryBuffer_Release(pPSF);
248 free(This);
249 }
250
251 return refs;
252}
#define InterlockedDecrement
Definition: armddk.h:52

Referenced by test_CStdStubBuffer2_Release().

◆ NdrCStdStubBuffer_Release()

ULONG WINAPI NdrCStdStubBuffer_Release ( LPRPCSTUBBUFFER  iface,
LPPSFACTORYBUFFER  pPSF 
)

Definition at line 210 of file cstub.c.

212{
214 ULONG refs;
215
216 TRACE("(%p)->Release()\n",This);
217
218 refs = InterlockedDecrement(&This->RefCount);
219 if (!refs)
220 {
221 /* test_Release shows that native doesn't call Disconnect here.
222 We'll leave it in for the time being. */
223 IRpcStubBuffer_Disconnect(iface);
224
225 IPSFactoryBuffer_Release(pPSF);
226 free(This);
227 }
228 return refs;
229}

Referenced by test_CStdStubBuffer_Release(), and test_Release().

◆ NdrStubForwardingFunction()

void __RPC_STUB NdrStubForwardingFunction ( IRpcStubBuffer iface,
IRpcChannelBuffer pChannel,
PRPC_MESSAGE  pMsg,
DWORD pdwStubPhase 
)

Definition at line 421 of file cstub.c.

423{
424 /* Note pMsg is passed intact since RPCOLEMESSAGE is basically a RPC_MESSAGE. */
425
427 HRESULT r = IRpcStubBuffer_Invoke(This->base_stub, (RPCOLEMESSAGE*)pMsg, pChannel);
429 return;
430}
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:213

Referenced by CreateStubFromTypeInfo(), and test_NdrStubForwardingFunction().

◆ NdrStubGetBuffer()

void WINAPI NdrStubGetBuffer ( LPRPCSTUBBUFFER  iface,
LPRPCCHANNELBUFFER  pRpcChannelBuffer,
PMIDL_STUB_MESSAGE  pStubMsg 
)

Definition at line 451 of file cstub.c.

454{
456 HRESULT hr;
457
458 TRACE("(%p, %p, %p)\n", This, pRpcChannelBuffer, pStubMsg);
459
460 pStubMsg->RpcMsg->BufferLength = pStubMsg->BufferLength;
461 hr = IRpcChannelBuffer_GetBuffer(pRpcChannelBuffer,
462 (RPCOLEMESSAGE *)pStubMsg->RpcMsg, get_stub_header(This)->piid);
463 if (FAILED(hr))
464 {
466 return;
467 }
468
469 pStubMsg->Buffer = pStubMsg->RpcMsg->Buffer;
470}
unsigned char * Buffer
Definition: rpcndr.h:186
ULONG BufferLength
Definition: rpcndr.h:190
PRPC_MESSAGE RpcMsg
Definition: rpcndr.h:185
unsigned int BufferLength
Definition: rpcdcep.h:41
void * Buffer
Definition: rpcdcep.h:40

Referenced by NdrStubCall2().

◆ NdrStubInitialize()

void WINAPI NdrStubInitialize ( PRPC_MESSAGE  pRpcMsg,
PMIDL_STUB_MESSAGE  pStubMsg,
PMIDL_STUB_DESC  pStubDescriptor,
LPRPCCHANNELBUFFER  pRpcChannelBuffer 
)

Definition at line 435 of file cstub.c.

439{
440 TRACE("(%p,%p,%p,%p)\n", pRpcMsg, pStubMsg, pStubDescriptor, pRpcChannelBuffer);
441 NdrServerInitializeNew(pRpcMsg, pStubMsg, pStubDescriptor);
442 pStubMsg->pRpcChannelBuffer = pRpcChannelBuffer;
443 IRpcChannelBuffer_GetDestCtx(pStubMsg->pRpcChannelBuffer,
444 &pStubMsg->dwDestContext,
445 &pStubMsg->pvDestContext);
446}
unsigned char *WINAPI NdrServerInitializeNew(PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc)
void * pvDestContext
Definition: rpcndr.h:233
struct IRpcChannelBuffer * pRpcChannelBuffer
Definition: rpcndr.h:236
DWORD dwDestContext
Definition: rpcndr.h:232

Referenced by NdrStubCall2().

◆ stub_filter()

static LONG WINAPI stub_filter ( EXCEPTION_POINTERS eptr)
static

Definition at line 42 of file cstub.c.

43{
47}
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:91
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
DWORD ExceptionFlags
Definition: compat.h:209
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23

Referenced by CStdStubBuffer_Invoke().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ CStdStubBuffer_Delegating_Vtbl

const IRpcStubBufferVtbl CStdStubBuffer_Delegating_Vtbl
Initial value:
=
{
}
static void WINAPI CStdStubBuffer_Delegating_Disconnect(LPRPCSTUBBUFFER iface)
Definition: cstub.c:376
void WINAPI CStdStubBuffer_DebugServerRelease(LPRPCSTUBBUFFER iface, LPVOID pv)
Definition: cstub.c:341
HRESULT WINAPI CStdStubBuffer_QueryInterface(LPRPCSTUBBUFFER iface, REFIID riid, LPVOID *obj)
Definition: cstub.c:185
ULONG WINAPI CStdStubBuffer_AddRef(LPRPCSTUBBUFFER iface)
Definition: cstub.c:203
static ULONG WINAPI CStdStubBuffer_Delegating_CountRefs(LPRPCSTUBBUFFER iface)
Definition: cstub.c:385
static HRESULT WINAPI CStdStubBuffer_Delegating_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
Definition: cstub.c:362
LPRPCSTUBBUFFER WINAPI CStdStubBuffer_IsIIDSupported(LPRPCSTUBBUFFER iface, REFIID riid)
Definition: cstub.c:314
HRESULT WINAPI CStdStubBuffer_Invoke(LPRPCSTUBBUFFER iface, PRPCOLEMESSAGE pMsg, LPRPCCHANNELBUFFER pChannel)
Definition: cstub.c:282
HRESULT WINAPI CStdStubBuffer_DebugServerQueryInterface(LPRPCSTUBBUFFER iface, LPVOID *ppv)
Definition: cstub.c:333

Definition at line 397 of file cstub.c.

Referenced by CreateStubFromTypeInfo(), and init_psfactory().

◆ CStdStubBuffer_Vtbl