ReactOS 0.4.16-dev-1946-g52006dd
cstub.c File Reference
#include <stdarg.h>
#include <stdio.h>
#include <windef.h>
#include <winbase.h>
#include <winnt.h>
#include <winerror.h>
#include "initguid.h"
#include <ole2.h>
#include "rpc.h"
#include "rpcdce.h"
#include "rpcproxy.h"
#include "wine/test.h"
#include "cstub_p.h"
Include dependency graph for cstub.c:

Go to the source code of this file.

Classes

struct  _MIDL_PROC_FORMAT_STRING
 
struct  _MIDL_TYPE_FORMAT_STRING
 
struct  dummy_unknown
 
struct  tagChannelBufferRefCount
 

Macros

#define COBJMACROS
 
#define cstub_CHECK_IID(n)   IID_GENERIC_CHECK_IID( cstub, pIID, n)
 
#define VTBL_TEST_NOT_CHANGE_TO(name, i)
 
#define VTBL_TEST_CHANGE_TO(name, i)
 
#define VTBL_TEST_ZERO(name, i)
 
#define VTBL_PROXY_TEST(i, num, ptr)
 
#define VTBL_PROXY_TEST_NOT_ZERO(i, num)    ok( proxy_vtbl[i]->Vtbl[num] != NULL, "wrong proxy %u func %u is NULL\n", (i), (num))
 

Typedefs

typedef struct _MIDL_PROC_FORMAT_STRING MIDL_PROC_FORMAT_STRING
 
typedef struct _MIDL_TYPE_FORMAT_STRING MIDL_TYPE_FORMAT_STRING
 
typedef struct tagChannelBufferRefCount CChannelBufferRefCount
 

Functions

static ULONG WINAPI test_CStdStubBuffer_Release (IRpcStubBuffer *This)
 
static ULONG WINAPI test_CStdStubBuffer2_Release (IRpcStubBuffer *This)
 
static void *CALLBACK my_alloc (SIZE_T size)
 
static void CALLBACK my_free (void *ptr)
 
static HRESULT WINAPI if1_fn1_Proxy (void *This)
 
static void __RPC_STUB if1_fn1_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
 
static HRESULT WINAPI if1_fn2_Proxy (void *This)
 
static void __RPC_STUB if1_fn2_Stub (IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
 
static CINTERFACE_PROXY_VTABLE (5)
 
static CINTERFACE_PROXY_VTABLE (13)
 
static CINTERFACE_PROXY_VTABLE (7)
 
static int __stdcall iid_lookup (const IID *pIID, int *pIndex)
 
static BOOL check_address (void *actual, void *expected)
 
static IPSFactoryBuffertest_NdrDllGetClassObject (void)
 
static HRESULT WINAPI base_buffer_Invoke (IRpcStubBuffer *This, RPCOLEMESSAGE *msg, IRpcChannelBuffer *channel)
 
static void test_NdrStubForwardingFunction (void)
 
static IRpcStubBuffercreate_stub (IPSFactoryBuffer *ppsf, REFIID iid, IUnknown *obj, HRESULT expected_result)
 
static HRESULT WINAPI create_stub_test_QI (IUnknown *This, REFIID iid, void **ppv)
 
static HRESULT WINAPI create_stub_test_fail_QI (IUnknown *This, REFIID iid, void **ppv)
 
static struct dummy_unknownimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI dummy_QueryInterface (IUnknown *This, REFIID iid, void **ppv)
 
static ULONG WINAPI dummy_AddRef (LPUNKNOWN iface)
 
static ULONG WINAPI dummy_Release (LPUNKNOWN iface)
 
static void create_proxy_test (IPSFactoryBuffer *ppsf, REFIID iid, const void *expected_vtbl)
 
static void test_CreateProxy (IPSFactoryBuffer *ppsf)
 
static void test_CreateStub (IPSFactoryBuffer *ppsf)
 
static HRESULT WINAPI connect_test_orig_QI (IUnknown *This, REFIID iid, void **ppv)
 
static ULONG WINAPI connect_test_orig_release (IUnknown *This)
 
static HRESULT WINAPI connect_test_new_QI (IUnknown *This, REFIID iid, void **ppv)
 
static HRESULT WINAPI connect_test_new_fail_QI (IUnknown *This, REFIID iid, void **ppv)
 
static HRESULT WINAPI connect_test_base_Connect (IRpcStubBuffer *pstub, IUnknown *obj)
 
static void test_Connect (IPSFactoryBuffer *ppsf)
 
static void test_Disconnect (IPSFactoryBuffer *ppsf)
 
static ULONG WINAPI release_test_pretend_psfacbuf_release (IUnknown *pUnk)
 
static void test_Release (IPSFactoryBuffer *ppsf)
 
static HRESULT WINAPI delegating_invoke_test_QI (ITypeLib *pUnk, REFIID iid, void **ppv)
 
static ULONG WINAPI delegating_invoke_test_addref (ITypeLib *pUnk)
 
static ULONG WINAPI delegating_invoke_test_release (ITypeLib *pUnk)
 
static UINT WINAPI delegating_invoke_test_get_type_info_count (ITypeLib *pUnk)
 
static HRESULT WINAPI delegating_invoke_chan_query_interface (IRpcChannelBuffer *pchan, REFIID iid, void **ppv)
 
static ULONG WINAPI delegating_invoke_chan_add_ref (IRpcChannelBuffer *pchan)
 
static ULONG WINAPI delegating_invoke_chan_release (IRpcChannelBuffer *pchan)
 
static HRESULT WINAPI delegating_invoke_chan_get_buffer (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *msg, REFIID iid)
 
static HRESULT WINAPI delegating_invoke_chan_send_receive (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage, ULONG *pStatus)
 
static HRESULT WINAPI delegating_invoke_chan_free_buffer (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage)
 
static HRESULT WINAPI delegating_invoke_chan_get_dest_ctx (IRpcChannelBuffer *pchan, DWORD *pdwDestContext, void **ppvDestContext)
 
static HRESULT WINAPI delegating_invoke_chan_is_connected (IRpcChannelBuffer *pchan)
 
static void test_delegating_Invoke (IPSFactoryBuffer *ppsf)
 
static void test_NdrDllRegisterProxy (void)
 
static HANDLE create_process (const char *arg)
 
 DEFINE_GUID (CLSID_test1, 0xdeadf00d, 0x0001, 0x44c7, 0x85, 0x0f, 0x2a, 0x0f, 0x46, 0x5c, 0x0c, 0x6c)
 
static HRESULT WINAPI test1_QueryInterface (ITest1 *iface, REFIID iid, void **out)
 
static ULONG WINAPI test1_AddRef (ITest1 *iface)
 
static ULONG WINAPI test1_Release (ITest1 *iface)
 
static HRESULT WINAPI test1_GetClassID (ITest1 *iface, CLSID *clsid)
 
static int WINAPI test1_square (ITest1 *iface, int x)
 
static HRESULT WINAPI test_cf_QueryInterface (IClassFactory *iface, REFIID iid, void **out)
 
static ULONG WINAPI test_cf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI test_cf_Release (IClassFactory *iface)
 
static HRESULT WINAPI test_cf_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID iid, void **out)
 
static HRESULT WINAPI test_cf_LockServer (IClassFactory *iface, BOOL lock)
 
static void local_server_proc (void)
 
static void test_delegated_methods (void)
 
static CChannelBufferRefCountimpl_from_IRpcChannelBuffer (IRpcChannelBuffer *iface)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_query_interface (IRpcChannelBuffer *pchan, REFIID iid, void **ppv)
 
static ULONG WINAPI test_chanbuf_refcount_chan_add_ref (IRpcChannelBuffer *pchan)
 
static ULONG WINAPI test_chanbuf_refcount_chan_release (IRpcChannelBuffer *pchan)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_get_buffer (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *msg, REFIID iid)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_send_receive (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage, ULONG *pStatus)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_free_buffer (IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_get_dest_ctx (IRpcChannelBuffer *pchan, DWORD *pdwDestContext, void **ppvDestContext)
 
static HRESULT WINAPI test_chanbuf_refcount_chan_is_connected (IRpcChannelBuffer *pchan)
 
static void test_ChannelBufferRefCount (IPSFactoryBuffer *ppsf)
 
 START_TEST (cstub)
 

Variables

static CStdPSFactoryBuffer PSFactoryBuffer
 
static GUID IID_if1 = {0x12345678, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
 
static GUID IID_if2 = {0x12345679, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
 
static GUID IID_if3 = {0x1234567a, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
 
static GUID IID_if4 = {0x1234567b, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
 
static CLSID CLSID_psfact = {0x1234567c, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
 
static int my_alloc_called
 
static int my_free_called
 
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString
 
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString
 
static const MIDL_STUB_DESC Object_StubDesc
 
static const unsigned short if1_FormatStringOffsetTable []
 
static const MIDL_SERVER_INFO if1_server_info
 
static const PRPC_STUB_FUNCTION if1_table []
 
static CInterfaceStubVtbl if1_stub_vtbl
 
static const unsigned short if2_FormatStringOffsetTable []
 
static const MIDL_SERVER_INFO if2_server_info
 
static const PRPC_STUB_FUNCTION if2_table []
 
static CInterfaceStubVtbl if2_stub_vtbl
 
static const unsigned short if3_FormatStringOffsetTable []
 
static const MIDL_SERVER_INFO if3_server_info
 
static CInterfaceStubVtbl if3_stub_vtbl
 
static const unsigned short if4_FormatStringOffsetTable []
 
static const MIDL_SERVER_INFO if4_server_info
 
static CInterfaceStubVtbl if4_stub_vtbl
 
static const CInterfaceProxyVtblcstub_ProxyVtblList []
 
static const CInterfaceStubVtblcstub_StubVtblList []
 
static PCInterfaceName const if_name_list []
 
static const IIDbase_iid_list []
 
static const ExtendedProxyFileInfo my_proxy_file_info
 
static const ProxyFileInfoproxy_file_list []
 
static int base_buffer_invoke_called
 
static IRpcStubBufferVtbl base_buffer_vtbl
 
static IUnknownVtbl create_stub_test_vtbl
 
static IUnknownVtbl create_stub_test_fail_vtbl
 
static IUnknownVtbl dummy_unknown_vtbl
 
static struct dummy_unknown dummy_unknown = { { &dummy_unknown_vtbl }, 0 }
 
static int connect_test_orig_release_called
 
static IUnknownVtbl connect_test_orig_vtbl
 
static IUnknownVtbl connect_test_new_vtbl
 
static IUnknownVtbl connect_test_new_fail_vtbl
 
static int connect_test_base_Connect_called
 
static IRpcStubBufferVtbl connect_test_base_stub_buffer_vtbl
 
static int release_test_psfacbuf_release_called
 
static IUnknownVtbl release_test_pretend_psfacbuf_vtbl
 
static ITypeLibVtbl delegating_invoke_test_obj_vtbl
 
static IRpcChannelBufferVtbl delegating_invoke_test_rpc_chan_vtbl
 
static const CInterfaceProxyVtblcstub_ProxyVtblList2 []
 
static const CInterfaceStubVtblcstub_StubVtblList2 []
 
static PCInterfaceName const if_name_list2 []
 
static const IIDbase_iid_list2 []
 
static const ExtendedProxyFileInfo my_proxy_file_info2
 
static const ProxyFileInfoproxy_file_list2 []
 
static const ITest1Vtbl test1_vtbl
 
static const IClassFactoryVtbl test_cf_vtbl
 
static IClassFactory test_cf = { &test_cf_vtbl }
 
CStdPSFactoryBuffer gPFactory
 
const ProxyFileInfoaProxyFileList
 
static IRpcChannelBufferVtbl test_chanbuf_refcount_test_rpc_chan_vtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 24 of file cstub.c.

◆ cstub_CHECK_IID

#define cstub_CHECK_IID (   n)    IID_GENERIC_CHECK_IID( cstub, pIID, n)

Definition at line 404 of file cstub.c.

◆ VTBL_PROXY_TEST

#define VTBL_PROXY_TEST (   i,
  num,
  ptr 
)
Value:
ok( check_address(proxy_vtbl[i]->Vtbl[num], (ptr)), "wrong proxy %u func %u %p/%p\n", \
(i), (num), proxy_vtbl[i]->Vtbl[num], (ptr) )
#define ok(value,...)
Definition: atltest.h:57
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
static PVOID ptr
Definition: dispmode.c:27
static BOOL check_address(void *actual, void *expected)
Definition: cstub.c:418

◆ VTBL_PROXY_TEST_NOT_ZERO

#define VTBL_PROXY_TEST_NOT_ZERO (   i,
  num 
)     ok( proxy_vtbl[i]->Vtbl[num] != NULL, "wrong proxy %u func %u is NULL\n", (i), (num))

◆ VTBL_TEST_CHANGE_TO

#define VTBL_TEST_CHANGE_TO (   name,
  i 
)
Value:
ok(check_address(stub_vtbl[i]->Vtbl.name, CStd_##name), #name "vtbl %d not updated %p %p\n", \
i, stub_vtbl[i]->Vtbl.name, CStd_##name )
Definition: name.c:39

◆ VTBL_TEST_NOT_CHANGE_TO

#define VTBL_TEST_NOT_CHANGE_TO (   name,
  i 
)
Value:
ok(stub_vtbl[i]->Vtbl.name != CStd_##name, #name "vtbl %d updated %p %p\n", \
i, stub_vtbl[i]->Vtbl.name, CStd_##name )

◆ VTBL_TEST_ZERO

#define VTBL_TEST_ZERO (   name,
  i 
)
Value:
ok(stub_vtbl[i]->Vtbl.name == NULL, #name "vtbl %d not null %p\n", \
i, stub_vtbl[i]->Vtbl.name )
#define NULL
Definition: types.h:112

Typedef Documentation

◆ CChannelBufferRefCount

◆ MIDL_PROC_FORMAT_STRING

◆ MIDL_TYPE_FORMAT_STRING

Function Documentation

◆ base_buffer_Invoke()

static HRESULT WINAPI base_buffer_Invoke ( IRpcStubBuffer This,
RPCOLEMESSAGE *  msg,
IRpcChannelBuffer channel 
)
static

Definition at line 668 of file cstub.c.

669{
671 ok(msg == (RPCOLEMESSAGE*)0xcafebabe, "msg ptr changed\n");
672 ok(channel == (IRpcChannelBuffer*)0xdeadbeef, "channel ptr changed\n");
673 return S_OK; /* returning any failure here results in an exception */
674}
#define msg(x)
Definition: auth_time.c:54
#define S_OK
Definition: intsafe.h:52
static int base_buffer_invoke_called
Definition: cstub.c:667

◆ check_address()

static BOOL check_address ( void actual,
void expected 
)
static

Definition at line 418 of file cstub.c.

419{
420 static void *ole32_start = NULL;
421 static void *ole32_end = NULL;
422 static void *combase_start = NULL;
423 static void *combase_end = NULL;
424
425 if (actual == expected)
426 return TRUE;
427
428 /* On Win7, actual can be located inside ole32.dll */
429 if (ole32_start == NULL || ole32_end == NULL)
430 {
431 PIMAGE_NT_HEADERS nt_headers;
432 ole32_start = (void *) GetModuleHandleA("ole32.dll");
433 if (ole32_start == NULL)
434 return FALSE;
435 nt_headers = (PIMAGE_NT_HEADERS)((char *) ole32_start + ((PIMAGE_DOS_HEADER) ole32_start)->e_lfanew);
436 ole32_end = (void *)((char *) ole32_start + nt_headers->OptionalHeader.SizeOfImage);
437 }
438
439 if (ole32_start <= actual && actual < ole32_end)
440 return TRUE;
441
442 /* On Win8, actual can be located inside combase.dll */
443 if (combase_start == NULL || combase_end == NULL)
444 {
445 PIMAGE_NT_HEADERS nt_headers;
446 combase_start = (void *) GetModuleHandleA("combase.dll");
447 if (combase_start == NULL)
448 return FALSE;
449 nt_headers = (PIMAGE_NT_HEADERS)((char *) combase_start + ((PIMAGE_DOS_HEADER) combase_start)->e_lfanew);
450 combase_end = (void *)((char *) combase_start + nt_headers->OptionalHeader.SizeOfImage);
451 }
452
453 return (combase_start <= actual && actual < combase_end);
454}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS
Definition: ntddk_ex.h:187
struct _IMAGE_DOS_HEADER * PIMAGE_DOS_HEADER
BOOL expected
Definition: store.c:2000
IMAGE_OPTIONAL_HEADER32 OptionalHeader
Definition: ntddk_ex.h:184

◆ CINTERFACE_PROXY_VTABLE() [1/3]

static CINTERFACE_PROXY_VTABLE ( 13  )
static

Definition at line 213 of file cstub.c.

214{
215 { &IID_if2 },
219 0,
220 0,
221 0,
222 0,
223 0,
224 0,
225 0,
226 0,
227 0,
228 0
229 }
230};
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
static GUID IID_if2
Definition: cstub.c:54

◆ CINTERFACE_PROXY_VTABLE() [2/3]

static CINTERFACE_PROXY_VTABLE ( )
static

Definition at line 155 of file cstub.c.

156{
157 { &IID_if1 },
163 }
164};
static HRESULT WINAPI if1_fn2_Proxy(void *This)
Definition: cstub.c:141
static GUID IID_if1
Definition: cstub.c:53
static HRESULT WINAPI if1_fn1_Proxy(void *This)
Definition: cstub.c:127

◆ CINTERFACE_PROXY_VTABLE() [3/3]

static CINTERFACE_PROXY_VTABLE ( )
static

Definition at line 324 of file cstub.c.

325{
326 { &IID_if4 },
330 0,
331 0,
332 0,
333 0
334 }
335};
static GUID IID_if4
Definition: cstub.c:56

◆ connect_test_base_Connect()

static HRESULT WINAPI connect_test_base_Connect ( IRpcStubBuffer pstub,
IUnknown obj 
)
static

Definition at line 894 of file cstub.c.

895{
897 ok(*(void**)obj == (void*)0xbeefcafe, "unexpected obj %p\n", obj);
898 return S_OK;
899}
static int connect_test_base_Connect_called
Definition: cstub.c:893

◆ connect_test_new_fail_QI()

static HRESULT WINAPI connect_test_new_fail_QI ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 879 of file cstub.c.

880{
881 ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
882 *ppv = (void*)0xdeadbeef;
883 return E_NOINTERFACE;
884}
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ connect_test_new_QI()

static HRESULT WINAPI connect_test_new_QI ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 864 of file cstub.c.

865{
866 ok(IsEqualIID(iid, &IID_if1) ||
867 IsEqualIID(iid, &IID_if2), "incorrect iid\n");
868 *ppv = (void*)0xcafebabe;
869 return S_OK;
870}

◆ connect_test_orig_QI()

static HRESULT WINAPI connect_test_orig_QI ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 842 of file cstub.c.

843{
844 ok(IsEqualIID(iid, &IID_if1) ||
845 IsEqualIID(iid, &IID_if2), "incorrect iid\n");
846 *ppv = (void*)This;
847 return S_OK;
848}

◆ connect_test_orig_release()

static ULONG WINAPI connect_test_orig_release ( IUnknown This)
static

Definition at line 851 of file cstub.c.

852{
854 return 0;
855}
static int connect_test_orig_release_called
Definition: cstub.c:850

◆ create_process()

static HANDLE create_process ( const char arg)
static

Definition at line 1218 of file cstub.c.

1219{
1221 STARTUPINFOA si = {0};
1222 char cmdline[200];
1223 char **argv;
1224 BOOL ret;
1225
1226 si.cb = sizeof(si);
1228 sprintf(cmdline, "\"%s\" %s %s", argv[0], argv[1], arg);
1229 ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
1230 ok(ret, "CreateProcess failed: %lu\n", GetLastError());
1231 CloseHandle(pi.hThread);
1232 return pi.hProcess;
1233}
#define CloseHandle
Definition: compat.h:739
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4749
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
#define sprintf
Definition: sprintf.c:45
static refpint_t pi[]
Definition: server.c:112
#define argv
Definition: mplay32.c:18
int winetest_get_mainargs(char ***pargv)
TCHAR * cmdline
Definition: stretchblt.cpp:32
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ create_proxy_test()

static void create_proxy_test ( IPSFactoryBuffer ppsf,
REFIID  iid,
const void expected_vtbl 
)
static

Definition at line 783 of file cstub.c.

784{
786 IUnknown *iface = NULL;
787 HRESULT r;
788 ULONG count;
789
790 r = IPSFactoryBuffer_CreateProxy(ppsf, NULL, iid, &proxy, (void **)&iface);
791 ok( r == S_OK, "IPSFactoryBuffer_CreateProxy failed %lx\n", r );
792 ok( *(void **)iface == expected_vtbl, "wrong iface pointer %p/%p\n", *(void **)iface, expected_vtbl );
793 count = IUnknown_Release( iface );
794 ok( count == 1, "wrong refcount %lu\n", count );
795 count = IRpcProxyBuffer_Release( proxy );
796 ok( count == 0, "wrong refcount %lu\n", count );
797
798 dummy_unknown.ref = 4;
799 r = IPSFactoryBuffer_CreateProxy(ppsf, &dummy_unknown.IUnknown_iface, iid, &proxy,
800 (void **)&iface);
801 ok( r == S_OK, "IPSFactoryBuffer_CreateProxy failed %lx\n", r );
802 ok( dummy_unknown.ref == 5, "wrong refcount %lu\n", dummy_unknown.ref );
803 ok( *(void **)iface == expected_vtbl, "wrong iface pointer %p/%p\n", *(void **)iface, expected_vtbl );
804 count = IUnknown_Release( iface );
805 ok( count == 4, "wrong refcount %lu\n", count );
806 ok( dummy_unknown.ref == 4, "wrong refcount %lu\n", dummy_unknown.ref );
807 count = IRpcProxyBuffer_Release( proxy );
808 ok( count == 0, "wrong refcount %lu\n", count );
809 ok( dummy_unknown.ref == 4, "wrong refcount %lu\n", dummy_unknown.ref );
810}
int proxy
Definition: main.c:67
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
LONG ref
Definition: cstub.c:749
IUnknown IUnknown_iface
Definition: cstub.c:748
uint32_t ULONG
Definition: typedefs.h:59

Referenced by test_CreateProxy().

◆ create_stub()

static IRpcStubBuffer * create_stub ( IPSFactoryBuffer ppsf,
REFIID  iid,
IUnknown obj,
HRESULT  expected_result 
)
static

Definition at line 708 of file cstub.c.

709{
710 IRpcStubBuffer *pstub = NULL;
711 HRESULT r;
712
713 r = IPSFactoryBuffer_CreateStub(ppsf, iid, obj, &pstub);
714 ok(r == expected_result, "CreateStub returned %08lx expected %08lx\n", r, expected_result);
715 return pstub;
716}
const char * expected_result
Definition: mimeole.c:1468

◆ create_stub_test_fail_QI()

static HRESULT WINAPI create_stub_test_fail_QI ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 732 of file cstub.c.

733{
734 ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
735 *ppv = NULL;
736 return E_NOINTERFACE;
737}

◆ create_stub_test_QI()

static HRESULT WINAPI create_stub_test_QI ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 718 of file cstub.c.

719{
720 ok(IsEqualIID(iid, &IID_if1), "incorrect iid\n");
721 *ppv = (void*)0xdeadbeef;
722 return S_OK;
723}

◆ DEFINE_GUID()

DEFINE_GUID ( CLSID_test1  ,
0xdeadf00d  ,
0x0001  ,
0x44c7  ,
0x85  ,
0x0f  ,
0x2a  ,
0x0f  ,
0x46  ,
0x5c  ,
0x0c  ,
0x6c   
)

◆ delegating_invoke_chan_add_ref()

static ULONG WINAPI delegating_invoke_chan_add_ref ( IRpcChannelBuffer pchan)
static

Definition at line 1070 of file cstub.c.

1071{
1072 return 2;
1073}

◆ delegating_invoke_chan_free_buffer()

static HRESULT WINAPI delegating_invoke_chan_free_buffer ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  pMessage 
)
static

Definition at line 1096 of file cstub.c.

1098{
1099 ok(0, "call to FreeBuffer not expected\n");
1100 return E_NOTIMPL;
1101}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ delegating_invoke_chan_get_buffer()

static HRESULT WINAPI delegating_invoke_chan_get_buffer ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  msg,
REFIID  iid 
)
static

Definition at line 1080 of file cstub.c.

1083{
1084 msg->Buffer = malloc(msg->cbBuffer);
1085 return S_OK;
1086}
#define malloc
Definition: debug_ros.c:4

◆ delegating_invoke_chan_get_dest_ctx()

static HRESULT WINAPI delegating_invoke_chan_get_dest_ctx ( IRpcChannelBuffer pchan,
DWORD pdwDestContext,
void **  ppvDestContext 
)
static

Definition at line 1103 of file cstub.c.

1106{
1107 *pdwDestContext = MSHCTX_LOCAL;
1108 *ppvDestContext = NULL;
1109 return S_OK;
1110}

◆ delegating_invoke_chan_is_connected()

static HRESULT WINAPI delegating_invoke_chan_is_connected ( IRpcChannelBuffer pchan)
static

Definition at line 1112 of file cstub.c.

1113{
1114 ok(0, "call to IsConnected not expected\n");
1115 return E_NOTIMPL;
1116}

◆ delegating_invoke_chan_query_interface()

static HRESULT WINAPI delegating_invoke_chan_query_interface ( IRpcChannelBuffer pchan,
REFIID  iid,
void **  ppv 
)
static

Definition at line 1062 of file cstub.c.

1065{
1066 ok(0, "call to QueryInterface not expected\n");
1067 return E_NOINTERFACE;
1068}

◆ delegating_invoke_chan_release()

static ULONG WINAPI delegating_invoke_chan_release ( IRpcChannelBuffer pchan)
static

Definition at line 1075 of file cstub.c.

1076{
1077 return 1;
1078}

◆ delegating_invoke_chan_send_receive()

static HRESULT WINAPI delegating_invoke_chan_send_receive ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  pMessage,
ULONG pStatus 
)
static

Definition at line 1088 of file cstub.c.

1091{
1092 ok(0, "call to SendReceive not expected\n");
1093 return E_NOTIMPL;
1094}

◆ delegating_invoke_test_addref()

static ULONG WINAPI delegating_invoke_test_addref ( ITypeLib pUnk)
static

Definition at line 1030 of file cstub.c.

1031{
1032 return 1;
1033}

◆ delegating_invoke_test_get_type_info_count()

static UINT WINAPI delegating_invoke_test_get_type_info_count ( ITypeLib pUnk)
static

Definition at line 1040 of file cstub.c.

1041{
1042 return 0xabcdef;
1043}

◆ delegating_invoke_test_QI()

static HRESULT WINAPI delegating_invoke_test_QI ( ITypeLib pUnk,
REFIID  iid,
void **  ppv 
)
static

Definition at line 1023 of file cstub.c.

1024{
1025
1026 *ppv = pUnk;
1027 return S_OK;
1028}
static void *static void *static LPDIRECTPLAY IUnknown * pUnk
Definition: dplayx.c:30

◆ delegating_invoke_test_release()

static ULONG WINAPI delegating_invoke_test_release ( ITypeLib pUnk)
static

Definition at line 1035 of file cstub.c.

1036{
1037 return 1;
1038}

◆ dummy_AddRef()

static ULONG WINAPI dummy_AddRef ( LPUNKNOWN  iface)
static

Definition at line 763 of file cstub.c.

764{
765 struct dummy_unknown *this = impl_from_IUnknown(iface);
766 return InterlockedIncrement( &this->ref );
767}
#define InterlockedIncrement
Definition: armddk.h:53
static struct dummy_unknown * impl_from_IUnknown(IUnknown *iface)
Definition: cstub.c:752
Definition: send.c:48

◆ dummy_QueryInterface()

static HRESULT WINAPI dummy_QueryInterface ( IUnknown This,
REFIID  iid,
void **  ppv 
)
static

Definition at line 757 of file cstub.c.

758{
759 *ppv = NULL;
760 return E_NOINTERFACE;
761}

◆ dummy_Release()

static ULONG WINAPI dummy_Release ( LPUNKNOWN  iface)
static

Definition at line 769 of file cstub.c.

770{
771 struct dummy_unknown *this = impl_from_IUnknown(iface);
772 return InterlockedDecrement( &this->ref );
773}
#define InterlockedDecrement
Definition: armddk.h:52

◆ if1_fn1_Proxy()

static HRESULT WINAPI if1_fn1_Proxy ( void This)
static

Definition at line 127 of file cstub.c.

128{
129 return S_OK;
130}

Referenced by CINTERFACE_PROXY_VTABLE(), and test_NdrDllGetClassObject().

◆ if1_fn1_Stub()

static void __RPC_STUB if1_fn1_Stub ( IRpcStubBuffer This,
IRpcChannelBuffer _pRpcChannelBuffer,
PRPC_MESSAGE  _pRpcMessage,
DWORD _pdwStubPhase 
)
static

Definition at line 132 of file cstub.c.

137{
138 trace("fn1 stub\n");
139}
#define trace
Definition: atltest.h:70

◆ if1_fn2_Proxy()

static HRESULT WINAPI if1_fn2_Proxy ( void This)
static

Definition at line 141 of file cstub.c.

142{
143 return S_OK;
144}

Referenced by CINTERFACE_PROXY_VTABLE(), and test_NdrDllGetClassObject().

◆ if1_fn2_Stub()

static void __RPC_STUB if1_fn2_Stub ( IRpcStubBuffer This,
IRpcChannelBuffer _pRpcChannelBuffer,
PRPC_MESSAGE  _pRpcMessage,
DWORD _pdwStubPhase 
)
static

Definition at line 146 of file cstub.c.

151{
152 trace("fn2 stub\n");
153}

◆ iid_lookup()

static int __stdcall iid_lookup ( const IID pIID,
int pIndex 
)
static

Definition at line 406 of file cstub.c.

407{
409
410 IID_BS_LOOKUP_INITIAL_TEST( cstub, 4, 4 )
411 IID_BS_LOOKUP_NEXT_TEST( cstub, 2 )
412 IID_BS_LOOKUP_NEXT_TEST( cstub, 1 )
414
415}
_Out_ PULONG _Out_ PULONG pIndex
Definition: ndis.h:4565
#define IID_BS_LOOKUP_RETURN_RESULT(name, sz, index)
Definition: rpcproxy.h:223
#define IID_BS_LOOKUP_INITIAL_TEST(name, sz, split)
Definition: rpcproxy.h:221
#define IID_BS_LOOKUP_SETUP
Definition: rpcproxy.h:219
#define IID_BS_LOOKUP_NEXT_TEST(name, split)
Definition: rpcproxy.h:222

◆ impl_from_IRpcChannelBuffer()

static CChannelBufferRefCount * impl_from_IRpcChannelBuffer ( IRpcChannelBuffer iface)
static

Definition at line 1423 of file cstub.c.

1424{
1425 return CONTAINING_RECORD(iface, CChannelBufferRefCount, IRpcChannelBuffer_iface);
1426}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by test_chanbuf_refcount_chan_add_ref(), and test_chanbuf_refcount_chan_release().

◆ impl_from_IUnknown()

static struct dummy_unknown * impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 752 of file cstub.c.

753{
754 return CONTAINING_RECORD(iface, struct dummy_unknown, IUnknown_iface);
755}

Referenced by dummy_AddRef(), and dummy_Release().

◆ local_server_proc()

static void local_server_proc ( void  )
static

Definition at line 1328 of file cstub.c.

1329{
1330 DWORD obj_cookie, ps_cookie, index;
1331 HANDLE stop_event, ready_event;
1332 IPSFactoryBuffer *ps;
1333 HRESULT hr;
1334
1335 stop_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "wine_cstub_test_server_stop");
1336 ready_event = OpenEventA(EVENT_ALL_ACCESS, FALSE, "wine_cstub_test_server_ready");
1337
1339
1340 hr = CoRegisterClassObject(&CLSID_test1, (IUnknown *)&test_cf,
1341 CLSCTX_LOCAL_SERVER, REGCLS_MULTIPLEUSE, &obj_cookie);
1342 ok(hr == S_OK, "got %#lx\n", hr);
1343
1344 hr = NdrDllGetClassObject(&CLSID_test_ps, &IID_IPSFactoryBuffer, (void **)&ps,
1345 &aProxyFileList, &CLSID_test_ps, &gPFactory);
1346 ok(hr == S_OK, "got %#lx\n", hr);
1347
1348 hr = CoRegisterClassObject(&CLSID_test_ps, (IUnknown *)ps,
1349 CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &ps_cookie);
1350 ok(hr == S_OK, "got %#lx\n", hr);
1351
1352 hr = CoRegisterPSClsid(&IID_ITest1, &CLSID_test_ps);
1353 ok(hr == S_OK, "got %#lx\n", hr);
1354
1355 SetEvent(ready_event);
1356
1357 hr = CoWaitForMultipleHandles(0, 1000, 1, &stop_event, &index);
1358 ok(hr == S_OK, "got %#lx\n", hr);
1359 ok(!index, "got %lu\n", index);
1360
1361 hr = CoRevokeClassObject(ps_cookie);
1362 ok(hr == S_OK, "got %#lx\n", hr);
1363
1364 hr = CoRevokeClassObject(obj_cookie);
1365 ok(hr == S_OK, "got %#lx\n", hr);
1366
1368 ExitProcess(0);
1369}
#define index(s, c)
Definition: various.h:29
HRESULT WINAPI NdrDllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid, CStdPSFactoryBuffer *pPSFactoryBuffer)
Definition: cpsf.c:179
VOID WINAPI ExitProcess(IN UINT uExitCode)
Definition: proc.c:1489
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
HRESULT WINAPI CoWaitForMultipleHandles(DWORD dwFlags, DWORD dwTimeout, ULONG cHandles, LPHANDLE pHandles, LPDWORD lpdwindex)
Definition: compobj.c:4578
HRESULT WINAPI DECLSPEC_HOTPATCH CoRevokeClassObject(DWORD dwRegister)
Definition: compobj.c:1086
HRESULT WINAPI CoRegisterPSClsid(REFIID riid, REFCLSID rclsid)
Definition: compobj.c:2778
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
const ProxyFileInfo * aProxyFileList
static IClassFactory test_cf
Definition: cstub.c:1323
CStdPSFactoryBuffer gPFactory
HANDLE stop_event
Definition: nfs41_daemon.c:55
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393
HRESULT hr
Definition: shlfolder.c:183
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
HANDLE WINAPI DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName)
Definition: synch.c:669

Referenced by START_TEST().

◆ my_alloc()

static void *CALLBACK my_alloc ( SIZE_T  size)
static

Definition at line 62 of file cstub.c.

63{
65 return malloc(size);
66}
GLsizeiptr size
Definition: glext.h:5919
static int my_alloc_called
Definition: cstub.c:59

◆ my_free()

static void CALLBACK my_free ( void ptr)
static

Definition at line 68 of file cstub.c.

69{
71 free(ptr);
72}
#define free
Definition: debug_ros.c:5
static int my_free_called
Definition: cstub.c:60

◆ release_test_pretend_psfacbuf_release()

static ULONG WINAPI release_test_pretend_psfacbuf_release ( IUnknown pUnk)
static

Definition at line 980 of file cstub.c.

981{
983 return 1;
984}
static int release_test_psfacbuf_release_called
Definition: cstub.c:979

◆ START_TEST()

START_TEST ( cstub  )

Definition at line 1551 of file cstub.c.

1552{
1553 IPSFactoryBuffer *ppsf;
1554 int argc;
1555 char **argv;
1556
1558 if (argc > 2 && !strcmp(argv[2], "server"))
1559 {
1561 return;
1562 }
1563
1565
1568 test_CreateProxy(ppsf);
1569 test_CreateStub(ppsf);
1570 test_Connect(ppsf);
1571 test_Disconnect(ppsf);
1572 test_Release(ppsf);
1577
1579}
static int argc
Definition: ServiceArgs.c:12
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
HRESULT WINAPI DECLSPEC_HOTPATCH OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
static void test_ChannelBufferRefCount(IPSFactoryBuffer *ppsf)
Definition: cstub.c:1503
static void test_delegated_methods(void)
Definition: cstub.c:1371
static void test_CreateProxy(IPSFactoryBuffer *ppsf)
Definition: cstub.c:812
static void test_NdrDllRegisterProxy(void)
Definition: cstub.c:1194
static void test_delegating_Invoke(IPSFactoryBuffer *ppsf)
Definition: cstub.c:1130
static void test_Connect(IPSFactoryBuffer *ppsf)
Definition: cstub.c:915
static void test_Release(IPSFactoryBuffer *ppsf)
Definition: cstub.c:993
static void local_server_proc(void)
Definition: cstub.c:1328
static void test_CreateStub(IPSFactoryBuffer *ppsf)
Definition: cstub.c:820
static IPSFactoryBuffer * test_NdrDllGetClassObject(void)
Definition: cstub.c:477
static void test_Disconnect(IPSFactoryBuffer *ppsf)
Definition: cstub.c:964
static void test_NdrStubForwardingFunction(void)
Definition: cstub.c:689

◆ test1_AddRef()

static ULONG WINAPI test1_AddRef ( ITest1 iface)
static

Definition at line 1249 of file cstub.c.

1250{
1251 return 2;
1252}

◆ test1_GetClassID()

static HRESULT WINAPI test1_GetClassID ( ITest1 iface,
CLSID clsid 
)
static

Definition at line 1259 of file cstub.c.

1260{
1261 *clsid = CLSID_test1;
1262 return S_OK;
1263}
const CLSID * clsid
Definition: msctf.cpp:50

◆ test1_QueryInterface()

static HRESULT WINAPI test1_QueryInterface ( ITest1 iface,
REFIID  iid,
void **  out 
)
static

Definition at line 1237 of file cstub.c.

1238{
1239 if (winetest_debug > 1) trace("%s\n", wine_dbgstr_guid(iid));
1240 if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_ITest1))
1241 {
1242 *out = iface;
1243 return S_OK;
1244 }
1245 *out = NULL;
1246 return E_NOINTERFACE;
1247}
const GUID IID_IUnknown
int winetest_debug
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

◆ test1_Release()

static ULONG WINAPI test1_Release ( ITest1 iface)
static

Definition at line 1254 of file cstub.c.

1255{
1256 return 1;
1257}

◆ test1_square()

static int WINAPI test1_square ( ITest1 iface,
int  x 
)
static

Definition at line 1265 of file cstub.c.

1266{
1267 return x * x;
1268}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

◆ test_cf_AddRef()

static ULONG WINAPI test_cf_AddRef ( IClassFactory iface)
static

Definition at line 1290 of file cstub.c.

1291{
1292 return 2;
1293}

◆ test_cf_CreateInstance()

static HRESULT WINAPI test_cf_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  iid,
void **  out 
)
static

Definition at line 1300 of file cstub.c.

1301{
1302 ITest1 *obj = malloc(sizeof(*obj));
1303
1304 obj->lpVtbl = &test1_vtbl;
1305
1306 return ITest1_QueryInterface(obj, iid, out);
1307}
Definition: cstub.idl:30
static const ITest1Vtbl test1_vtbl
Definition: cstub.c:1270

◆ test_cf_LockServer()

static HRESULT WINAPI test_cf_LockServer ( IClassFactory iface,
BOOL  lock 
)
static

Definition at line 1309 of file cstub.c.

1310{
1311 return S_OK;
1312}

◆ test_cf_QueryInterface()

static HRESULT WINAPI test_cf_QueryInterface ( IClassFactory iface,
REFIID  iid,
void **  out 
)
static

Definition at line 1279 of file cstub.c.

1280{
1282 {
1283 *out = iface;
1284 return S_OK;
1285 }
1286 *out = NULL;
1287 return E_NOINTERFACE;
1288}
const GUID IID_IClassFactory

◆ test_cf_Release()

static ULONG WINAPI test_cf_Release ( IClassFactory iface)
static

Definition at line 1295 of file cstub.c.

1296{
1297 return 1;
1298}

◆ test_chanbuf_refcount_chan_add_ref()

static ULONG WINAPI test_chanbuf_refcount_chan_add_ref ( IRpcChannelBuffer pchan)
static

Definition at line 1441 of file cstub.c.

1442{
1444 return InterlockedIncrement(&This->RefCount);
1445}
static CChannelBufferRefCount * impl_from_IRpcChannelBuffer(IRpcChannelBuffer *iface)
Definition: cstub.c:1423

◆ test_chanbuf_refcount_chan_free_buffer()

static HRESULT WINAPI test_chanbuf_refcount_chan_free_buffer ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  pMessage 
)
static

Definition at line 1469 of file cstub.c.

1471{
1472 ok(0, "call to FreeBuffer not expected\n");
1473 return E_NOTIMPL;
1474}

◆ test_chanbuf_refcount_chan_get_buffer()

static HRESULT WINAPI test_chanbuf_refcount_chan_get_buffer ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  msg,
REFIID  iid 
)
static

Definition at line 1453 of file cstub.c.

1456{
1457 ok(0, "call to GetBuffer not expected\n");
1458 return E_NOTIMPL;
1459}

◆ test_chanbuf_refcount_chan_get_dest_ctx()

static HRESULT WINAPI test_chanbuf_refcount_chan_get_dest_ctx ( IRpcChannelBuffer pchan,
DWORD pdwDestContext,
void **  ppvDestContext 
)
static

Definition at line 1476 of file cstub.c.

1479{
1480 *pdwDestContext = MSHCTX_LOCAL;
1481 *ppvDestContext = NULL;
1482 return S_OK;
1483}

◆ test_chanbuf_refcount_chan_is_connected()

static HRESULT WINAPI test_chanbuf_refcount_chan_is_connected ( IRpcChannelBuffer pchan)
static

Definition at line 1485 of file cstub.c.

1486{
1487 ok(0, "call to IsConnected not expected\n");
1488 return E_NOTIMPL;
1489}

◆ test_chanbuf_refcount_chan_query_interface()

static HRESULT WINAPI test_chanbuf_refcount_chan_query_interface ( IRpcChannelBuffer pchan,
REFIID  iid,
void **  ppv 
)
static

Definition at line 1428 of file cstub.c.

1431{
1432 if (IsEqualGUID(&IID_IRpcChannelBuffer, iid))
1433 {
1434 *ppv = pchan;
1435 IRpcChannelBuffer_AddRef(pchan);
1436 return S_OK;
1437 }
1438 return E_NOINTERFACE;
1439}

◆ test_chanbuf_refcount_chan_release()

static ULONG WINAPI test_chanbuf_refcount_chan_release ( IRpcChannelBuffer pchan)
static

Definition at line 1447 of file cstub.c.

1448{
1450 return InterlockedDecrement(&This->RefCount);
1451}

◆ test_chanbuf_refcount_chan_send_receive()

static HRESULT WINAPI test_chanbuf_refcount_chan_send_receive ( IRpcChannelBuffer pchan,
RPCOLEMESSAGE *  pMessage,
ULONG pStatus 
)
static

Definition at line 1461 of file cstub.c.

1464{
1465 ok(0, "call to SendReceive not expected\n");
1466 return E_NOTIMPL;
1467}

◆ test_ChannelBufferRefCount()

static void test_ChannelBufferRefCount ( IPSFactoryBuffer ppsf)
static

Definition at line 1503 of file cstub.c.

1504{
1505 IRpcProxyBuffer* proxy_buffer = NULL;
1506 IUnknown* proxy_if1 = NULL;
1508
1509 RPC_MESSAGE rpcMessage = {0};
1510 MIDL_STUB_MESSAGE stubMessage = {0};
1511 MIDL_STUB_DESC stubDesc = {0};
1512 ULONG refs;
1513
1514 HRESULT hr = IPSFactoryBuffer_CreateProxy(ppsf, NULL, &IID_if1, &proxy_buffer, (void**)&proxy_if1);
1515 ok(hr == S_OK, "got %#lx\n", hr);
1516
1517 ok(test_chanbuf.RefCount == 1, "got %ld\n", test_chanbuf.RefCount);
1518 hr = IRpcProxyBuffer_Connect(proxy_buffer, &test_chanbuf.IRpcChannelBuffer_iface);
1519 ok(hr == S_OK, "got %#lx\n", hr);
1520 /* proxy_buffer should have acquired its own refcount on test_chanbuf */
1521 ok(test_chanbuf.RefCount == 2, "got %ld\n", test_chanbuf.RefCount);
1522
1523 /* which therefore survives releasing the initial one */
1524 refs = IRpcChannelBuffer_Release(&test_chanbuf.IRpcChannelBuffer_iface);
1525 ok(refs == 1, "got %ld\n", refs);
1526
1527 NdrProxyInitialize(proxy_if1, &rpcMessage, &stubMessage, &stubDesc, 0);
1528 /* stubMessage should add its own refcount on test_chanbuf */
1529 ok(test_chanbuf.RefCount == 2, "got %ld\n", test_chanbuf.RefCount);
1530 ok(stubMessage.pRpcChannelBuffer != NULL, "NULL pRocChannelBuffer\n");
1531
1532 /* stubMessage doesn't add its own refcounts on proxy_if1 or proxy_buffer,
1533 * so it's possible these are freed out from under it.
1534 * E.g. an event sink might unadvise upon receiving the event it was waiting for;
1535 * this unadvise could be reentrant to Invoke because SendReceive pumps STA messages.
1536 * The source would then erase that connection point entry and Release the proxy. */
1537 IRpcProxyBuffer_Disconnect(proxy_buffer);
1538 ok(test_chanbuf.RefCount == 1, "got %ld\n", test_chanbuf.RefCount);
1539 IRpcProxyBuffer_Release(proxy_buffer);
1540 refs = IUnknown_Release(proxy_if1);
1541 ok(refs == 0, "got %ld\n", refs);
1542 ok(test_chanbuf.RefCount == 1, "got %ld\n", test_chanbuf.RefCount);
1543
1544 /* NdrProxyFreeBuffer must not dereference the now-freed proxy_if1,
1545 * yet should still free the remaining reference on test_chanbuf */
1546 NdrProxyFreeBuffer(proxy_if1, &stubMessage);
1547 ok(test_chanbuf.RefCount == 0, "got %ld\n", test_chanbuf.RefCount);
1548 ok(!stubMessage.pRpcChannelBuffer, "dangling pRpcChannelBuffer = %p\n", stubMessage.pRpcChannelBuffer);
1549}
void WINAPI NdrProxyInitialize(void *This, PRPC_MESSAGE pRpcMsg, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDescriptor, unsigned int ProcNum)
Definition: cproxy.c:266
void WINAPI NdrProxyFreeBuffer(void *This, PMIDL_STUB_MESSAGE pStubMsg)
Definition: cproxy.c:348
static IRpcChannelBufferVtbl test_chanbuf_refcount_test_rpc_chan_vtbl
Definition: cstub.c:1491
struct IRpcChannelBuffer * pRpcChannelBuffer
Definition: rpcndr.h:236
IRpcChannelBuffer IRpcChannelBuffer_iface
Definition: cstub.c:1419

Referenced by START_TEST().

◆ test_Connect()

static void test_Connect ( IPSFactoryBuffer ppsf)
static

Definition at line 915 of file cstub.c.

916{
917 IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
918 IUnknownVtbl *new_vtbl = &connect_test_new_vtbl;
919 IUnknownVtbl *new_fail_vtbl = &connect_test_new_fail_vtbl;
920 IUnknown *obj = (IUnknown*)&orig_vtbl;
921 IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
922 CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
923 IRpcStubBufferVtbl *base_stub_buf_vtbl = &connect_test_base_stub_buffer_vtbl;
924 HRESULT r;
925
926 obj = (IUnknown*)&new_vtbl;
927 r = IRpcStubBuffer_Connect(pstub, obj);
928 ok(r == S_OK, "r %08lx\n", r);
930 ok(cstd_stub->pvServerObject == (void*)0xcafebabe, "pvServerObject %p\n", cstd_stub->pvServerObject);
931
932 cstd_stub->pvServerObject = (IUnknown*)&orig_vtbl;
933 obj = (IUnknown*)&new_fail_vtbl;
934 r = IRpcStubBuffer_Connect(pstub, obj);
935 ok(r == E_NOINTERFACE, "r %08lx\n", r);
936 ok(cstd_stub->pvServerObject == (void*)0xdeadbeef, "pvServerObject %p\n", cstd_stub->pvServerObject);
938
939 /* Now use a delegated stub.
940
941 We know from the NdrStubForwardFunction test that
942 (void**)pstub-1 is the base interface stub buffer. This shows
943 that (void**)pstub-2 contains the address of a vtable that gets
944 passed to the base interface's Connect method. Note that
945 (void**)pstub-2 itself gets passed to Connect and not
946 *((void**)pstub-2), so it should contain the vtable ptr and not
947 an interface ptr. */
948
949 obj = (IUnknown*)&orig_vtbl;
950 pstub = create_stub(ppsf, &IID_if2, obj, S_OK);
951 *((void**)pstub-1) = &base_stub_buf_vtbl;
952 *((void**)pstub-2) = (void*)0xbeefcafe;
953
954 obj = (IUnknown*)&new_vtbl;
955 r = IRpcStubBuffer_Connect(pstub, obj);
956 ok(r == S_OK, "r %08lx\n", r);
957 ok(connect_test_base_Connect_called == 1, "connect_test_bsae_Connect called %d times\n",
960 cstd_stub = (CStdStubBuffer*)pstub;
961 ok(cstd_stub->pvServerObject == (void*)0xcafebabe, "pvServerObject %p\n", cstd_stub->pvServerObject);
962}
HRESULT create_stub(REFIID iid, IUnknown *pUnk, IRpcStubBuffer **ppstub)
Definition: ndr_ole.c:430
static IUnknownVtbl connect_test_orig_vtbl
Definition: cstub.c:857
static IUnknownVtbl connect_test_new_vtbl
Definition: cstub.c:872
static IRpcStubBufferVtbl connect_test_base_stub_buffer_vtbl
Definition: cstub.c:901
static IUnknownVtbl connect_test_new_fail_vtbl
Definition: cstub.c:886
struct IUnknown * pvServerObject
Definition: rpcproxy.h:107

Referenced by START_TEST().

◆ test_CreateProxy()

static void test_CreateProxy ( IPSFactoryBuffer ppsf)
static

Definition at line 812 of file cstub.c.

813{
814 create_proxy_test( ppsf, &IID_if1, if1_proxy_vtbl.Vtbl );
815 create_proxy_test( ppsf, &IID_if2, if2_proxy_vtbl.Vtbl );
816 create_proxy_test( ppsf, &IID_if3, if3_proxy_vtbl.Vtbl );
817 create_proxy_test( ppsf, &IID_if4, if4_proxy_vtbl.Vtbl );
818}
static void create_proxy_test(IPSFactoryBuffer *ppsf, REFIID iid, const void *expected_vtbl)
Definition: cstub.c:783
static GUID IID_if3
Definition: cstub.c:55

Referenced by START_TEST().

◆ test_CreateStub()

static void test_CreateStub ( IPSFactoryBuffer ppsf)
static

Definition at line 820 of file cstub.c.

821{
822 IUnknownVtbl *vtbl = &create_stub_test_vtbl;
823 IUnknown *obj = (IUnknown*)&vtbl;
824 IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
825 CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
826 const CInterfaceStubHeader *header = &CONTAINING_RECORD(cstd_stub->lpVtbl, const CInterfaceStubVtbl, Vtbl)->header;
827
828 ok(IsEqualIID(header->piid, &IID_if1), "header iid differs\n");
829 ok(cstd_stub->RefCount == 1, "ref count %ld\n", cstd_stub->RefCount);
830 /* 0xdeadbeef returned from create_stub_test_QI */
831 ok(cstd_stub->pvServerObject == (void*)0xdeadbeef, "pvServerObject %p\n", cstd_stub->pvServerObject);
832 ok(cstd_stub->pPSFactory != NULL, "pPSFactory was NULL\n");
833 cstd_stub->pvServerObject = NULL;
834 IRpcStubBuffer_Release(pstub);
835
837 pstub = create_stub(ppsf, &IID_if1, obj, E_NOINTERFACE);
838 ok(pstub == NULL, "create_stub failed: %lu\n", GetLastError());
839
840}
static IUnknownVtbl create_stub_test_fail_vtbl
Definition: cstub.c:739
static IUnknownVtbl create_stub_test_vtbl
Definition: cstub.c:725
const IRpcStubBufferVtbl * lpVtbl
Definition: rpcproxy.h:105
struct IPSFactoryBuffer * pPSFactory
Definition: rpcproxy.h:110

Referenced by START_TEST().

◆ test_CStdStubBuffer2_Release()

static ULONG WINAPI test_CStdStubBuffer2_Release ( IRpcStubBuffer This)
static

Definition at line 48 of file cstub.c.

49{
51}
ULONG WINAPI NdrCStdStubBuffer2_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
Definition: cstub.c:231

◆ test_CStdStubBuffer_Release()

static ULONG WINAPI test_CStdStubBuffer_Release ( IRpcStubBuffer This)
static

Definition at line 43 of file cstub.c.

44{
46}
ULONG WINAPI NdrCStdStubBuffer_Release(LPRPCSTUBBUFFER iface, LPPSFACTORYBUFFER pPSF)
Definition: cstub.c:210

◆ test_delegated_methods()

static void test_delegated_methods ( void  )
static

Definition at line 1371 of file cstub.c.

1372{
1373 HANDLE process, stop_event, ready_event;
1374 IPSFactoryBuffer *ps;
1375 ITest1 *test_obj;
1376 DWORD ps_cookie;
1377 CLSID clsid;
1378 HRESULT hr;
1379 int ret;
1380
1381 stop_event = CreateEventA(NULL, TRUE, FALSE, "wine_cstub_test_server_stop");
1382 ready_event = CreateEventA(NULL, TRUE, FALSE, "wine_cstub_test_server_ready");
1383
1384 process = create_process("server");
1385 ok(!WaitForSingleObject(ready_event, 5000), "wait failed\n");
1386
1387 hr = NdrDllGetClassObject(&CLSID_test_ps, &IID_IPSFactoryBuffer, (void **)&ps,
1388 &aProxyFileList, &CLSID_test_ps, &gPFactory);
1389 ok(hr == S_OK, "got %#lx\n", hr);
1390
1391 hr = CoRegisterClassObject(&CLSID_test_ps, (IUnknown *)ps,
1392 CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &ps_cookie);
1393 ok(hr == S_OK, "got %#lx\n", hr);
1394
1395 hr = CoRegisterPSClsid(&IID_ITest1, &CLSID_test_ps);
1396 ok(hr == S_OK, "got %#lx\n", hr);
1397
1398 hr = CoCreateInstance(&CLSID_test1, NULL, CLSCTX_LOCAL_SERVER, &IID_ITest1, (void **)&test_obj);
1399 ok(hr == S_OK, "got %#lx\n", hr);
1400
1401 ret = ITest1_square(test_obj, 3);
1402 ok(ret == 9, "got %d\n", ret);
1403
1404 hr = ITest1_GetClassID(test_obj, &clsid);
1405 ok(hr == S_OK, "got %#lx\n", hr);
1406 ok(IsEqualGUID(&clsid, &CLSID_test1), "got %s\n", wine_dbgstr_guid(&clsid));
1407
1408 ITest1_Release(test_obj);
1409
1411 ok(!WaitForSingleObject(process, 1000), "wait failed\n");
1412
1413 hr = CoRevokeClassObject(ps_cookie);
1414 ok(hr == S_OK, "got %#lx\n", hr);
1415}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define create_process(cmd, pi)
Definition: process.c:2408
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637

Referenced by START_TEST().

◆ test_delegating_Invoke()

static void test_delegating_Invoke ( IPSFactoryBuffer ppsf)
static

Definition at line 1130 of file cstub.c.

1131{
1132 ITypeLibVtbl *obj_vtbl = &delegating_invoke_test_obj_vtbl;
1133 IUnknown *obj = (IUnknown*)&obj_vtbl;
1134 IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if2, obj, S_OK);
1135 IRpcChannelBufferVtbl *pchan_vtbl = &delegating_invoke_test_rpc_chan_vtbl;
1136 IRpcChannelBuffer *pchan = (IRpcChannelBuffer *)&pchan_vtbl;
1137 HRESULT r = E_FAIL;
1138 RPCOLEMESSAGE msg;
1139
1140 memset(&msg, 0, sizeof(msg));
1141 msg.dataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
1142 msg.iMethod = 3;
1143 r = IRpcStubBuffer_Invoke(pstub, &msg, pchan);
1144 ok(r == S_OK, "ret %08lx\n", r);
1145 if(r == S_OK)
1146 {
1147 ok(*(DWORD*)msg.Buffer == 0xabcdef, "buf[0] %08lx\n", *(DWORD*)msg.Buffer);
1148 ok(*((DWORD*)msg.Buffer + 1) == S_OK, "buf[1] %08lx\n", *((DWORD*)msg.Buffer + 1));
1149 }
1150 /* free the buffer allocated by delegating_invoke_chan_get_buffer */
1151 free(msg.Buffer);
1152 IRpcStubBuffer_Release(pstub);
1153}
#define E_FAIL
Definition: ddrawi.h:102
static IRpcChannelBufferVtbl delegating_invoke_test_rpc_chan_vtbl
Definition: cstub.c:1118
static ITypeLibVtbl delegating_invoke_test_obj_vtbl
Definition: cstub.c:1045
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:68
#define memset(x, y, z)
Definition: compat.h:39

Referenced by START_TEST().

◆ test_Disconnect()

static void test_Disconnect ( IPSFactoryBuffer ppsf)
static

Definition at line 964 of file cstub.c.

965{
966 IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
967 IUnknown *obj = (IUnknown*)&orig_vtbl;
968 IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
969 CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
970
972 IRpcStubBuffer_Disconnect(pstub);
974 ok(cstd_stub->pvServerObject == NULL, "pvServerObject %p\n", cstd_stub->pvServerObject);
975 IRpcStubBuffer_Release(pstub);
976}

Referenced by START_TEST().

◆ test_NdrDllGetClassObject()

static IPSFactoryBuffer * test_NdrDllGetClassObject ( void  )
static

Definition at line 477 of file cstub.c.

478{
479 HMODULE rpcrt4 = GetModuleHandleA("rpcrt4.dll");
480 IPSFactoryBuffer *ppsf = NULL;
481 const PCInterfaceProxyVtblList* proxy_vtbl;
482 const PCInterfaceStubVtblList* stub_vtbl;
483 const CLSID CLSID_Unknown = {0x45678, 0x1234, 0x6666, {0xff, 0x67, 0x45, 0x98, 0x76, 0x12, 0x34, 0x56}};
484 static const GUID * const interfaces[] = { &IID_if1, &IID_if2, &IID_if3, &IID_if4 };
485 UINT i;
486 HRESULT r;
487 HMODULE hmod = GetModuleHandleA("rpcrt4.dll");
488 void *CStd_QueryInterface = GetProcAddress(hmod, "CStdStubBuffer_QueryInterface");
489 void *CStd_AddRef = GetProcAddress(hmod, "CStdStubBuffer_AddRef");
490 void *CStd_Release = GetProcAddress(hmod, "NdrCStdStubBuffer_Release");
491 void *CStd_Connect = GetProcAddress(hmod, "CStdStubBuffer_Connect");
492 void *CStd_Disconnect = GetProcAddress(hmod, "CStdStubBuffer_Disconnect");
493 void *CStd_Invoke = GetProcAddress(hmod, "CStdStubBuffer_Invoke");
494 void *CStd_IsIIDSupported = GetProcAddress(hmod, "CStdStubBuffer_IsIIDSupported");
495 void *CStd_CountRefs = GetProcAddress(hmod, "CStdStubBuffer_CountRefs");
496 void *CStd_DebugServerQueryInterface = GetProcAddress(hmod, "CStdStubBuffer_DebugServerQueryInterface");
497 void *CStd_DebugServerRelease = GetProcAddress(hmod, "CStdStubBuffer_DebugServerRelease");
498
499 r = NdrDllGetClassObject(&CLSID_Unknown, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
501 ok(r == CLASS_E_CLASSNOTAVAILABLE, "NdrDllGetClassObject with unknown clsid should have returned CLASS_E_CLASSNOTAVAILABLE instead of 0x%lx\n", r);
502 ok(ppsf == NULL, "NdrDllGetClassObject should have set ppsf to NULL on failure\n");
503
504 r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
506
507 ok(r == S_OK, "ret %08lx\n", r);
508 ok(ppsf != NULL, "ppsf == NULL\n");
509
510 proxy_vtbl = PSFactoryBuffer.pProxyFileList[0]->pProxyVtblList;
511 stub_vtbl = PSFactoryBuffer.pProxyFileList[0]->pStubVtblList;
512 ok(PSFactoryBuffer.pProxyFileList == proxy_file_list, "pfl not the same\n");
513 ok(proxy_vtbl == (PCInterfaceProxyVtblList *) &cstub_ProxyVtblList, "proxy vtbllist not the same\n");
514 ok(stub_vtbl == (PCInterfaceStubVtblList *) &cstub_StubVtblList, "stub vtbllist not the same\n");
515
516 /* if1 is non-delegating, if2 is delegating, if3 is non-delegating
517 but I've zero'ed the vtbl entries, similarly if4 is delegating
518 with zero'ed vtbl entries */
519
520#define VTBL_TEST_NOT_CHANGE_TO(name, i) \
521 ok(stub_vtbl[i]->Vtbl.name != CStd_##name, #name "vtbl %d updated %p %p\n", \
522 i, stub_vtbl[i]->Vtbl.name, CStd_##name )
523#define VTBL_TEST_CHANGE_TO(name, i) \
524 ok(check_address(stub_vtbl[i]->Vtbl.name, CStd_##name), #name "vtbl %d not updated %p %p\n", \
525 i, stub_vtbl[i]->Vtbl.name, CStd_##name )
526#define VTBL_TEST_ZERO(name, i) \
527 ok(stub_vtbl[i]->Vtbl.name == NULL, #name "vtbl %d not null %p\n", \
528 i, stub_vtbl[i]->Vtbl.name )
529
534 VTBL_TEST_NOT_CHANGE_TO(Disconnect, 0);
535 VTBL_TEST_NOT_CHANGE_TO(Invoke, 0);
536 VTBL_TEST_NOT_CHANGE_TO(IsIIDSupported, 0);
537 VTBL_TEST_NOT_CHANGE_TO(CountRefs, 0);
538 VTBL_TEST_NOT_CHANGE_TO(DebugServerQueryInterface, 0);
539 VTBL_TEST_NOT_CHANGE_TO(DebugServerRelease, 0);
540
545 VTBL_TEST_NOT_CHANGE_TO(Disconnect, 1);
546 VTBL_TEST_CHANGE_TO(Invoke, 1);
547 VTBL_TEST_CHANGE_TO(IsIIDSupported, 1);
548 VTBL_TEST_NOT_CHANGE_TO(CountRefs, 1);
549 VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 1);
550 VTBL_TEST_CHANGE_TO(DebugServerRelease, 1);
551
556 VTBL_TEST_CHANGE_TO(Disconnect, 2);
557 VTBL_TEST_CHANGE_TO(Invoke, 2);
558 VTBL_TEST_CHANGE_TO(IsIIDSupported, 2);
559 VTBL_TEST_CHANGE_TO(CountRefs, 2);
560 VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 2);
561 VTBL_TEST_CHANGE_TO(DebugServerRelease, 2);
562
567 VTBL_TEST_NOT_CHANGE_TO(Disconnect, 3);
568 VTBL_TEST_CHANGE_TO(Invoke, 3);
569 VTBL_TEST_CHANGE_TO(IsIIDSupported, 3);
570 VTBL_TEST_NOT_CHANGE_TO(CountRefs, 3);
571 VTBL_TEST_CHANGE_TO(DebugServerQueryInterface, 3);
572 VTBL_TEST_CHANGE_TO(DebugServerRelease, 3);
573
574#define VTBL_PROXY_TEST(i,num,ptr) \
575 ok( check_address(proxy_vtbl[i]->Vtbl[num], (ptr)), "wrong proxy %u func %u %p/%p\n", \
576 (i), (num), proxy_vtbl[i]->Vtbl[num], (ptr) )
577#define VTBL_PROXY_TEST_NOT_ZERO(i,num) \
578 ok( proxy_vtbl[i]->Vtbl[num] != NULL, "wrong proxy %u func %u is NULL\n", (i), (num))
579
585
586 VTBL_PROXY_TEST(1, 0, GetProcAddress(rpcrt4,"IUnknown_QueryInterface_Proxy"));
587 VTBL_PROXY_TEST(1, 1, GetProcAddress(rpcrt4,"IUnknown_AddRef_Proxy"));
588 VTBL_PROXY_TEST(1, 2, GetProcAddress(rpcrt4,"IUnknown_Release_Proxy"));
599
605
606 VTBL_PROXY_TEST(3, 0, GetProcAddress(rpcrt4,"IUnknown_QueryInterface_Proxy"));
607 VTBL_PROXY_TEST(3, 1, GetProcAddress(rpcrt4,"IUnknown_AddRef_Proxy"));
608 VTBL_PROXY_TEST(3, 2, GetProcAddress(rpcrt4,"IUnknown_Release_Proxy"));
613
614#undef VTBL_TEST_NOT_CHANGE_TO
615#undef VTBL_TEST_CHANGE_TO
616#undef VTBL_TEST_ZERO
617#undef VTBL_PROXY_TEST
618#undef VTBL_PROXY_TEST_NOT_ZERO
619
620 for (i = 0; i < ARRAY_SIZE(interfaces); i++)
621 ok( proxy_vtbl[i]->header.piid == interfaces[i],
622 "wrong proxy %u iid %p/%p\n", i, proxy_vtbl[i]->header.piid, interfaces[i] );
623
624 ok(PSFactoryBuffer.RefCount == 1, "ref count %ld\n", PSFactoryBuffer.RefCount);
625 IPSFactoryBuffer_Release(ppsf);
626
627 /* One can also search by IID */
628 r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
630 ok(r == S_OK, "ret %08lx\n", r);
631 ok(ppsf != NULL, "ppsf == NULL\n");
632 IPSFactoryBuffer_Release(ppsf);
633
634 r = NdrDllGetClassObject(&IID_if3, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
636 ok(r == S_OK, "ret %08lx\n", r);
637 ok(ppsf != NULL, "ppsf == NULL\n");
638 IPSFactoryBuffer_Release(ppsf);
639
640 /* but only if the PS factory implements it */
641 r = NdrDllGetClassObject(&IID_IDispatch, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
643 ok(r == CLASS_E_CLASSNOTAVAILABLE, "ret %08lx\n", r);
644
645 /* Create it again to return */
646 r = NdrDllGetClassObject(&CLSID_psfact, &IID_IPSFactoryBuffer, (void**)&ppsf, proxy_file_list,
648 ok(r == S_OK, "ret %08lx\n", r);
649 ok(ppsf != NULL, "ppsf == NULL\n");
650
651 /* Because this PS factory is not loaded as a dll in the normal way, Windows 8 / 10
652 get confused and will crash when one of the proxies for the delegated ifaces is created.
653 Registering the ifaces fixes this (in fact calling CoRegisterPSClsid() with any IID / CLSID is enough). */
654
656 ok(r == S_OK, "ret %08lx\n", r);
658 ok(r == S_OK, "ret %08lx\n", r);
660 ok(r == S_OK, "ret %08lx\n", r);
662 ok(r == S_OK, "ret %08lx\n", r);
663
664 return ppsf;
665}
#define ARRAY_SIZE(A)
Definition: main.h:20
_In_ BOOLEAN Release
Definition: cdrom.h:920
#define GetProcAddress(x, y)
Definition: compat.h:753
_In_ PKSPIN_CONNECT Connect
Definition: ks.h:4536
#define todo_wine
Definition: minitest.h:80
static PEXPLICIT_ACCESSW *static HMODULE hmod
Definition: security.c:143
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
#define VTBL_TEST_CHANGE_TO(name, i)
static const CInterfaceStubVtbl * cstub_StubVtblList[]
Definition: cstub.c:377
static CLSID CLSID_psfact
Definition: cstub.c:57
#define VTBL_TEST_NOT_CHANGE_TO(name, i)
#define VTBL_TEST_ZERO(name, i)
#define VTBL_PROXY_TEST(i, num, ptr)
#define VTBL_PROXY_TEST_NOT_ZERO(i, num)
static const ProxyFileInfo * proxy_file_list[]
Definition: cstub.c:471
static const CInterfaceProxyVtbl * cstub_ProxyVtblList[]
Definition: cstub.c:368
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:83
unsigned int UINT
Definition: ndis.h:50
const GUID IID_IDispatch
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:3772

Referenced by START_TEST().

◆ test_NdrDllRegisterProxy()

static void test_NdrDllRegisterProxy ( void  )
static

Definition at line 1194 of file cstub.c.

1195{
1196 HRESULT res;
1197 const ExtendedProxyFileInfo *pf;
1199
1200
1202 ok(res == E_HANDLE, "Incorrect return code %lx\n",res);
1203 pf = NULL;
1205 ok(res == E_NOINTERFACE, "Incorrect return code %lx\n",res);
1207 ok(res == E_NOINTERFACE, "Incorrect return code %lx\n",res);
1208 /* This fails on Vista and Windows 7 due to permissions */
1210 ok(res == S_OK || res == E_ACCESSDENIED, "NdrDllRegisterProxy failed %lx\n",res);
1211 if (res == S_OK)
1212 {
1214 ok(res == S_OK, "NdrDllUnregisterProxy failed %lx\n",res);
1215 }
1216}
HRESULT WINAPI NdrDllRegisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid)
Definition: cpsf.c:218
HRESULT WINAPI NdrDllUnregisterProxy(HMODULE hDll, const ProxyFileInfo **pProxyFileList, const CLSID *pclsid)
Definition: cpsf.c:286
GLuint res
Definition: glext.h:9613
static const ProxyFileInfo * proxy_file_list2[]
Definition: cstub.c:1189
#define E_HANDLE
Definition: winerror.h:4117
#define E_ACCESSDENIED
Definition: winerror.h:4116

Referenced by START_TEST().

◆ test_NdrStubForwardingFunction()

static void test_NdrStubForwardingFunction ( void  )
static

Definition at line 689 of file cstub.c.

690{
691 void *This[5];
692 void *real_this;
693 IRpcChannelBuffer *channel = (IRpcChannelBuffer*)0xdeadbeef;
694 RPC_MESSAGE *msg = (RPC_MESSAGE*)0xcafebabe;
695 DWORD *phase = (DWORD*)0x12345678;
696 IRpcStubBufferVtbl *base_buffer_vtbl_ptr = &base_buffer_vtbl;
697 IRpcStubBuffer *base_stub_buffer = (IRpcStubBuffer*)&base_buffer_vtbl_ptr;
698
699 memset(This, 0xcc, sizeof(This));
700 This[0] = base_stub_buffer;
701 real_this = &This[1];
702
703 NdrStubForwardingFunction( real_this, channel, msg, phase );
704 ok(base_buffer_invoke_called == 1, "base_buffer_invoke called %d times\n", base_buffer_invoke_called);
705
706}
void __RPC_STUB NdrStubForwardingFunction(IRpcStubBuffer *iface, IRpcChannelBuffer *pChannel, PRPC_MESSAGE pMsg, DWORD *pdwStubPhase)
Definition: cstub.c:421
static IRpcStubBufferVtbl base_buffer_vtbl
Definition: cstub.c:676

Referenced by START_TEST().

◆ test_Release()

static void test_Release ( IPSFactoryBuffer ppsf)
static

Definition at line 993 of file cstub.c.

994{
995 LONG facbuf_refs;
996 IUnknownVtbl *orig_vtbl = &connect_test_orig_vtbl;
997 IUnknown *obj = (IUnknown*)&orig_vtbl;
998 IUnknownVtbl *pretend_psfacbuf_vtbl = &release_test_pretend_psfacbuf_vtbl;
999 IUnknown *pretend_psfacbuf = (IUnknown *)&pretend_psfacbuf_vtbl;
1000 IRpcStubBuffer *pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
1001 CStdStubBuffer *cstd_stub = (CStdStubBuffer*)pstub;
1002
1003 facbuf_refs = PSFactoryBuffer.RefCount;
1004
1005 /* This shows that NdrCStdStubBuffer_Release doesn't call Disconnect */
1006 ok(cstd_stub->RefCount == 1, "ref count %ld\n", cstd_stub->RefCount);
1008 IRpcStubBuffer_Release(pstub);
1009todo_wine {
1011}
1012 ok(PSFactoryBuffer.RefCount == facbuf_refs - 1, "factory buffer refs %ld orig %ld\n", PSFactoryBuffer.RefCount, facbuf_refs);
1013
1014 /* This shows that NdrCStdStubBuffer_Release calls Release on its 2nd arg, rather than on This->pPSFactory
1015 (which are usually the same and indeed it's odd that _Release requires this 2nd arg). */
1016 pstub = create_stub(ppsf, &IID_if1, obj, S_OK);
1017 ok(PSFactoryBuffer.RefCount == facbuf_refs, "factory buffer refs %ld orig %ld\n", PSFactoryBuffer.RefCount, facbuf_refs);
1018 NdrCStdStubBuffer_Release(pstub, (IPSFactoryBuffer*)pretend_psfacbuf);
1019 ok(release_test_psfacbuf_release_called == 1, "pretend_psfacbuf_release called %d\n", release_test_psfacbuf_release_called);
1020 ok(PSFactoryBuffer.RefCount == facbuf_refs, "factory buffer refs %ld orig %ld\n", PSFactoryBuffer.RefCount, facbuf_refs);
1021}
static IUnknownVtbl release_test_pretend_psfacbuf_vtbl
Definition: cstub.c:986
long LONG
Definition: pedump.c:60

Referenced by START_TEST().

Variable Documentation

◆ __MIDL_ProcFormatString

const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString
static
Initial value:
=
{
0,
{
0, 0
}
}

Definition at line 87 of file cstub.c.

◆ __MIDL_TypeFormatString

const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString
static
Initial value:
=
{
0,
{
0, 0
}
}

Definition at line 95 of file cstub.c.

◆ aProxyFileList

const ProxyFileInfo* aProxyFileList
extern

◆ base_buffer_invoke_called

int base_buffer_invoke_called
static

Definition at line 667 of file cstub.c.

Referenced by base_buffer_Invoke(), and test_NdrStubForwardingFunction().

◆ base_buffer_vtbl

IRpcStubBufferVtbl base_buffer_vtbl
static
Initial value:
= {
(void*)0xcafebab0,
(void*)0xcafebab1,
(void*)0xcafebab2,
(void*)0xcafebab3,
(void*)0xcafebab4,
(void*)0xcafebab6,
(void*)0xcafebab7,
(void*)0xcafebab8,
(void*)0xcafebab9
}
static HRESULT WINAPI base_buffer_Invoke(IRpcStubBuffer *This, RPCOLEMESSAGE *msg, IRpcChannelBuffer *channel)
Definition: cstub.c:668

Definition at line 676 of file cstub.c.

Referenced by test_NdrStubForwardingFunction().

◆ base_iid_list

const IID* base_iid_list[]
static
Initial value:
=
{
&IID_ITypeLib,
}

Definition at line 395 of file cstub.c.

◆ base_iid_list2

const IID* base_iid_list2[]
static
Initial value:
=
{
}

Definition at line 1169 of file cstub.c.

◆ CLSID_psfact

CLSID CLSID_psfact = {0x1234567c, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
static

Definition at line 57 of file cstub.c.

Referenced by test_NdrDllGetClassObject().

◆ connect_test_base_Connect_called

int connect_test_base_Connect_called
static

Definition at line 893 of file cstub.c.

Referenced by connect_test_base_Connect(), and test_Connect().

◆ connect_test_base_stub_buffer_vtbl

IRpcStubBufferVtbl connect_test_base_stub_buffer_vtbl
static
Initial value:
=
{
(void*)0xcafebab0,
(void*)0xcafebab1,
(void*)0xcafebab2,
(void*)0xcafebab4,
(void*)0xcafebab5,
(void*)0xcafebab6,
(void*)0xcafebab7,
(void*)0xcafebab8,
(void*)0xcafebab9
}
static HRESULT WINAPI connect_test_base_Connect(IRpcStubBuffer *pstub, IUnknown *obj)
Definition: cstub.c:894

Definition at line 901 of file cstub.c.

Referenced by test_Connect().

◆ connect_test_new_fail_vtbl

IUnknownVtbl connect_test_new_fail_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI connect_test_new_fail_QI(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:879

Definition at line 886 of file cstub.c.

Referenced by test_Connect().

◆ connect_test_new_vtbl

IUnknownVtbl connect_test_new_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI connect_test_new_QI(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:864

Definition at line 872 of file cstub.c.

Referenced by test_Connect().

◆ connect_test_orig_release_called

int connect_test_orig_release_called
static

Definition at line 850 of file cstub.c.

Referenced by connect_test_orig_release(), test_Connect(), test_Disconnect(), and test_Release().

◆ connect_test_orig_vtbl

IUnknownVtbl connect_test_orig_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI connect_test_orig_QI(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:842
static ULONG WINAPI connect_test_orig_release(IUnknown *This)
Definition: cstub.c:851

Definition at line 857 of file cstub.c.

Referenced by test_Connect(), test_Disconnect(), and test_Release().

◆ create_stub_test_fail_vtbl

IUnknownVtbl create_stub_test_fail_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI create_stub_test_fail_QI(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:732

Definition at line 739 of file cstub.c.

Referenced by test_CreateStub().

◆ create_stub_test_vtbl

IUnknownVtbl create_stub_test_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI create_stub_test_QI(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:718

Definition at line 725 of file cstub.c.

Referenced by test_CreateStub().

◆ cstub_ProxyVtblList

const CInterfaceProxyVtbl* cstub_ProxyVtblList[]
static
Initial value:
=
{
(const CInterfaceProxyVtbl *) &if1_proxy_vtbl,
(const CInterfaceProxyVtbl *) &if2_proxy_vtbl,
(const CInterfaceProxyVtbl *) &if3_proxy_vtbl,
(const CInterfaceProxyVtbl *) &if4_proxy_vtbl,
}

Definition at line 368 of file cstub.c.

Referenced by test_NdrDllGetClassObject().

◆ cstub_ProxyVtblList2

const CInterfaceProxyVtbl* cstub_ProxyVtblList2[]
static
Initial value:
=
{
}

Definition at line 1154 of file cstub.c.

◆ cstub_StubVtblList

const CInterfaceStubVtbl* cstub_StubVtblList[]
static
Initial value:
=
{
}
static CInterfaceStubVtbl if2_stub_vtbl
Definition: cstub.c:273
static CInterfaceStubVtbl if3_stub_vtbl
Definition: cstub.c:313
static CInterfaceStubVtbl if1_stub_vtbl
Definition: cstub.c:191
static CInterfaceStubVtbl if4_stub_vtbl
Definition: cstub.c:357

Definition at line 377 of file cstub.c.

Referenced by test_NdrDllGetClassObject().

◆ cstub_StubVtblList2

const CInterfaceStubVtbl* cstub_StubVtblList2[]
static
Initial value:
=
{
}

Definition at line 1159 of file cstub.c.

◆ delegating_invoke_test_obj_vtbl

ITypeLibVtbl delegating_invoke_test_obj_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI delegating_invoke_test_addref(ITypeLib *pUnk)
Definition: cstub.c:1030
static UINT WINAPI delegating_invoke_test_get_type_info_count(ITypeLib *pUnk)
Definition: cstub.c:1040
static ULONG WINAPI delegating_invoke_test_release(ITypeLib *pUnk)
Definition: cstub.c:1035
static HRESULT WINAPI delegating_invoke_test_QI(ITypeLib *pUnk, REFIID iid, void **ppv)
Definition: cstub.c:1023

Definition at line 1045 of file cstub.c.

Referenced by test_delegating_Invoke().

◆ delegating_invoke_test_rpc_chan_vtbl

IRpcChannelBufferVtbl delegating_invoke_test_rpc_chan_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI delegating_invoke_chan_release(IRpcChannelBuffer *pchan)
Definition: cstub.c:1075
static ULONG WINAPI delegating_invoke_chan_add_ref(IRpcChannelBuffer *pchan)
Definition: cstub.c:1070
static HRESULT WINAPI delegating_invoke_chan_is_connected(IRpcChannelBuffer *pchan)
Definition: cstub.c:1112
static HRESULT WINAPI delegating_invoke_chan_free_buffer(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage)
Definition: cstub.c:1096
static HRESULT WINAPI delegating_invoke_chan_get_dest_ctx(IRpcChannelBuffer *pchan, DWORD *pdwDestContext, void **ppvDestContext)
Definition: cstub.c:1103
static HRESULT WINAPI delegating_invoke_chan_get_buffer(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *msg, REFIID iid)
Definition: cstub.c:1080
static HRESULT WINAPI delegating_invoke_chan_query_interface(IRpcChannelBuffer *pchan, REFIID iid, void **ppv)
Definition: cstub.c:1062
static HRESULT WINAPI delegating_invoke_chan_send_receive(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage, ULONG *pStatus)
Definition: cstub.c:1088

Definition at line 1118 of file cstub.c.

Referenced by test_delegating_Invoke().

◆ dummy_unknown

Definition at line 781 of file cstub.c.

◆ dummy_unknown_vtbl

IUnknownVtbl dummy_unknown_vtbl
static
Initial value:
=
{
}
static ULONG STDMETHODCALLTYPE dummy_Release()
static ULONG STDMETHODCALLTYPE dummy_AddRef()
static HRESULT WINAPI dummy_QueryInterface(IUnknown *This, REFIID iid, void **ppv)
Definition: cstub.c:757

Definition at line 775 of file cstub.c.

◆ gPFactory

◆ if1_FormatStringOffsetTable

const unsigned short if1_FormatStringOffsetTable[]
static
Initial value:
=
{
0,
0
}

Definition at line 167 of file cstub.c.

◆ if1_server_info

const MIDL_SERVER_INFO if1_server_info
static
Initial value:
=
{
0,
0,
0,
0,
0}
static const unsigned short if1_FormatStringOffsetTable[]
Definition: cstub.c:167
static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString
Definition: cstub.c:87
static const MIDL_STUB_DESC Object_StubDesc
Definition: cstub.c:103
unsigned char Format[PROC_FORMAT_STRING_SIZE]
Definition: client.c:20

Definition at line 173 of file cstub.c.

◆ if1_stub_vtbl

CInterfaceStubVtbl if1_stub_vtbl
static
Initial value:
=
{
{
5,
&if1_table[-3]
},
{
}
}
ULONG WINAPI CStdStubBuffer_CountRefs(LPRPCSTUBBUFFER iface)
Definition: cstub.c:326
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
void WINAPI CStdStubBuffer_Disconnect(LPRPCSTUBBUFFER iface)
Definition: cstub.c:270
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
HRESULT WINAPI CStdStubBuffer_Connect(LPRPCSTUBBUFFER iface, LPUNKNOWN lpUnkServer)
Definition: cstub.c:254
static const PRPC_STUB_FUNCTION if1_table[]
Definition: cstub.c:185
static const MIDL_SERVER_INFO if1_server_info
Definition: cstub.c:173
static ULONG WINAPI test_CStdStubBuffer_Release(IRpcStubBuffer *This)
Definition: cstub.c:43

Definition at line 191 of file cstub.c.

◆ if1_table

const PRPC_STUB_FUNCTION if1_table[]
static
Initial value:
=
{
}
static void __RPC_STUB if1_fn2_Stub(IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
Definition: cstub.c:146
static void __RPC_STUB if1_fn1_Stub(IRpcStubBuffer *This, IRpcChannelBuffer *_pRpcChannelBuffer, PRPC_MESSAGE _pRpcMessage, DWORD *_pdwStubPhase)
Definition: cstub.c:132

Definition at line 185 of file cstub.c.

◆ if2_FormatStringOffsetTable

const unsigned short if2_FormatStringOffsetTable[]
static
Initial value:
=
{
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
0
}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94

Definition at line 232 of file cstub.c.

◆ if2_server_info

const MIDL_SERVER_INFO if2_server_info
static
Initial value:
=
{
0,
0,
0,
0,
0}
static const unsigned short if2_FormatStringOffsetTable[]
Definition: cstub.c:232

Definition at line 247 of file cstub.c.

◆ if2_stub_vtbl

CInterfaceStubVtbl if2_stub_vtbl
static
Initial value:
=
{
{
13,
&if2_table[-3]
},
{ 0, 0, test_CStdStubBuffer2_Release, 0, 0, 0, 0, 0, 0, 0 }
}
static const PRPC_STUB_FUNCTION if2_table[]
Definition: cstub.c:259
static const MIDL_SERVER_INFO if2_server_info
Definition: cstub.c:247
static ULONG WINAPI test_CStdStubBuffer2_Release(IRpcStubBuffer *This)
Definition: cstub.c:48

Definition at line 273 of file cstub.c.

◆ if2_table

◆ if3_FormatStringOffsetTable

const unsigned short if3_FormatStringOffsetTable[]
static
Initial value:
=
{
0,
0
}

Definition at line 296 of file cstub.c.

◆ if3_server_info

const MIDL_SERVER_INFO if3_server_info
static
Initial value:
=
{
0,
0,
0,
0,
0}
static const unsigned short if3_FormatStringOffsetTable[]
Definition: cstub.c:296

Definition at line 302 of file cstub.c.

◆ if3_stub_vtbl

CInterfaceStubVtbl if3_stub_vtbl
static
Initial value:
=
{
{
5,
&if1_table[-3]
},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
}
static const MIDL_SERVER_INFO if3_server_info
Definition: cstub.c:302

Definition at line 313 of file cstub.c.

◆ if4_FormatStringOffsetTable

const unsigned short if4_FormatStringOffsetTable[]
static
Initial value:
=
{
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
(unsigned short) -1,
0
}

Definition at line 337 of file cstub.c.

◆ if4_server_info

const MIDL_SERVER_INFO if4_server_info
static
Initial value:
=
{
0,
0,
0,
0,
0}
static const unsigned short if4_FormatStringOffsetTable[]
Definition: cstub.c:337

Definition at line 346 of file cstub.c.

◆ if4_stub_vtbl

CInterfaceStubVtbl if4_stub_vtbl
static
Initial value:
=
{
{
7,
&if2_table[-3]
},
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
}
static const MIDL_SERVER_INFO if4_server_info
Definition: cstub.c:346

Definition at line 357 of file cstub.c.

◆ if_name_list

PCInterfaceName const if_name_list[]
static
Initial value:
=
{
"if1",
"if2",
"if3",
"if4",
}

Definition at line 386 of file cstub.c.

◆ if_name_list2

PCInterfaceName const if_name_list2[]
static
Initial value:
=
{
}

Definition at line 1164 of file cstub.c.

◆ IID_if1

◆ IID_if2

GUID IID_if2 = {0x12345679, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
static

◆ IID_if3

GUID IID_if3 = {0x1234567a, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
static

Definition at line 55 of file cstub.c.

Referenced by test_CreateProxy(), and test_NdrDllGetClassObject().

◆ IID_if4

GUID IID_if4 = {0x1234567b, 1234, 5678, {12,34,56,78,90,0xab,0xcd,0xef}}
static

Definition at line 56 of file cstub.c.

Referenced by CINTERFACE_PROXY_VTABLE(), test_CreateProxy(), and test_NdrDllGetClassObject().

◆ my_alloc_called

int my_alloc_called
static

Definition at line 59 of file cstub.c.

Referenced by my_alloc().

◆ my_free_called

int my_free_called
static

Definition at line 60 of file cstub.c.

Referenced by my_free().

◆ my_proxy_file_info

const ExtendedProxyFileInfo my_proxy_file_info
static
Initial value:
=
{
(const IID **) &base_iid_list,
4,
1,
0,
0,
0
}
static const IID * base_iid_list[]
Definition: cstub.c:395
static PCInterfaceName const if_name_list[]
Definition: cstub.c:386
static int __stdcall iid_lookup(const IID *pIID, int *pIndex)
Definition: cstub.c:406
const char * PCInterfaceName
Definition: rpcproxy.h:41

Definition at line 456 of file cstub.c.

◆ my_proxy_file_info2

const ExtendedProxyFileInfo my_proxy_file_info2
static
Initial value:
=
{
(const IID **) &base_iid_list2,
0,
1,
0,
0,
0
}
static PCInterfaceName const if_name_list2[]
Definition: cstub.c:1164
static const CInterfaceStubVtbl * cstub_StubVtblList2[]
Definition: cstub.c:1159
static const IID * base_iid_list2[]
Definition: cstub.c:1169
static const CInterfaceProxyVtbl * cstub_ProxyVtblList2[]
Definition: cstub.c:1154

Definition at line 1174 of file cstub.c.

◆ Object_StubDesc

const MIDL_STUB_DESC Object_StubDesc
static
Initial value:
=
{
{ 0 },
0,
0,
0,
0,
1,
0x20000,
0,
0x50100a4,
0,
0,
1,
0,
0,
0
}
static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString
Definition: cstub.c:95
static void *CALLBACK my_alloc(SIZE_T size)
Definition: cstub.c:62
static void CALLBACK my_free(void *ptr)
Definition: cstub.c:68
unsigned char Format[TYPE_FORMAT_STRING_SIZE]
Definition: client.c:14

Definition at line 103 of file cstub.c.

◆ proxy_file_list

const ProxyFileInfo* proxy_file_list[]
static
Initial value:
= {
}
static const ExtendedProxyFileInfo my_proxy_file_info
Definition: cstub.c:456

Definition at line 471 of file cstub.c.

Referenced by test_NdrDllGetClassObject(), and test_NdrDllRegisterProxy().

◆ proxy_file_list2

const ProxyFileInfo* proxy_file_list2[]
static
Initial value:
= {
}
static const ExtendedProxyFileInfo my_proxy_file_info2
Definition: cstub.c:1174

Definition at line 1189 of file cstub.c.

Referenced by test_NdrDllRegisterProxy().

◆ PSFactoryBuffer

Definition at line 41 of file cstub.c.

◆ release_test_pretend_psfacbuf_vtbl

IUnknownVtbl release_test_pretend_psfacbuf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI release_test_pretend_psfacbuf_release(IUnknown *pUnk)
Definition: cstub.c:980

Definition at line 986 of file cstub.c.

Referenced by test_Release().

◆ release_test_psfacbuf_release_called

int release_test_psfacbuf_release_called
static

Definition at line 979 of file cstub.c.

Referenced by release_test_pretend_psfacbuf_release(), and test_Release().

◆ test1_vtbl

const ITest1Vtbl test1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI test1_QueryInterface(ITest1 *iface, REFIID iid, void **out)
Definition: cstub.c:1237
static ULONG WINAPI test1_Release(ITest1 *iface)
Definition: cstub.c:1254
static ULONG WINAPI test1_AddRef(ITest1 *iface)
Definition: cstub.c:1249
static HRESULT WINAPI test1_GetClassID(ITest1 *iface, CLSID *clsid)
Definition: cstub.c:1259
static int WINAPI test1_square(ITest1 *iface, int x)
Definition: cstub.c:1265

Definition at line 1270 of file cstub.c.

Referenced by test_cf_CreateInstance().

◆ test_cf

IClassFactory test_cf = { &test_cf_vtbl }
static

Definition at line 1323 of file cstub.c.

Referenced by local_server_proc().

◆ test_cf_vtbl

const IClassFactoryVtbl test_cf_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI test_cf_LockServer(IClassFactory *iface, BOOL lock)
Definition: cstub.c:1309
static ULONG WINAPI test_cf_AddRef(IClassFactory *iface)
Definition: cstub.c:1290
static HRESULT WINAPI test_cf_QueryInterface(IClassFactory *iface, REFIID iid, void **out)
Definition: cstub.c:1279
static HRESULT WINAPI test_cf_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID iid, void **out)
Definition: cstub.c:1300
static ULONG WINAPI test_cf_Release(IClassFactory *iface)
Definition: cstub.c:1295

Definition at line 1314 of file cstub.c.

◆ test_chanbuf_refcount_test_rpc_chan_vtbl

IRpcChannelBufferVtbl test_chanbuf_refcount_test_rpc_chan_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI test_chanbuf_refcount_chan_get_dest_ctx(IRpcChannelBuffer *pchan, DWORD *pdwDestContext, void **ppvDestContext)
Definition: cstub.c:1476
static ULONG WINAPI test_chanbuf_refcount_chan_release(IRpcChannelBuffer *pchan)
Definition: cstub.c:1447
static HRESULT WINAPI test_chanbuf_refcount_chan_query_interface(IRpcChannelBuffer *pchan, REFIID iid, void **ppv)
Definition: cstub.c:1428
static HRESULT WINAPI test_chanbuf_refcount_chan_free_buffer(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage)
Definition: cstub.c:1469
static HRESULT WINAPI test_chanbuf_refcount_chan_is_connected(IRpcChannelBuffer *pchan)
Definition: cstub.c:1485
static HRESULT WINAPI test_chanbuf_refcount_chan_send_receive(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *pMessage, ULONG *pStatus)
Definition: cstub.c:1461
static ULONG WINAPI test_chanbuf_refcount_chan_add_ref(IRpcChannelBuffer *pchan)
Definition: cstub.c:1441
static HRESULT WINAPI test_chanbuf_refcount_chan_get_buffer(IRpcChannelBuffer *pchan, RPCOLEMESSAGE *msg, REFIID iid)
Definition: cstub.c:1453

Definition at line 1491 of file cstub.c.

Referenced by test_ChannelBufferRefCount().