ReactOS  0.4.14-dev-854-gb9426a3
tmarshal.c File Reference
#include <math.h>
#include <windows.h>
#include <ocidl.h>
#include <stdio.h>
#include "wine/test.h"
#include "tmarshal.h"
Include dependency graph for tmarshal.c:

Go to the source code of this file.

Classes

struct  host_object_data
 
struct  disp_obj
 
struct  coclass_obj
 
struct  Widget
 
struct  KindaEnum
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define ok_ole_success(hr, func)   ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
 
#define release_iface(a)   release_iface_(__LINE__, a)
 
#define ULL_CONST(dw1, dw2)   ((((ULONGLONG)dw1) << 32) | (ULONGLONG)dw2)
 
#define RELEASEMARSHALDATA   WM_USER
 

Typedefs

typedef struct Widget Widget
 
typedef struct KindaEnum KindaEnum
 

Functions

static HRESULT (WINAPI *pVarAdd)(LPVARIANT
 
static void release_iface_ (unsigned int line, void *iface)
 
static DWORD CALLBACK host_object_proc (LPVOID p)
 
static DWORD start_host_object2 (IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, IMessageFilter *filter, HANDLE *thread)
 
static DWORD start_host_object (IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, HANDLE *thread)
 
static void end_host_object (DWORD tid, HANDLE thread)
 
static HRESULT WINAPI ExternalConnection_QueryInterface (IExternalConnection *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ExternalConnection_AddRef (IExternalConnection *iface)
 
static ULONG WINAPI ExternalConnection_Release (IExternalConnection *iface)
 
static DWORD WINAPI ExternalConnection_AddConnection (IExternalConnection *iface, DWORD extconn, DWORD reserved)
 
static DWORD WINAPI ExternalConnection_ReleaseConnection (IExternalConnection *iface, DWORD extconn, DWORD reserved, BOOL fLastReleaseCloses)
 
static HRESULT WINAPI TestSecondIface_QueryInterface (ITestSecondIface *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TestSecondIface_AddRef (ITestSecondIface *iface)
 
static ULONG WINAPI TestSecondIface_Release (ITestSecondIface *iface)
 
static HRESULT WINAPI TestSecondIface_test (ITestSecondIface *iface)
 
static HRESULT WINAPI TestSecondDisp_QueryInterface (ITestSecondDisp *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI TestSecondDisp_AddRef (ITestSecondDisp *iface)
 
static ULONG WINAPI TestSecondDisp_Release (ITestSecondDisp *iface)
 
static HRESULT WINAPI TestSecondDisp_GetTypeInfoCount (ITestSecondDisp *iface, UINT *pctinfo)
 
static HRESULT WINAPI TestSecondDisp_GetTypeInfo (ITestSecondDisp *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI TestSecondDisp_GetIDsOfNames (ITestSecondDisp *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI TestSecondDisp_Invoke (ITestSecondDisp *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI TestSecondDisp_test (ITestSecondDisp *iface)
 
static HRESULT WINAPI TestDual_QueryInterface (ItestDual *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI TestDual_AddRef (ItestDual *iface)
 
static ULONG WINAPI TestDual_Release (ItestDual *iface)
 
static HRESULT WINAPI TestDual_GetTypeInfoCount (ItestDual *iface, UINT *pctinfo)
 
static HRESULT WINAPI TestDual_GetTypeInfo (ItestDual *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI TestDual_GetIDsOfNames (ItestDual *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI TestDual_Invoke (ItestDual *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static struct disp_objimpl_from_ISomethingFromDispatch (ISomethingFromDispatch *iface)
 
static HRESULT WINAPI disp_obj_QueryInterface (ISomethingFromDispatch *iface, REFIID iid, void **out)
 
static ULONG WINAPI disp_obj_AddRef (ISomethingFromDispatch *iface)
 
static ULONG WINAPI disp_obj_Release (ISomethingFromDispatch *iface)
 
static HRESULT WINAPI disp_obj_GetTypeInfoCount (ISomethingFromDispatch *iface, UINT *count)
 
static HRESULT WINAPI disp_obj_GetTypeInfo (ISomethingFromDispatch *iface, UINT index, LCID lcid, ITypeInfo **typeinfo)
 
static HRESULT WINAPI disp_obj_GetIDsOfNames (ISomethingFromDispatch *iface, REFIID iid, LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
 
static HRESULT WINAPI disp_obj_Invoke (ISomethingFromDispatch *iface, DISPID id, REFIID iid, LCID lcid, WORD flags, DISPPARAMS *dispparams, VARIANT *result, EXCEPINFO *excepinfo, UINT *errarg)
 
static HRESULT WINAPI disp_obj_anotherfn (ISomethingFromDispatch *iface)
 
static ISomethingFromDispatch * create_disp_obj (void)
 
static struct coclass_objimpl_from_ICoclass1 (ICoclass1 *iface)
 
static struct coclass_objimpl_from_ICoclass2 (ICoclass2 *iface)
 
static HRESULT WINAPI coclass1_QueryInterface (ICoclass1 *iface, REFIID iid, void **out)
 
static ULONG WINAPI coclass1_AddRef (ICoclass1 *iface)
 
static ULONG WINAPI coclass1_Release (ICoclass1 *iface)
 
static HRESULT WINAPI coclass1_GetTypeInfoCount (ICoclass1 *iface, UINT *count)
 
static HRESULT WINAPI coclass1_GetTypeInfo (ICoclass1 *iface, UINT index, LCID lcid, ITypeInfo **typeinfo)
 
static HRESULT WINAPI coclass1_GetIDsOfNames (ICoclass1 *iface, REFIID iid, LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
 
static HRESULT WINAPI coclass1_Invoke (ICoclass1 *iface, DISPID id, REFIID iid, LCID lcid, WORD flags, DISPPARAMS *dispparams, VARIANT *result, EXCEPINFO *excepinfo, UINT *errarg)
 
static HRESULT WINAPI coclass1_test (ICoclass1 *iface)
 
static HRESULT WINAPI coclass2_QueryInterface (ICoclass2 *iface, REFIID iid, void **out)
 
static ULONG WINAPI coclass2_AddRef (ICoclass2 *iface)
 
static ULONG WINAPI coclass2_Release (ICoclass2 *iface)
 
static HRESULT WINAPI coclass2_GetTypeInfoCount (ICoclass2 *iface, UINT *count)
 
static HRESULT WINAPI coclass2_GetTypeInfo (ICoclass2 *iface, UINT index, LCID lcid, ITypeInfo **typeinfo)
 
static HRESULT WINAPI coclass2_GetIDsOfNames (ICoclass2 *iface, REFIID iid, LPOLESTR *names, UINT count, LCID lcid, DISPID *ids)
 
static HRESULT WINAPI coclass2_Invoke (ICoclass2 *iface, DISPID id, REFIID iid, LCID lcid, WORD flags, DISPPARAMS *dispparams, VARIANT *result, EXCEPINFO *excepinfo, UINT *errarg)
 
static HRESULT WINAPI coclass2_test (ICoclass2 *iface)
 
static struct coclass_objcreate_coclass_obj (void)
 
static Widgetimpl_from_IWidget (IWidget *iface)
 
static HRESULT WINAPI Widget_QueryInterface (IWidget *iface, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
 
static ULONG WINAPI Widget_AddRef (IWidget *iface)
 
static ULONG WINAPI Widget_Release (IWidget *iface)
 
static HRESULT WINAPI Widget_GetTypeInfoCount (IWidget *iface, UINT __RPC_FAR *pctinfo)
 
static HRESULT WINAPI Widget_GetTypeInfo (IWidget __RPC_FAR *iface, UINT iTInfo, LCID lcid, ITypeInfo __RPC_FAR *__RPC_FAR *ppTInfo)
 
static HRESULT WINAPI Widget_GetIDsOfNames (IWidget __RPC_FAR *iface, REFIID riid, LPOLESTR __RPC_FAR *rgszNames, UINT cNames, LCID lcid, DISPID __RPC_FAR *rgDispId)
 
static HRESULT WINAPI Widget_Invoke (IWidget __RPC_FAR *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS __RPC_FAR *pDispParams, VARIANT __RPC_FAR *pVarResult, EXCEPINFO __RPC_FAR *pExcepInfo, UINT __RPC_FAR *puArgErr)
 
static HRESULT WINAPI Widget_put_Name (IWidget __RPC_FAR *iface, BSTR name)
 
static HRESULT WINAPI Widget_get_Name (IWidget __RPC_FAR *iface, BSTR __RPC_FAR *name)
 
static HRESULT WINAPI Widget_DoSomething (IWidget __RPC_FAR *iface, double number, BSTR *str1, BSTR str2, VARIANT __RPC_FAR *opt)
 
static HRESULT WINAPI Widget_get_State (IWidget __RPC_FAR *iface, STATE __RPC_FAR *state)
 
static HRESULT WINAPI Widget_put_State (IWidget __RPC_FAR *iface, STATE state)
 
static HRESULT WINAPI Widget_Map (IWidget *iface, BSTR bstrId, BSTR *sValue)
 
static HRESULT WINAPI Widget_SetOleColor (IWidget *iface, OLE_COLOR val)
 
static HRESULT WINAPI Widget_GetOleColor (IWidget *iface, OLE_COLOR *pVal)
 
static HRESULT WINAPI Widget_Clone (IWidget *iface, IWidget **ppVal)
 
static HRESULT WINAPI Widget_CloneDispatch (IWidget *iface, IDispatch **ppVal)
 
static HRESULT WINAPI Widget_CloneCoclass (IWidget *iface, ApplicationObject2 **ppVal)
 
static HRESULT WINAPI Widget_Value (IWidget __RPC_FAR *iface, VARIANT *value, VARIANT *retval)
 
static HRESULT WINAPI Widget_VariantArrayPtr (IWidget *iface, SAFEARRAY **values)
 
static HRESULT WINAPI Widget_VarArg (IWidget *iface, int numexpect, SAFEARRAY *values)
 
static HRESULT WINAPI Widget_Error (IWidget __RPC_FAR *iface)
 
static HRESULT WINAPI Widget_CloneInterface (IWidget __RPC_FAR *iface, ISomethingFromDispatch **ppVal)
 
static HRESULT WINAPI Widget_put_prop_with_lcid (IWidget *iface, LONG lcid, INT i)
 
static HRESULT WINAPI Widget_get_prop_with_lcid (IWidget *iface, LONG lcid, INT *i)
 
static HRESULT WINAPI Widget_get_prop_int (IWidget *iface, INT *i)
 
static HRESULT WINAPI Widget_get_prop_uint (IWidget *iface, UINT *i)
 
static HRESULT WINAPI Widget_ByRefUInt (IWidget *iface, UINT *i)
 
static HRESULT WINAPI Widget_put_prop_opt_arg (IWidget *iface, INT opt, INT i)
 
static HRESULT WINAPI Widget_put_prop_req_arg (IWidget *iface, INT req, INT i)
 
static HRESULT WINAPI Widget_pos_restrict (IWidget *iface, INT *i)
 
static HRESULT WINAPI Widget_neg_restrict (IWidget *iface, INT *i)
 
static HRESULT WINAPI Widget_VarArg_Run (IWidget *iface, BSTR name, SAFEARRAY *params, VARIANT *result)
 
static HRESULT WINAPI Widget_VarArg_Ref_Run (IWidget *iface, BSTR name, SAFEARRAY **params, VARIANT *result)
 
static HRESULT WINAPI Widget_basetypes_in (IWidget *iface, signed char c, short s, int i, hyper h, unsigned char uc, unsigned short us, unsigned int ui, MIDL_uhyper uh, float f, double d, STATE st)
 
static HRESULT WINAPI Widget_basetypes_out (IWidget *iface, signed char *c, short *s, int *i, hyper *h, unsigned char *uc, unsigned short *us, unsigned int *ui, MIDL_uhyper *uh, float *f, double *d, STATE *st)
 
static HRESULT WINAPI Widget_float_abi (IWidget *iface, float f, double d, int i, float f2, double d2)
 
static HRESULT WINAPI Widget_int_ptr (IWidget *iface, int *in, int *out, int *in_out)
 
static HRESULT WINAPI Widget_int_ptr_ptr (IWidget *iface, int **in, int **out, int **in_out)
 
static void check_iface_marshal (IUnknown *unk, IDispatch *disp, ISomethingFromDispatch *sfd)
 
static HRESULT WINAPI Widget_iface_in (IWidget *iface, IUnknown *unk, IDispatch *disp, ISomethingFromDispatch *sfd)
 
static HRESULT WINAPI Widget_iface_out (IWidget *iface, IUnknown **unk, IDispatch **disp, ISomethingFromDispatch **sfd)
 
static HRESULT WINAPI Widget_iface_ptr (IWidget *iface, ISomethingFromDispatch **in, ISomethingFromDispatch **out, ISomethingFromDispatch **in_out)
 
static HRESULT WINAPI Widget_bstr (IWidget *iface, BSTR in, BSTR *out, BSTR *in_ptr, BSTR *in_out)
 
static HRESULT WINAPI Widget_variant (IWidget *iface, VARIANT in, VARIANT *out, VARIANT *in_ptr, VARIANT *in_out)
 
static SAFEARRAYmake_safearray (ULONG len)
 
static void check_safearray (SAFEARRAY *sa, LONG expect)
 
static HRESULT WINAPI Widget_safearray (IWidget *iface, SAFEARRAY *in, SAFEARRAY **out, SAFEARRAY **in_ptr, SAFEARRAY **in_out)
 
static HRESULT WINAPI Widget_mystruct (IWidget *iface, MYSTRUCT in, MYSTRUCT *out, MYSTRUCT *in_ptr, MYSTRUCT *in_out)
 
static HRESULT WINAPI Widget_mystruct_ptr_ptr (IWidget *iface, MYSTRUCT **in)
 
static HRESULT WINAPI Widget_thin_struct (IWidget *iface, struct thin in)
 
static HRESULT WINAPI Widget_rect (IWidget *iface, RECT in, RECT *out, RECT *in_ptr, RECT *in_out)
 
static HRESULT WINAPI Widget_complex_struct (IWidget *iface, struct complex in)
 
static HRESULT WINAPI Widget_array (IWidget *iface, array_t in, array_t out, array_t in_out)
 
static HRESULT WINAPI Widget_variant_array (IWidget *iface, VARIANT in[2], VARIANT out[2], VARIANT in_out[2])
 
static HRESULT WINAPI Widget_mystruct_array (IWidget *iface, MYSTRUCT in[2])
 
static HRESULT WINAPI Widget_myint (IWidget *iface, myint_t val, myint_t *ptr, myint_t **ptr_ptr)
 
static HRESULT WINAPI Widget_Coclass (IWidget *iface, Coclass1 *class1, Coclass2 *class2, Coclass3 *class3)
 
static HRESULT WINAPI Widget_Coclass_ptr (IWidget *iface, Coclass1 **in, Coclass1 **out, Coclass1 **in_out)
 
static HRESULT WINAPI StaticWidget_QueryInterface (IStaticWidget *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI StaticWidget_AddRef (IStaticWidget *iface)
 
static ULONG WINAPI StaticWidget_Release (IStaticWidget *iface)
 
static HRESULT WINAPI StaticWidget_GetTypeInfoCount (IStaticWidget *iface, UINT *pctinfo)
 
static HRESULT WINAPI StaticWidget_GetTypeInfo (IStaticWidget *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI StaticWidget_GetIDsOfNames (IStaticWidget *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI StaticWidget_Invoke (IStaticWidget *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI StaticWidget_TestDual (IStaticWidget *iface, ItestDual *p)
 
static HRESULT WINAPI StaticWidget_TestSecondIface (IStaticWidget *iface, ITestSecondIface *p)
 
static KindaEnumimpl_from_IKindaEnumWidget (IKindaEnumWidget *iface)
 
static HRESULT register_current_module_typelib (void)
 
static ITypeInfoget_type_info (REFIID riid)
 
static IWidget * Widget_Create (void)
 
static HRESULT WINAPI KindaEnum_QueryInterface (IKindaEnumWidget *iface, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject)
 
static ULONG WINAPI KindaEnum_AddRef (IKindaEnumWidget *iface)
 
static ULONG WINAPI KindaEnum_Release (IKindaEnumWidget *iface)
 
static HRESULT WINAPI KindaEnum_Next (IKindaEnumWidget *iface, IWidget __RPC_FAR *__RPC_FAR *widget)
 
static HRESULT WINAPI KindaEnum_Count (IKindaEnumWidget *iface, ULONG __RPC_FAR *count)
 
static HRESULT WINAPI KindaEnum_Reset (IKindaEnumWidget *iface)
 
static HRESULT WINAPI KindaEnum_Clone (IKindaEnumWidget *iface, IKindaEnumWidget __RPC_FAR *__RPC_FAR *ppenum)
 
static IKindaEnumWidget * KindaEnumWidget_Create (void)
 
static HRESULT WINAPI NonOleAutomation_QueryInterface (INonOleAutomation *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI NonOleAutomation_AddRef (INonOleAutomation *iface)
 
static ULONG WINAPI NonOleAutomation_Release (INonOleAutomation *iface)
 
static BSTR WINAPI NonOleAutomation_BstrRet (INonOleAutomation *iface)
 
static HRESULT WINAPI NonOleAutomation_Error (INonOleAutomation *iface)
 
static ITypeInfoNonOleAutomation_GetTypeInfo (void)
 
static void test_marshal_basetypes (IWidget *widget, IDispatch *disp)
 
static void test_marshal_pointer (IWidget *widget, IDispatch *disp)
 
static void test_marshal_iface (IWidget *widget, IDispatch *disp)
 
static void test_marshal_bstr (IWidget *widget, IDispatch *disp)
 
static void test_marshal_variant (IWidget *widget, IDispatch *disp)
 
static void test_marshal_safearray (IWidget *widget, IDispatch *disp)
 
static void test_marshal_struct (IWidget *widget, IDispatch *disp)
 
static void test_marshal_array (IWidget *widget, IDispatch *disp)
 
static void test_marshal_coclass (IWidget *widget, IDispatch *disp)
 
static void test_typelibmarshal (void)
 
static void test_DispCallFunc (void)
 
static void test_StaticWidget (void)
 
static void test_libattr (void)
 
static void test_external_connection (void)
 
static void test_marshal_dispinterface (void)
 
 START_TEST (tmarshal)
 

Variables

static LPVARIANT
 
static const WCHAR test_bstr1 [] = {'f','o','o',0,'b','a','r'}
 
static const WCHAR test_bstr2 [] = {'t','e','s','t',0}
 
static const WCHAR test_bstr3 [] = {'q','u','x',0}
 
static const WCHAR test_bstr4 [] = {'a','b','c',0}
 
static const MYSTRUCT test_mystruct1 = {0x12345678, ULL_CONST(0xdeadbeef, 0x98765432), {0,1,2,3,4,5,6,7}}
 
static const MYSTRUCT test_mystruct2 = {0x91827364, ULL_CONST(0x88776655, 0x44332211), {3,6,1,4,0,1,3,0}}
 
static const MYSTRUCT test_mystruct3 = {0x1a1b1c1d, ULL_CONST(0x1e1f1011, 0x12131415), {9,2,4,5,6,5,1,3}}
 
static const MYSTRUCT test_mystruct4 = {0x2a2b2c2d, ULL_CONST(0x2e2f2021, 0x22232425), {0,4,6,7,3,6,7,4}}
 
static const MYSTRUCT test_mystruct5 = {0x3a3b3c3d, ULL_CONST(0x3e3f3031, 0x32333435), {1,6,7,3,8,4,6,5}}
 
static const MYSTRUCT test_mystruct6 = {0x4a4b4c4d, ULL_CONST(0x4e4f4041, 0x42434445), {3,6,5,3,4,8,0,9}}
 
static const MYSTRUCT test_mystruct7 = {0x5a5b5c5d, ULL_CONST(0x5e5f5051, 0x52535455), {1,8,4,4,4,2,3,1}}
 
static const struct thin test_thin_struct = {-456, 78}
 
static const RECT test_rect1 = {1,2,3,4}
 
static const RECT test_rect2 = {5,6,7,8}
 
static const RECT test_rect3 = {9,10,11,12}
 
static const RECT test_rect4 = {13,14,15,16}
 
static const RECT test_rect5 = {17,18,19,20}
 
static const RECT test_rect6 = {21,22,23,24}
 
static const RECT test_rect7 = {25,26,27,28}
 
static const array_t test_array1 = {1,2,3,4}
 
static const array_t test_array2 = {5,6,7,8}
 
static const array_t test_array3 = {9,10,11,12}
 
static const array_t test_array4 = {13,14,15,16}
 
static const array_t test_array5 = {17,18,19,20}
 
static const array_t test_array6 = {21,22,23,24}
 
static int external_connections
 
static BOOL expect_last_release_closes
 
static const IExternalConnectionVtbl ExternalConnectionVtbl
 
static IExternalConnection ExternalConnection = { &ExternalConnectionVtbl }
 
static ItestDual TestDual = { &TestDualVtbl }
 
static ItestDual TestDualDisp = { &TestDualVtbl }
 
static const ITestSecondIfaceVtbl TestSecondIfaceVtbl
 
static ITestSecondIface TestSecondIface = { &TestSecondIfaceVtbl }
 
static ITestSecondDispVtbl TestSecondDispVtbl
 
static ITestSecondDisp TestSecondDisp = { &TestSecondDispVtbl }
 
static ItestDualVtbl TestDualVtbl
 
static const ISomethingFromDispatchVtbl disp_obj_vtbl
 
static const ICoclass1Vtbl coclass1_vtbl
 
static const ICoclass2Vtbl coclass2_vtbl
 
static int testmode
 
static const struct IWidgetVtbl Widget_VTable
 
static const IStaticWidgetVtbl StaticWidgetVtbl
 
static IStaticWidget StaticWidget = { &StaticWidgetVtbl }
 
static const IKindaEnumWidgetVtbl KindaEnumWidget_VTable
 
static INonOleAutomationVtbl NonOleAutomation_VTable
 
static INonOleAutomation NonOleAutomation = { &NonOleAutomation_VTable }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 22 of file tmarshal.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 23 of file tmarshal.c.

◆ ok_ole_success

#define ok_ole_success (   hr,
  func 
)    ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)

Definition at line 36 of file tmarshal.c.

◆ release_iface

#define release_iface (   a)    release_iface_(__LINE__, a)

Definition at line 43 of file tmarshal.c.

◆ RELEASEMARSHALDATA

#define RELEASEMARSHALDATA   WM_USER

Definition at line 78 of file tmarshal.c.

◆ ULL_CONST

#define ULL_CONST (   dw1,
  dw2 
)    ((((ULONGLONG)dw1) << 32) | (ULONGLONG)dw2)

Definition at line 46 of file tmarshal.c.

Typedef Documentation

◆ KindaEnum

◆ Widget

typedef struct Widget Widget

Function Documentation

◆ check_iface_marshal()

static void check_iface_marshal ( IUnknown unk,
IDispatch disp,
ISomethingFromDispatch *  sfd 
)
static

Definition at line 1212 of file tmarshal.c.

1213 {
1214  ISomethingFromDispatch *sfd2;
1216  HRESULT hr;
1217 
1218  hr = IUnknown_QueryInterface(unk, &IID_ISomethingFromDispatch, (void **)&sfd2);
1219  ok(hr == S_OK, "Got hr %#x.\n", hr);
1220  ISomethingFromDispatch_Release(sfd2);
1221 
1222  hr = IDispatch_GetTypeInfo(disp, 0xdeadbeef, 0, &typeinfo);
1223  ok(hr == 0xbeefdead, "Got hr %#x.\n", hr);
1224 
1225  hr = ISomethingFromDispatch_anotherfn(sfd);
1226  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
1227 }
disp
Definition: i386-dis.c:3181
HRESULT hr
Definition: shlfolder.c:183
LONG HRESULT
Definition: typedefs.h:77
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:109
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_marshal_iface(), and Widget_iface_in().

◆ check_safearray()

static void check_safearray ( SAFEARRAY sa,
LONG  expect 
)
static

Definition at line 1367 of file tmarshal.c.

1368 {
1369  LONG len, i, *data;
1370  HRESULT hr;
1371 
1372  hr = SafeArrayGetUBound(sa, 1, &len);
1373  len++;
1374  ok(hr == S_OK, "Got hr %#x.\n", hr);
1375  ok(len == expect, "Expected len %d, got %d.\n", expect, len);
1376 
1377  hr = SafeArrayAccessData(sa, (void **)&data);
1378  ok(hr == S_OK, "Got hr %#x.\n", hr);
1379 
1380  for (i = 0; i < len; ++i)
1381  ok(data[i] == len + i, "Expected data %d at %d, got %d.\n", len + i, i, data[i]);
1382 
1384 }
HRESULT hr
Definition: shlfolder.c:183
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
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
long LONG
Definition: pedump.c:60
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI SafeArrayGetUBound(SAFEARRAY *psa, UINT nDim, LONG *plUbound)
Definition: safearray.c:1033
#define ok(value,...)
Definition: atltest.h:57
#define expect(expected, got)
Definition: combo.c:36
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168

Referenced by test_marshal_safearray(), and Widget_safearray().

◆ coclass1_AddRef()

static ULONG WINAPI coclass1_AddRef ( ICoclass1 *  iface)
static

Definition at line 532 of file tmarshal.c.

533 {
534  struct coclass_obj *obj = impl_from_ICoclass1(iface);
535  return ++obj->ref;
536 }
static struct coclass_obj * impl_from_ICoclass1(ICoclass1 *iface)
Definition: tmarshal.c:499

◆ coclass1_GetIDsOfNames()

static HRESULT WINAPI coclass1_GetIDsOfNames ( ICoclass1 *  iface,
REFIID  iid,
LPOLESTR names,
UINT  count,
LCID  lcid,
DISPID ids 
)
static

Definition at line 560 of file tmarshal.c.

562 {
563  ok(0, "unexpected call\n");
564  return E_NOTIMPL;
565 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass1_GetTypeInfo()

static HRESULT WINAPI coclass1_GetTypeInfo ( ICoclass1 *  iface,
UINT  index,
LCID  lcid,
ITypeInfo **  typeinfo 
)
static

Definition at line 553 of file tmarshal.c.

555 {
556  ok(index == 0xdeadbeef, "Got unexpected index %#x.\n", index);
557  return 0xbeefdead;
558 }
GLuint index
Definition: glext.h:6031
#define ok(value,...)
Definition: atltest.h:57

◆ coclass1_GetTypeInfoCount()

static HRESULT WINAPI coclass1_GetTypeInfoCount ( ICoclass1 *  iface,
UINT count 
)
static

Definition at line 547 of file tmarshal.c.

548 {
549  ok(0, "unexpected call\n");
550  return E_NOTIMPL;
551 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass1_Invoke()

static HRESULT WINAPI coclass1_Invoke ( ICoclass1 *  iface,
DISPID  id,
REFIID  iid,
LCID  lcid,
WORD  flags,
DISPPARAMS *  dispparams,
VARIANT result,
EXCEPINFO *  excepinfo,
UINT errarg 
)
static

Definition at line 567 of file tmarshal.c.

569 {
570  ok(0, "unexpected call\n");
571  return E_NOTIMPL;
572 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass1_QueryInterface()

static HRESULT WINAPI coclass1_QueryInterface ( ICoclass1 *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 509 of file tmarshal.c.

510 {
511  struct coclass_obj *obj = impl_from_ICoclass1(iface);
512 
513  if (IsEqualGUID(iid, &IID_IUnknown)
514  || IsEqualGUID(iid, &IID_IDispatch)
515  || IsEqualGUID(iid, &IID_ICoclass1))
516  {
517  *out = iface;
518  ICoclass1_AddRef(iface);
519  return S_OK;
520  }
521  else if (IsEqualGUID(iid, &IID_ICoclass2))
522  {
523  *out = &obj->ICoclass2_iface;
524  ICoclass2_AddRef(*out);
525  return S_OK;
526  }
527 
528  *out = NULL;
529  return E_NOINTERFACE;
530 }
#define E_NOINTERFACE
Definition: winerror.h:2364
smooth NULL
Definition: ftsmooth.c:416
static struct coclass_obj * impl_from_ICoclass1(ICoclass1 *iface)
Definition: tmarshal.c:499
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ coclass1_Release()

static ULONG WINAPI coclass1_Release ( ICoclass1 *  iface)
static

Definition at line 538 of file tmarshal.c.

539 {
540  struct coclass_obj *obj = impl_from_ICoclass1(iface);
541  LONG ref = --obj->ref;
542  if (!ref)
544  return ref;
545 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static struct coclass_obj * impl_from_ICoclass1(ICoclass1 *iface)
Definition: tmarshal.c:499

◆ coclass1_test()

static HRESULT WINAPI coclass1_test ( ICoclass1 *  iface)
static

Definition at line 574 of file tmarshal.c.

575 {
576  return 1;
577 }

◆ coclass2_AddRef()

static ULONG WINAPI coclass2_AddRef ( ICoclass2 *  iface)
static

Definition at line 585 of file tmarshal.c.

586 {
587  struct coclass_obj *obj = impl_from_ICoclass2(iface);
588  return ICoclass1_AddRef(&obj->ICoclass1_iface);
589 }
static struct coclass_obj * impl_from_ICoclass2(ICoclass2 *iface)
Definition: tmarshal.c:504

◆ coclass2_GetIDsOfNames()

static HRESULT WINAPI coclass2_GetIDsOfNames ( ICoclass2 *  iface,
REFIID  iid,
LPOLESTR names,
UINT  count,
LCID  lcid,
DISPID ids 
)
static

Definition at line 610 of file tmarshal.c.

612 {
613  ok(0, "unexpected call\n");
614  return E_NOTIMPL;
615 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass2_GetTypeInfo()

static HRESULT WINAPI coclass2_GetTypeInfo ( ICoclass2 *  iface,
UINT  index,
LCID  lcid,
ITypeInfo **  typeinfo 
)
static

Definition at line 603 of file tmarshal.c.

605 {
606  ok(index == 0xdeadbeef, "Got unexpected index %#x.\n", index);
607  return 0xbeefdead;
608 }
GLuint index
Definition: glext.h:6031
#define ok(value,...)
Definition: atltest.h:57

◆ coclass2_GetTypeInfoCount()

static HRESULT WINAPI coclass2_GetTypeInfoCount ( ICoclass2 *  iface,
UINT count 
)
static

Definition at line 597 of file tmarshal.c.

598 {
599  ok(0, "unexpected call\n");
600  return E_NOTIMPL;
601 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass2_Invoke()

static HRESULT WINAPI coclass2_Invoke ( ICoclass2 *  iface,
DISPID  id,
REFIID  iid,
LCID  lcid,
WORD  flags,
DISPPARAMS *  dispparams,
VARIANT result,
EXCEPINFO *  excepinfo,
UINT errarg 
)
static

Definition at line 617 of file tmarshal.c.

619 {
620  ok(0, "unexpected call\n");
621  return E_NOTIMPL;
622 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ coclass2_QueryInterface()

static HRESULT WINAPI coclass2_QueryInterface ( ICoclass2 *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 579 of file tmarshal.c.

580 {
581  struct coclass_obj *obj = impl_from_ICoclass2(iface);
582  return ICoclass1_QueryInterface(&obj->ICoclass1_iface, iid, out);
583 }
static struct coclass_obj * impl_from_ICoclass2(ICoclass2 *iface)
Definition: tmarshal.c:504
static FILE * out
Definition: regtests2xml.c:44

◆ coclass2_Release()

static ULONG WINAPI coclass2_Release ( ICoclass2 *  iface)
static

Definition at line 591 of file tmarshal.c.

592 {
593  struct coclass_obj *obj = impl_from_ICoclass2(iface);
594  return ICoclass1_Release(&obj->ICoclass1_iface);
595 }
static struct coclass_obj * impl_from_ICoclass2(ICoclass2 *iface)
Definition: tmarshal.c:504

◆ coclass2_test()

static HRESULT WINAPI coclass2_test ( ICoclass2 *  iface)
static

Definition at line 624 of file tmarshal.c.

625 {
626  return 2;
627 }

◆ create_coclass_obj()

static struct coclass_obj* create_coclass_obj ( void  )
static

Definition at line 653 of file tmarshal.c.

654 {
655  struct coclass_obj *obj = CoTaskMemAlloc(sizeof(*obj));
656  obj->ICoclass1_iface.lpVtbl = &coclass1_vtbl;
657  obj->ICoclass2_iface.lpVtbl = &coclass2_vtbl;
658  obj->ref = 1;
659  return obj;
660 };
static const ICoclass2Vtbl coclass2_vtbl
Definition: tmarshal.c:641
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
static const ICoclass1Vtbl coclass1_vtbl
Definition: tmarshal.c:629

Referenced by test_marshal_coclass(), and Widget_Coclass_ptr().

◆ create_disp_obj()

static ISomethingFromDispatch* create_disp_obj ( void  )
static

Definition at line 484 of file tmarshal.c.

485 {
486  struct disp_obj *obj = CoTaskMemAlloc(sizeof(*obj));
487  obj->ISomethingFromDispatch_iface.lpVtbl = &disp_obj_vtbl;
488  obj->ref = 1;
489  return &obj->ISomethingFromDispatch_iface;
490 }
static const ISomethingFromDispatchVtbl disp_obj_vtbl
Definition: tmarshal.c:472
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404

Referenced by test_marshal_dispinterface(), test_marshal_iface(), test_marshal_struct(), Widget_iface_out(), Widget_iface_ptr(), and Widget_variant_array().

◆ disp_obj_AddRef()

static ULONG WINAPI disp_obj_AddRef ( ISomethingFromDispatch *  iface)
static

Definition at line 425 of file tmarshal.c.

426 {
428  return ++obj->ref;
429 }
static struct disp_obj * impl_from_ISomethingFromDispatch(ISomethingFromDispatch *iface)
Definition: tmarshal.c:405

◆ disp_obj_anotherfn()

static HRESULT WINAPI disp_obj_anotherfn ( ISomethingFromDispatch *  iface)
static

Definition at line 467 of file tmarshal.c.

468 {
469  return 0x01234567;
470 }

◆ disp_obj_GetIDsOfNames()

static HRESULT WINAPI disp_obj_GetIDsOfNames ( ISomethingFromDispatch *  iface,
REFIID  iid,
LPOLESTR names,
UINT  count,
LCID  lcid,
DISPID ids 
)
static

Definition at line 453 of file tmarshal.c.

455 {
456  ok(0, "unexpected call\n");
457  return E_NOTIMPL;
458 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ disp_obj_GetTypeInfo()

static HRESULT WINAPI disp_obj_GetTypeInfo ( ISomethingFromDispatch *  iface,
UINT  index,
LCID  lcid,
ITypeInfo **  typeinfo 
)
static

Definition at line 446 of file tmarshal.c.

448 {
449  ok(index == 0xdeadbeef, "Got unexpected index %#x.\n", index);
450  return 0xbeefdead;
451 }
GLuint index
Definition: glext.h:6031
#define ok(value,...)
Definition: atltest.h:57

◆ disp_obj_GetTypeInfoCount()

static HRESULT WINAPI disp_obj_GetTypeInfoCount ( ISomethingFromDispatch *  iface,
UINT count 
)
static

Definition at line 440 of file tmarshal.c.

441 {
442  ok(0, "unexpected call\n");
443  return E_NOTIMPL;
444 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ disp_obj_Invoke()

static HRESULT WINAPI disp_obj_Invoke ( ISomethingFromDispatch *  iface,
DISPID  id,
REFIID  iid,
LCID  lcid,
WORD  flags,
DISPPARAMS *  dispparams,
VARIANT result,
EXCEPINFO *  excepinfo,
UINT errarg 
)
static

Definition at line 460 of file tmarshal.c.

462 {
463  ok(0, "unexpected call\n");
464  return E_NOTIMPL;
465 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ disp_obj_QueryInterface()

static HRESULT WINAPI disp_obj_QueryInterface ( ISomethingFromDispatch *  iface,
REFIID  iid,
void **  out 
)
static

Definition at line 410 of file tmarshal.c.

411 {
413  || IsEqualGUID(iid, &IID_ISomethingFromDispatch)
414  || IsEqualGUID(iid, &DIID_ItestIF4))
415  {
416  *out = iface;
417  ISomethingFromDispatch_AddRef(iface);
418  return S_OK;
419  }
420 
421  *out = NULL;
422  return E_NOINTERFACE;
423 }
#define E_NOINTERFACE
Definition: winerror.h:2364
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ disp_obj_Release()

static ULONG WINAPI disp_obj_Release ( ISomethingFromDispatch *  iface)
static

Definition at line 431 of file tmarshal.c.

432 {
434  LONG ref = --obj->ref;
435  if (!ref)
437  return ref;
438 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static struct disp_obj * impl_from_ISomethingFromDispatch(ISomethingFromDispatch *iface)
Definition: tmarshal.c:405

◆ end_host_object()

static void end_host_object ( DWORD  tid,
HANDLE  thread 
)
static

Definition at line 172 of file tmarshal.c.

173 {
175  ok(ret, "PostThreadMessage failed with error %d\n", GetLastError());
176  /* be careful of races - don't return until hosting thread has terminated */
179 }
#define CloseHandle
Definition: compat.h:406
#define WM_QUIT
Definition: winuser.h:1605
BOOL WINAPI PostThreadMessageA(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
unsigned int BOOL
Definition: ntddk_ex.h:94
static HANDLE thread
Definition: service.c:33
int ret
#define ok(value,...)
Definition: atltest.h:57
#define INFINITE
Definition: serial.h:102
static TfClientId tid

Referenced by test_external_connection(), test_marshal_dispinterface(), and test_typelibmarshal().

◆ ExternalConnection_AddConnection()

static DWORD WINAPI ExternalConnection_AddConnection ( IExternalConnection iface,
DWORD  extconn,
DWORD  reserved 
)
static

Definition at line 201 of file tmarshal.c.

202 {
203  trace("add connection\n");
204 
205  ok(extconn == EXTCONN_STRONG, "extconn = %d\n", extconn);
206  ok(!reserved, "reserved = %x\n", reserved);
207  return ++external_connections;
208 }
r reserved
Definition: btrfs.c:2865
static int external_connections
Definition: tmarshal.c:181
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57

◆ ExternalConnection_AddRef()

static ULONG WINAPI ExternalConnection_AddRef ( IExternalConnection iface)
static

Definition at line 191 of file tmarshal.c.

192 {
193  return 2;
194 }

◆ ExternalConnection_QueryInterface()

static HRESULT WINAPI ExternalConnection_QueryInterface ( IExternalConnection iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 184 of file tmarshal.c.

185 {
186  ok(0, "unexpected call\n");
187  *ppv = NULL;
188  return E_NOINTERFACE;
189 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define ok(value,...)
Definition: atltest.h:57

◆ ExternalConnection_Release()

static ULONG WINAPI ExternalConnection_Release ( IExternalConnection iface)
static

Definition at line 196 of file tmarshal.c.

197 {
198  return 1;
199 }

◆ ExternalConnection_ReleaseConnection()

static DWORD WINAPI ExternalConnection_ReleaseConnection ( IExternalConnection iface,
DWORD  extconn,
DWORD  reserved,
BOOL  fLastReleaseCloses 
)
static

Definition at line 210 of file tmarshal.c.

212 {
213  trace("release connection\n");
214 
215  ok(extconn == EXTCONN_STRONG, "extconn = %d\n", extconn);
216  ok(!reserved, "reserved = %x\n", reserved);
217 
218  ok(fLastReleaseCloses == expect_last_release_closes, "fLastReleaseCloses = %x, expected %x\n",
219  fLastReleaseCloses, expect_last_release_closes);
220  return --external_connections;
221 }
r reserved
Definition: btrfs.c:2865
static int external_connections
Definition: tmarshal.c:181
static BOOL expect_last_release_closes
Definition: tmarshal.c:182
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57

◆ get_type_info()

static ITypeInfo* get_type_info ( REFIID  riid)
static

Definition at line 1743 of file tmarshal.c.

1744 {
1745  ITypeInfo *pTypeInfo;
1746  ITypeLib *pTypeLib;
1747  HRESULT hr;
1748 
1749  hr = LoadRegTypeLib(&LIBID_TestTypelib, 2, 5, LOCALE_NEUTRAL, &pTypeLib);
1751  if (FAILED(hr))
1752  return NULL;
1753 
1754  hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, riid, &pTypeInfo);
1755  ITypeLib_Release(pTypeLib);
1756  ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
1757  if (FAILED(hr))
1758  return NULL;
1759 
1760  return pTypeInfo;
1761 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:531
#define LOCALE_NEUTRAL

Referenced by test_StaticWidget(), and Widget_Create().

◆ host_object_proc()

static DWORD CALLBACK host_object_proc ( LPVOID  p)
static

Definition at line 90 of file tmarshal.c.

91 {
92  struct host_object_data *data = p;
93  HRESULT hr;
94  MSG msg;
95 
97 
98  if (data->filter)
99  {
100  IMessageFilter * prev_filter = NULL;
101  hr = CoRegisterMessageFilter(data->filter, &prev_filter);
102  if (prev_filter) IMessageFilter_Release(prev_filter);
104  }
105 
106  hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags);
108 
109  /* force the message queue to be created before signaling parent thread */
111 
112  SetEvent(data->marshal_event);
113 
114  while (GetMessageA(&msg, NULL, 0, 0))
115  {
116  if (msg.hwnd == NULL && msg.message == RELEASEMARSHALDATA)
117  {
118  trace("releasing marshal data\n");
119  CoReleaseMarshalData(data->stream);
120  SetEvent((HANDLE)msg.lParam);
121  }
122  else
124  }
125 
127 
128  CoUninitialize();
129 
130  return hr;
131 }
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
Definition: marshal.c:2055
LRESULT WINAPI DispatchMessageA(_In_ const MSG *)
HRESULT hr
Definition: shlfolder.c:183
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
BOOL WINAPI GetMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
BOOL WINAPI PeekMessageA(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_NOREMOVE
Definition: winuser.h:1181
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define WM_USER
Definition: winuser.h:1877
#define RELEASEMARSHALDATA
Definition: tmarshal.c:78
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
#define msg(x)
Definition: auth_time.c:54
GLfloat GLfloat p
Definition: glext.h:8902
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1876
HRESULT WINAPI CoRegisterMessageFilter(LPMESSAGEFILTER lpMessageFilter, LPMESSAGEFILTER *lplpMessageFilter)
Definition: compobj.c:4046
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by start_host_object2().

◆ HRESULT()

static HRESULT ( WINAPI pVarAdd)
static

◆ impl_from_ICoclass1()

static struct coclass_obj* impl_from_ICoclass1 ( ICoclass1 *  iface)
inlinestatic

Definition at line 499 of file tmarshal.c.

500 {
501  return CONTAINING_RECORD(iface, struct coclass_obj, ICoclass1_iface);
502 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by coclass1_AddRef(), coclass1_QueryInterface(), and coclass1_Release().

◆ impl_from_ICoclass2()

static struct coclass_obj* impl_from_ICoclass2 ( ICoclass2 *  iface)
inlinestatic

Definition at line 504 of file tmarshal.c.

505 {
506  return CONTAINING_RECORD(iface, struct coclass_obj, ICoclass2_iface);
507 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by coclass2_AddRef(), coclass2_QueryInterface(), and coclass2_Release().

◆ impl_from_IKindaEnumWidget()

static KindaEnum* impl_from_IKindaEnumWidget ( IKindaEnumWidget *  iface)
inlinestatic

Definition at line 1719 of file tmarshal.c.

1720 {
1721  return CONTAINING_RECORD(iface, KindaEnum, IKindaEnumWidget_iface);
1722 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by KindaEnum_AddRef(), and KindaEnum_Release().

◆ impl_from_ISomethingFromDispatch()

static struct disp_obj* impl_from_ISomethingFromDispatch ( ISomethingFromDispatch *  iface)
inlinestatic

Definition at line 405 of file tmarshal.c.

406 {
407  return CONTAINING_RECORD(iface, struct disp_obj, ISomethingFromDispatch_iface);
408 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by disp_obj_AddRef(), and disp_obj_Release().

◆ impl_from_IWidget()

static Widget* impl_from_IWidget ( IWidget *  iface)
inlinestatic

Definition at line 671 of file tmarshal.c.

672 {
673  return CONTAINING_RECORD(iface, Widget, IWidget_iface);
674 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by Widget_AddRef(), Widget_GetIDsOfNames(), Widget_GetTypeInfo(), Widget_GetTypeInfoCount(), Widget_Invoke(), and Widget_Release().

◆ KindaEnum_AddRef()

static ULONG WINAPI KindaEnum_AddRef ( IKindaEnumWidget *  iface)
static

Definition at line 1810 of file tmarshal.c.

1812 {
1814 
1815  return InterlockedIncrement(&This->refs);
1816 }
static KindaEnum * impl_from_IKindaEnumWidget(IKindaEnumWidget *iface)
Definition: tmarshal.c:1719
#define InterlockedIncrement
Definition: armddk.h:53

◆ KindaEnum_Clone()

static HRESULT WINAPI KindaEnum_Clone ( IKindaEnumWidget *  iface,
IKindaEnumWidget __RPC_FAR *__RPC_FAR ppenum 
)
static

Definition at line 1857 of file tmarshal.c.

1860 {
1861  return E_NOTIMPL;
1862 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ KindaEnum_Count()

static HRESULT WINAPI KindaEnum_Count ( IKindaEnumWidget *  iface,
ULONG __RPC_FAR count 
)
static

Definition at line 1844 of file tmarshal.c.

1847 {
1848  return E_NOTIMPL;
1849 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ KindaEnum_Next()

static HRESULT WINAPI KindaEnum_Next ( IKindaEnumWidget *  iface,
IWidget __RPC_FAR *__RPC_FAR widget 
)
static

Definition at line 1833 of file tmarshal.c.

1836 {
1837  *widget = Widget_Create();
1838  if (*widget)
1839  return S_OK;
1840  else
1841  return E_OUTOFMEMORY;
1842 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define S_OK
Definition: intsafe.h:59
static IWidget * Widget_Create(void)
Definition: tmarshal.c:1763

◆ KindaEnum_QueryInterface()

static HRESULT WINAPI KindaEnum_QueryInterface ( IKindaEnumWidget *  iface,
REFIID  riid,
void __RPC_FAR *__RPC_FAR ppvObject 
)
static

Definition at line 1792 of file tmarshal.c.

1796 {
1797  if (IsEqualIID(riid, &IID_IKindaEnumWidget) || IsEqualIID(riid, &IID_IUnknown))
1798  {
1799  IKindaEnumWidget_AddRef(iface);
1800  *ppvObject = iface;
1801  return S_OK;
1802  }
1803  else
1804  {
1805  *ppvObject = NULL;
1806  return E_NOINTERFACE;
1807  }
1808 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ KindaEnum_Release()

static ULONG WINAPI KindaEnum_Release ( IKindaEnumWidget *  iface)
static

Definition at line 1818 of file tmarshal.c.

1820 {
1822  ULONG refs = InterlockedDecrement(&This->refs);
1823  if (!refs)
1824  {
1825  memset(This, 0xcc, sizeof(*This));
1826  HeapFree(GetProcessHeap(), 0, This);
1827  trace("KindaEnumWidget destroyed!\n");
1828  }
1829 
1830  return refs;
1831 }
static KindaEnum * impl_from_IKindaEnumWidget(IKindaEnumWidget *iface)
Definition: tmarshal.c:1719
#define GetProcessHeap()
Definition: compat.h:403
#define trace
Definition: atltest.h:70
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define HeapFree(x, y, z)
Definition: compat.h:402

◆ KindaEnum_Reset()

static HRESULT WINAPI KindaEnum_Reset ( IKindaEnumWidget *  iface)
static

Definition at line 1851 of file tmarshal.c.

1853 {
1854  return E_NOTIMPL;
1855 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ KindaEnumWidget_Create()

static IKindaEnumWidget* KindaEnumWidget_Create ( void  )
static

Definition at line 1875 of file tmarshal.c.

1876 {
1877  KindaEnum *This;
1878 
1879  This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This));
1880  if (!This) return NULL;
1881  This->IKindaEnumWidget_iface.lpVtbl = &KindaEnumWidget_VTable;
1882  This->refs = 1;
1883  return &This->IKindaEnumWidget_iface;
1884 }
static const IKindaEnumWidgetVtbl KindaEnumWidget_VTable
Definition: tmarshal.c:1864
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)

Referenced by test_typelibmarshal().

◆ make_safearray()

static SAFEARRAY* make_safearray ( ULONG  len)
static

Definition at line 1354 of file tmarshal.c.

1355 {
1357  int i, *data;
1358 
1359  SafeArrayAccessData(sa, (void **)&data);
1360  for (i = 0; i < len; ++i)
1361  data[i] = len + i;
1363 
1364  return sa;
1365 }
Definition: compat.h:1947
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
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
SAFEARRAY *WINAPI SafeArrayCreateVector(VARTYPE vt, LONG lLbound, ULONG cElements)
Definition: safearray.c:677
GLenum GLsizei len
Definition: glext.h:6722
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168

Referenced by test_marshal_safearray(), and Widget_safearray().

◆ NonOleAutomation_AddRef()

static ULONG WINAPI NonOleAutomation_AddRef ( INonOleAutomation *  iface)
static

Definition at line 1897 of file tmarshal.c.

1898 {
1899  return 2;
1900 }

◆ NonOleAutomation_BstrRet()

static BSTR WINAPI NonOleAutomation_BstrRet ( INonOleAutomation *  iface)
static

Definition at line 1907 of file tmarshal.c.

1908 {
1909  static const WCHAR wszTestString[] = {'T','h','i','s',' ','i','s',' ','a',' ','t','e','s','t',' ','s','t','r','i','n','g',0};
1910  return SysAllocString(wszTestString);
1911 }
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ NonOleAutomation_Error()

static HRESULT WINAPI NonOleAutomation_Error ( INonOleAutomation *  iface)
static

Definition at line 1913 of file tmarshal.c.

1914 {
1915  return E_NOTIMPL;
1916 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ NonOleAutomation_GetTypeInfo()

static ITypeInfo* NonOleAutomation_GetTypeInfo ( void  )
static

Definition at line 1929 of file tmarshal.c.

1930 {
1931  ITypeLib *pTypeLib;
1932  HRESULT hr = LoadRegTypeLib(&LIBID_TestTypelib, 2, 5, LOCALE_NEUTRAL, &pTypeLib);
1934  if (SUCCEEDED(hr))
1935  {
1936  ITypeInfo *pTypeInfo;
1937  hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_INonOleAutomation, &pTypeInfo);
1938  ok_ole_success(hr, ITypeLib_GetTypeInfoOfGuid);
1939  ITypeLib_Release(pTypeLib);
1940  return pTypeInfo;
1941  }
1942  return NULL;
1943 }
HRESULT hr
Definition: shlfolder.c:183
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:531
#define LOCALE_NEUTRAL
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by test_typelibmarshal().

◆ NonOleAutomation_QueryInterface()

static HRESULT WINAPI NonOleAutomation_QueryInterface ( INonOleAutomation *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1886 of file tmarshal.c.

1887 {
1888  if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_INonOleAutomation))
1889  {
1890  *(INonOleAutomation **)ppv = iface;
1891  return S_OK;
1892  }
1893  *ppv = NULL;
1894  return E_NOINTERFACE;
1895 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ NonOleAutomation_Release()

static ULONG WINAPI NonOleAutomation_Release ( INonOleAutomation *  iface)
static

Definition at line 1902 of file tmarshal.c.

1903 {
1904  return 1;
1905 }

◆ register_current_module_typelib()

static HRESULT register_current_module_typelib ( void  )
static

Definition at line 1724 of file tmarshal.c.

1725 {
1726  WCHAR path[MAX_PATH];
1727  CHAR pathA[MAX_PATH];
1728  HRESULT hr;
1729  ITypeLib *typelib;
1730 
1733 
1734  hr = LoadTypeLib(path, &typelib);
1735  if (SUCCEEDED(hr))
1736  {
1738  ITypeLib_Release(typelib);
1739  }
1740  return hr;
1741 }
HRESULT hr
Definition: shlfolder.c:183
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
static ITypeLib * typelib
Definition: apps.c:108
HRESULT WINAPI LoadTypeLib(const OLECHAR *szFile, ITypeLib **pptLib)
Definition: typelib.c:458
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:548
smooth NULL
Definition: ftsmooth.c:416
HRESULT WINAPI RegisterTypeLib(ITypeLib *ptlib, const WCHAR *szFullPath, const WCHAR *szHelpDir)
Definition: typelib.c:656
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
#define MultiByteToWideChar
Definition: compat.h:100
GLuint pathA
Definition: glext.h:11719
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ release_iface_()

static void release_iface_ ( unsigned int  line,
void iface 
)
inlinestatic

Definition at line 37 of file tmarshal.c.

38 {
39  ULONG ref = IUnknown_Release((IUnknown *)iface);
40  ok_(__FILE__, line)(!ref, "Got outstanding refcount %d.\n", ref);
41  if (ref == 1) IUnknown_Release((IUnknown *)iface);
42 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
Definition: parser.c:48
unsigned int ULONG
Definition: retypes.h:1
#define ok_(x1, x2)
Definition: atltest.h:61

◆ start_host_object()

static DWORD start_host_object ( IStream stream,
REFIID  riid,
IUnknown object,
MSHLFLAGS  marshal_flags,
HANDLE thread 
)
static

Definition at line 155 of file tmarshal.c.

156 {
158 }
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
static HANDLE thread
Definition: service.c:33
Definition: parse.h:22
MSHLFLAGS marshal_flags
Definition: marshal.c:607
static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, IMessageFilter *filter, HANDLE *thread)
Definition: tmarshal.c:133

Referenced by test_external_connection(), test_marshal_dispinterface(), and test_typelibmarshal().

◆ start_host_object2()

static DWORD start_host_object2 ( IStream stream,
REFIID  riid,
IUnknown object,
MSHLFLAGS  marshal_flags,
IMessageFilter filter,
HANDLE thread 
)
static

Definition at line 133 of file tmarshal.c.

134 {
135  DWORD tid = 0;
137  struct host_object_data *data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data));
138 
139  data->stream = stream;
140  data->iid = *riid;
141  data->object = object;
142  data->marshal_flags = marshal_flags;
143  data->marshal_event = marshal_event;
144  data->filter = filter;
145 
147 
148  /* wait for marshaling to complete before returning */
151 
152  return tid;
153 }
#define CloseHandle
Definition: compat.h:406
REFIID riid
Definition: precomp.h:44
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:136
HANDLE marshal_event
Definition: marshal.c:611
smooth NULL
Definition: ftsmooth.c:416
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCSTR lpName OPTIONAL)
Definition: synch.c:637
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static HANDLE thread
Definition: service.c:33
GLuint GLuint stream
Definition: glext.h:7522
MSHLFLAGS marshal_flags
Definition: marshal.c:607
static DWORD CALLBACK host_object_proc(LPVOID p)
Definition: tmarshal.c:90
#define INFINITE
Definition: serial.h:102
static TfClientId tid
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
void * object
Definition: jmemsys.h:48

Referenced by start_host_object().

◆ START_TEST()

START_TEST ( tmarshal  )

Definition at line 3680 of file tmarshal.c.

3681 {
3682  HRESULT hr;
3683  HANDLE hOleaut32 = GetModuleHandleA("oleaut32.dll");
3684  pVarAdd = (void*)GetProcAddress(hOleaut32, "VarAdd");
3685 
3687 
3689  if (FAILED(hr))
3690  {
3691  CoUninitialize();
3692  win_skip("Registration of the test typelib failed, skipping tests\n");
3693  return;
3694  }
3695 
3699  test_libattr();
3702 
3703  hr = UnRegisterTypeLib(&LIBID_TestTypelib, 2, 5, LOCALE_NEUTRAL,
3704  sizeof(void*) == 8 ? SYS_WIN64 : SYS_WIN32);
3706 
3707  CoUninitialize();
3708 }
static void test_StaticWidget(void)
Definition: tmarshal.c:3467
static void test_DispCallFunc(void)
Definition: tmarshal.c:3437
HRESULT hr
Definition: shlfolder.c:183
static HMODULE hOleaut32
Definition: olefont.c:50
static void test_external_connection(void)
Definition: tmarshal.c:3532
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
static void test_libattr(void)
Definition: tmarshal.c:3509
smooth NULL
Definition: ftsmooth.c:416
static void test_typelibmarshal(void)
Definition: tmarshal.c:2828
LONG HRESULT
Definition: typedefs.h:77
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
HRESULT WINAPI UnRegisterTypeLib(REFGUID libid, WORD wVerMajor, WORD wVerMinor, LCID lcid, SYSKIND syskind)
Definition: typelib.c:882
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
#define LOCALE_NEUTRAL
#define GetProcAddress(x, y)
Definition: compat.h:418
#define win_skip
Definition: test.h:149
static void test_marshal_dispinterface(void)
Definition: tmarshal.c:3649
static HRESULT register_current_module_typelib(void)
Definition: tmarshal.c:1724

◆ StaticWidget_AddRef()

static ULONG WINAPI StaticWidget_AddRef ( IStaticWidget *  iface)
static

Definition at line 1647 of file tmarshal.c.

1648 {
1649  return 2;
1650 }

◆ StaticWidget_GetIDsOfNames()

static HRESULT WINAPI StaticWidget_GetIDsOfNames ( IStaticWidget *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1670 of file tmarshal.c.

1672 {
1673  ok(0, "unexpected call\n");
1674  return E_NOTIMPL;
1675 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ StaticWidget_GetTypeInfo()

static HRESULT WINAPI StaticWidget_GetTypeInfo ( IStaticWidget *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1663 of file tmarshal.c.

1665 {
1666  ok(0, "unexpected call\n");
1667  return E_NOTIMPL;
1668 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ StaticWidget_GetTypeInfoCount()

static HRESULT WINAPI StaticWidget_GetTypeInfoCount ( IStaticWidget *  iface,
UINT pctinfo 
)
static

Definition at line 1657 of file tmarshal.c.

1658 {
1659  ok(0, "unexpected call\n");
1660  return E_NOTIMPL;
1661 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ StaticWidget_Invoke()

static HRESULT WINAPI StaticWidget_Invoke ( IStaticWidget *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1677 of file tmarshal.c.

1680 {
1681  ok(0, "unexpected call\n");
1682  return E_NOTIMPL;
1683 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ StaticWidget_QueryInterface()

static HRESULT WINAPI StaticWidget_QueryInterface ( IStaticWidget *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 1634 of file tmarshal.c.

1635 {
1636  if (IsEqualIID(riid, &IID_IStaticWidget) || IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDispatch))
1637  {
1638  IStaticWidget_AddRef(iface);
1639  *ppvObject = iface;
1640  return S_OK;
1641  }
1642 
1643  *ppvObject = NULL;
1644  return E_NOINTERFACE;
1645 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:59
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ StaticWidget_Release()

static ULONG WINAPI StaticWidget_Release ( IStaticWidget *  iface)
static

Definition at line 1652 of file tmarshal.c.

1653 {
1654  return 1;
1655 }

◆ StaticWidget_TestDual()

static HRESULT WINAPI StaticWidget_TestDual ( IStaticWidget *  iface,
ItestDual *  p 
)
static

Definition at line 1685 of file tmarshal.c.

1686 {
1687  trace("TestDual()\n");
1688  ok(p == &TestDual, "wrong ItestDual\n");
1689  return S_OK;
1690 }
static ItestDual TestDual
Definition: tmarshal.c:233
#define trace
Definition: atltest.h:70
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLfloat GLfloat p
Definition: glext.h:8902

◆ StaticWidget_TestSecondIface()

static HRESULT WINAPI StaticWidget_TestSecondIface ( IStaticWidget *  iface,
ITestSecondIface *  p 
)
static

Definition at line 1692 of file tmarshal.c.

1693 {
1694  trace("TestSecondIface()\n");
1695  ok(p == &TestSecondIface, "wrong ItestSecondIface\n");
1696  return S_OK;
1697 }
static ITestSecondIface TestSecondIface
Definition: tmarshal.c:262
#define trace
Definition: atltest.h:70
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
GLfloat GLfloat p
Definition: glext.h:8902

◆ test_DispCallFunc()

static void test_DispCallFunc ( void  )
static

Definition at line 3437 of file tmarshal.c.

3438 {
3439  static const WCHAR szEmpty[] = { 0 };
3440  VARTYPE rgvt[] = { VT_R8, VT_BSTR, VT_BSTR, VT_VARIANT|VT_BYREF };
3441  VARIANTARG vararg[4];
3442  VARIANTARG varref;
3443  VARIANTARG *rgpvarg[4] = { &vararg[0], &vararg[1], &vararg[2], &vararg[3] };
3444  VARIANTARG varresult;
3445  HRESULT hr;
3446  IWidget *pWidget = Widget_Create();
3447  V_VT(&vararg[0]) = VT_R8;
3448  V_R8(&vararg[0]) = 3.141;
3449  V_VT(&vararg[1]) = VT_BSTR;
3450  V_BSTRREF(&vararg[1]) = CoTaskMemAlloc(sizeof(BSTR));
3451  V_VT(&vararg[2]) = VT_BSTR;
3452  V_BSTR(&vararg[2]) = SysAllocString(szEmpty);
3453  V_VT(&vararg[3]) = VT_VARIANT|VT_BYREF;
3454  V_VARIANTREF(&vararg[3]) = &varref;
3455  V_VT(&varref) = VT_ERROR;
3456  V_ERROR(&varref) = DISP_E_PARAMNOTFOUND;
3457  VariantInit(&varresult);
3458  hr = DispCallFunc(pWidget, 9*sizeof(void*), CC_STDCALL, VT_UI4, 4, rgvt, rgpvarg, &varresult);
3460  VariantClear(&varresult);
3461  SysFreeString(*V_BSTRREF(&vararg[1]));
3462  CoTaskMemFree(V_BSTRREF(&vararg[1]));
3463  VariantClear(&vararg[2]);
3464  IWidget_Release(pWidget);
3465 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
HRESULT hr
Definition: shlfolder.c:183
#define V_R8(A)
Definition: oleauto.h:262
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
OLECHAR * BSTR
Definition: compat.h:1942
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static const WCHAR szEmpty[]
Definition: provider.c:50
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
unsigned short VARTYPE
Definition: compat.h:1903
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_ERROR(A)
Definition: oleauto.h:241
static IWidget * Widget_Create(void)
Definition: tmarshal.c:1763
#define V_VARIANTREF(A)
Definition: oleauto.h:283
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:404
HRESULT WINAPI DispCallFunc(void *pvInstance, ULONG_PTR oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals, VARTYPE *prgvt, VARIANTARG **prgpvarg, VARIANT *pvargResult)
Definition: typelib.c:7071
Definition: compat.h:1949
#define V_BSTRREF(A)
Definition: oleauto.h:227

Referenced by START_TEST().

◆ test_external_connection()

static void test_external_connection ( void  )
static

Definition at line 3532 of file tmarshal.c.

3533 {
3534  IStream *stream, *stream2;
3535  ITestSecondDisp *second;
3536  ItestDual *iface;
3537  HANDLE thread;
3538  DWORD tid;
3539  HRESULT hres;
3540 
3541  static const LARGE_INTEGER zero;
3542 
3543  trace("Testing IExternalConnection...\n");
3544 
3546 
3547  /* Marshaling an interface increases external connection count. */
3550  ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres);
3551  tid = start_host_object(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHLFLAGS_NORMAL, &thread);
3552  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3553 
3554  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3555  hres = CoUnmarshalInterface(stream, &IID_ItestDual, (void**)&iface);
3556  ok(hres == S_OK, "CoUnmarshalInterface failed: %08x\n", hres);
3557  if (FAILED(hres))
3558  {
3560  IStream_Release(stream);
3561  return;
3562  }
3563  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3564 
3565  IStream_Release(stream);
3566  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3567 
3568  /* Creating a stub for new iface causes new external connection. */
3569  hres = ItestDual_QueryInterface(iface, &IID_ITestSecondDisp, (void**)&second);
3570  ok(hres == S_OK, "Could not get ITestSecondDisp iface: %08x\n", hres);
3571  todo_wine
3572  ok(external_connections == 2, "external_connections = %d\n", external_connections);
3573 
3574  ITestSecondDisp_Release(second);
3575  todo_wine
3576  ok(external_connections == 2, "external_connections = %d\n", external_connections);
3577 
3579  ItestDual_Release(iface);
3580  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3581 
3583 
3584  /* A test with direct CoMarshalInterface call. */
3586  ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres);
3587 
3589  hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
3590  ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
3591  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3592 
3594  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3596  ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
3597  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3598 
3599  /* Two separated marshal data are still one external connection. */
3600  hres = CreateStreamOnHGlobal(NULL, TRUE, &stream2);
3601  ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres);
3602 
3604  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3605  hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
3606  ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
3607  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3608 
3609  hres = CoMarshalInterface(stream2, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
3610  ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
3611  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3612 
3613  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3615  ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
3616  ok(external_connections == 1, "external_connections = %d\n", external_connections);
3617 
3619  IStream_Seek(stream2, zero, STREAM_SEEK_SET, NULL);
3620  hres = CoReleaseMarshalData(stream2);
3621  ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
3622  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3623 
3624  IStream_Release(stream);
3625  IStream_Release(stream2);
3626 
3627  /* Weak table marshaling does not increment external connections */
3629  ok(hres == S_OK, "CreateStreamOnHGlobal failed: %08x\n", hres);
3630 
3631  hres = CoMarshalInterface(stream, &IID_ItestDual, (IUnknown*)&TestDual, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLEWEAK);
3632  ok(hres == S_OK, "CoMarshalInterface failed: %08x\n", hres);
3633  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3634 
3635  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3636  hres = CoUnmarshalInterface(stream, &IID_ItestDual, (void**)&iface);
3637  ok(hres == S_OK, "CoUnmarshalInterface failed: %08x\n", hres);
3638  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3639  ItestDual_Release(iface);
3640 
3641  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3643  ok(hres == S_OK, "CoReleaseMarshalData failed: %08x\n", hres);
3644  ok(external_connections == 0, "external_connections = %d\n", external_connections);
3645 
3646  IStream_Release(stream);
3647 }
HRESULT WINAPI CoReleaseMarshalData(IStream *pStream)
Definition: marshal.c:2055
HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
Definition: marshal.c:1981
#define TRUE
Definition: types.h:120
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static ItestDual TestDual
Definition: tmarshal.c:233
smooth NULL
Definition: ftsmooth.c:416
static int external_connections
Definition: tmarshal.c:181
static BOOL expect_last_release_closes
Definition: tmarshal.c:182
static DWORD start_host_object(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, HANDLE *thread)
Definition: tmarshal.c:155
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
static void end_host_object(DWORD tid, HANDLE thread)
Definition: tmarshal.c:172
unsigned long DWORD
Definition: ntddk_ex.h:95
static HANDLE thread
Definition: service.c:33
static double zero
Definition: j0_y0.c:96
#define todo_wine
Definition: test.h:162
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
HRESULT WINAPI CoMarshalInterface(IStream *pStream, REFIID riid, IUnknown *pUnk, DWORD dwDestContext, void *pvDestContext, DWORD mshlFlags)
Definition: marshal.c:1876
static TfClientId tid

Referenced by START_TEST().

◆ test_libattr()

static void test_libattr ( void  )
static

Definition at line 3509 of file tmarshal.c.

3510 {
3511  ITypeLib *pTypeLib;
3512  HRESULT hr;
3513  TLIBATTR *pattr;
3514 
3515  hr = LoadRegTypeLib(&LIBID_TestTypelib, 2, 5, LOCALE_NEUTRAL, &pTypeLib);
3517  if (FAILED(hr))
3518  return;
3519 
3520  hr = ITypeLib_GetLibAttr(pTypeLib, &pattr);
3521  ok_ole_success(hr, GetLibAttr);
3522  if (SUCCEEDED(hr))
3523  {
3524  ok(pattr->lcid == MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), "lcid %x\n", pattr->lcid);
3525 
3526  ITypeLib_ReleaseTLibAttr(pTypeLib, pattr);
3527  }
3528 
3529  ITypeLib_Release(pTypeLib);
3530 }
HRESULT hr
Definition: shlfolder.c:183
#define LANG_NEUTRAL
Definition: nls.h:22
#define ok_ole_success(hr, func)
Definition: tmarshal.c:36
#define SUBLANG_NEUTRAL
Definition: nls.h:167
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI LoadRegTypeLib(REFGUID rguid, WORD wVerMajor, WORD wVerMinor, LCID lcid, ITypeLib **ppTLib)
Definition: typelib.c:531
#define ok(value,...)
Definition: atltest.h:57
#define MAKELANGID(p, s)
Definition: nls.h:15
#define LOCALE_NEUTRAL
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by START_TEST().

◆ test_marshal_array()

static void test_marshal_array ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2581 of file tmarshal.c.

2582 {
2583  VARIANT var_in[2], var_out[2], var_in_out[2];
2584  ISomethingFromDispatch *proxy_sfd;
2585  array_t in, out, in_out;
2586  MYSTRUCT struct_in[2];
2587  HRESULT hr;
2588  int i = 2;
2589 
2590  memcpy(in, test_array1, sizeof(array_t));
2591  memcpy(out, test_array2, sizeof(array_t));
2592  memcpy(in_out, test_array3, sizeof(array_t));
2593  hr = IWidget_array(widget, in, out, in_out);
2594  ok(hr == S_OK, "Got hr %#x.\n", hr);
2595  ok(!memcmp(&in, &test_array1, sizeof(array_t)), "Arrays didn't match.\n");
2596  ok(!memcmp(&out, &test_array5, sizeof(array_t)), "Arrays didn't match.\n");
2597  ok(!memcmp(&in_out, &test_array6, sizeof(array_t)), "Arrays didn't match.\n");
2598 
2599  V_VT(&var_in[0]) = VT_I4; V_I4(&var_in[0]) = 1;
2600  V_VT(&var_in[1]) = VT_BYREF|VT_I4; V_I4REF(&var_in[1]) = &i;
2601  V_VT(&var_out[0]) = VT_I4; V_I4(&var_out[0]) = 3;
2602  V_VT(&var_out[1]) = VT_I4; V_I4(&var_out[1]) = 4;
2603  V_VT(&var_in_out[0]) = VT_I4; V_I4(&var_in_out[0]) = 5;
2604  V_VT(&var_in_out[1]) = VT_BSTR; V_BSTR(&var_in_out[1]) = SysAllocString(test_bstr1);
2605  hr = IWidget_variant_array(widget, var_in, var_out, var_in_out);
2606  ok(hr == S_OK, "Got hr %#x.\n", hr);
2607  ok(V_VT(&var_in[0]) == VT_I4, "Got wrong type %u.\n", V_VT(&var_in[0]));
2608  ok(V_I4(&var_in[0]) == 1, "Got wrong value %d.\n", V_I4(&var_in[0]));
2609  ok(V_VT(&var_in[1]) == (VT_BYREF|VT_I4), "Got wrong type %u.\n", V_VT(&var_in[1]));
2610  ok(V_I4REF(&var_in[1]) == &i, "Got wrong value %p.\n", V_I4REF(&var_in[1]));
2611  ok(i == 2, "Got wrong value %d.\n", i);
2612  ok(V_VT(&var_out[0]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_out[0]));
2613  ok(V_I1(&var_out[0]) == 9, "Got wrong value %u.\n", V_VT(&var_out[0]));
2614  ok(V_VT(&var_out[1]) == VT_BSTR, "Got wrong type %u.\n", V_VT(&var_out[1]));
2615  ok(!lstrcmpW(V_BSTR(&var_out[1]), test_bstr2), "Got wrong value %s.\n", wine_dbgstr_w(V_BSTR(&var_out[1])));
2616  ok(V_VT(&var_in_out[0]) == VT_I1, "Got wrong type %u.\n", V_VT(&var_in_out[0]));
2617  ok(V_I1(&var_in_out[0]) == 11, "Got wrong value %u.\n", V_VT(&var_in_out[0]));
2618  ok(V_VT(&var_in_out[1]) == VT_UNKNOWN, "Got wrong type %u.\n", V_VT(&var_in_out[1]));
2619  hr = IUnknown_QueryInterface(V_UNKNOWN(&var_in_out[1]), &IID_ISomethingFromDispatch, (void **)&proxy_sfd);
2620  ok(hr == S_OK, "Got hr %#x.\n", hr);
2621  hr = ISomethingFromDispatch_anotherfn(proxy_sfd);
2622  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2623  ISomethingFromDispatch_Release(proxy_sfd);
2624  release_iface(V_UNKNOWN(&var_in_out[1]));
2625 
2626  memcpy(&struct_in[0], &test_mystruct1, sizeof(MYSTRUCT));
2627  memcpy(&struct_in[1], &test_mystruct2, sizeof(MYSTRUCT));
2628  hr = IWidget_mystruct_array(widget, struct_in);
2629  ok(hr == S_OK, "Got hr %#x.\n", hr);
2630 }
static const WCHAR test_bstr1[]
Definition: tmarshal.c:48
int array_t[4]
Definition: tmarshal.idl:109
static const array_t test_array6
Definition: tmarshal.c:76
Definition: compat.h:1947
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1959
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
static const array_t test_array2
Definition: tmarshal.c:72
#define V_I4(A)
Definition: oleauto.h:247
struct TestTypelib::tagMYSTRUCT MYSTRUCT
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 const MYSTRUCT test_mystruct2
Definition: tmarshal.c:54
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define V_I1(A)
Definition: oleauto.h:243
static const array_t test_array1
Definition: tmarshal.c:71
static const array_t test_array3
Definition: tmarshal.c:73
static const WCHAR test_bstr2[]
Definition: tmarshal.c:49
#define V_I4REF(A)
Definition: oleauto.h:248
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
#define V_VT(A)
Definition: oleauto.h:211
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_BSTR(A)
Definition: oleauto.h:226
#define release_iface(a)
Definition: tmarshal.c:43
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ok(value,...)
Definition: atltest.h:57
static const MYSTRUCT test_mystruct1
Definition: tmarshal.c:53
static const array_t test_array5
Definition: tmarshal.c:75

Referenced by test_typelibmarshal().

◆ test_marshal_basetypes()

static void test_marshal_basetypes ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 1945 of file tmarshal.c.

1946 {
1947  VARIANTARG arg[11];
1948  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
1949  HRESULT hr;
1950 
1951  signed char c;
1952  short s;
1953  int i, i2, *pi;
1954  hyper h;
1955  unsigned char uc;
1956  unsigned short us;
1957  unsigned int ui;
1958  MIDL_uhyper uh;
1959  float f;
1960  double d;
1961  STATE st;
1962 
1963  V_VT(&arg[10]) = VT_I1; V_I1(&arg[10]) = 5;
1964  V_VT(&arg[9]) = VT_I2; V_I2(&arg[9]) = -123;
1965  V_VT(&arg[8]) = VT_I4; V_I4(&arg[8]) = -100000;
1966  V_VT(&arg[7]) = VT_I8; V_I8(&arg[7]) = (LONGLONG)-100000 * 1000000;
1967  V_VT(&arg[6]) = VT_UI1; V_UI1(&arg[6]) = 0;
1968  V_VT(&arg[5]) = VT_UI2; V_UI2(&arg[5]) = 456;
1969  V_VT(&arg[4]) = VT_UI4; V_UI4(&arg[4]) = 0xdeadbeef;
1970  V_VT(&arg[3]) = VT_UI8; V_UI8(&arg[3]) = (ULONGLONG)1234567890 * 9876543210;
1971  V_VT(&arg[2]) = VT_R4; V_R4(&arg[2]) = M_PI;
1972  V_VT(&arg[1]) = VT_R8; V_R8(&arg[1]) = M_E;
1973  V_VT(&arg[0]) = VT_I4; V_I4(&arg[0]) = STATE_WIDGETIFIED;
1974  hr = IDispatch_Invoke(disp, DISPID_TM_BASETYPES_IN, &IID_NULL, LOCALE_NEUTRAL,
1975  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
1976  ok(hr == S_OK, "Got hr %#x.\n", hr);
1977 
1978  hr = IWidget_basetypes_in(widget, 5, -123, -100000, (LONGLONG)-100000 * 1000000, 0, 456,
1979  0xdeadbeef, (ULONGLONG)1234567890 * 9876543210, M_PI, M_E, STATE_WIDGETIFIED);
1980  ok(hr == S_OK, "Got hr %#x.\n", hr);
1981 
1982  c = s = i = h = uc = us = ui = uh = f = d = st = 0;
1983 
1984  V_VT(&arg[10]) = VT_BYREF|VT_I1; V_I1REF(&arg[10]) = &c;
1985  V_VT(&arg[9]) = VT_BYREF|VT_I2; V_I2REF(&arg[9]) = &s;
1986  V_VT(&arg[8]) = VT_BYREF|VT_I4; V_I4REF(&arg[8]) = &i;
1987  V_VT(&arg[7]) = VT_BYREF|VT_I8; V_I8REF(&arg[7]) = &h;
1988  V_VT(&arg[6]) = VT_BYREF|VT_UI1; V_UI1REF(&arg[6]) = &uc;
1989  V_VT(&arg[5]) = VT_BYREF|VT_UI2; V_UI2REF(&arg[5]) = &us;
1990  V_VT(&arg[4]) = VT_BYREF|VT_UI4; V_UI4REF(&arg[4]) = &ui;
1991  V_VT(&arg[3]) = VT_BYREF|VT_UI8; V_UI8REF(&arg[3]) = &uh;
1992  V_VT(&arg[2]) = VT_BYREF|VT_R4; V_R4REF(&arg[2]) = &f;
1993  V_VT(&arg[1]) = VT_BYREF|VT_R8; V_R8REF(&arg[1]) = &d;
1994  V_VT(&arg[0]) = VT_BYREF|VT_I4; V_I4REF(&arg[0]) = (int *)&st;
1995  hr = IDispatch_Invoke(disp, DISPID_TM_BASETYPES_OUT, &IID_NULL, LOCALE_NEUTRAL,
1996  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
1997  ok(hr == S_OK, "Got hr %#x.\n", hr);
1998  ok(c == 10, "Got char %d.\n", c);
1999  ok(s == -321, "Got short %d.\n", s);
2000  ok(i == -200000, "Got int %d.\n", i);
2001  ok(h == (LONGLONG)-200000 * 1000000L, "Got hyper %s.\n", wine_dbgstr_longlong(h));
2002  ok(uc == 254, "Got unsigned char %u.\n", uc);
2003  ok(us == 256, "Got unsigned short %u.\n", us);
2004  ok(ui == 0xf00dfade, "Got unsigned int %i.\n", ui);
2005  ok(uh == ((((ULONGLONG)0xabcdef01) << 32) | (ULONGLONG)0x23456789),
2006  "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh));
2007  ok(f == (float)M_LN2, "Got float %f.\n", f);
2008  ok(d == M_LN10, "Got double %f.\n", d);
2009  ok(st == STATE_UNWIDGETIFIED, "Got state %u.\n", st);
2010 
2011  c = s = i = h = uc = us = ui = uh = f = d = st = 0;
2012 
2013  hr = IWidget_basetypes_out(widget, &c, &s, &i, &h, &uc, &us, &ui, &uh, &f, &d, &st);
2014  ok(hr == S_OK, "Got hr %#x.\n", hr);
2015  ok(c == 10, "Got char %d.\n", c);
2016  ok(s == -321, "Got short %d.\n", s);
2017  ok(i == -200000, "Got int %d.\n", i);
2018  ok(h == (LONGLONG)-200000 * 1000000L, "Got hyper %s.\n", wine_dbgstr_longlong(h));
2019  ok(uc == 254, "Got unsigned char %u.\n", uc);
2020  ok(us == 256, "Got unsigned short %u.\n", us);
2021  ok(ui == 0xf00dfade, "Got unsigned int %i.\n", ui);
2022  ok(uh == ((((ULONGLONG)0xabcdef01) << 32) | (ULONGLONG)0x23456789),
2023  "Got unsigned hyper %s.\n", wine_dbgstr_longlong(uh));
2024  ok(f == (float)M_LN2, "Got float %f.\n", f);
2025  ok(d == M_LN10, "Got double %f.\n", d);
2026  ok(st == STATE_UNWIDGETIFIED, "Got state %u.\n", st);
2027 
2028  /* Test marshalling of public typedefs. */
2029 
2030  i = 456;
2031  i2 = 789;
2032  pi = &i2;
2033  hr = IWidget_myint(widget, 123, &i, &pi);
2034  ok(hr == S_OK, "Got hr %#x.\n", hr);
2035 
2036  /* Test that different float ABIs are correctly handled. */
2037 
2038  hr = IWidget_float_abi(widget, 1.0f, 2.0, 3, 4.0f, 5.0);
2039  ok(hr == S_OK, "Got hr %#x.\n", hr);
2040 }
disp
Definition: i386-dis.c:3181
#define V_I1REF(A)
Definition: oleauto.h:244
Definition: compat.h:1947
Definition: userinit.h:56
#define V_I2REF(A)
Definition: oleauto.h:246
Definition: compat.h:1963
HRESULT hr
Definition: shlfolder.c:183
Definition: compat.h:1959
#define V_UI2REF(A)
Definition: oleauto.h:269
static const BYTE us[]
Definition: encode.c:689
#define V_I8REF(A)
Definition: oleauto.h:250
#define V_R8(A)
Definition: oleauto.h:262
UINT ui
Definition: oleauto.h:49
#define V_I2(A)
Definition: oleauto.h:245
void * arg
Definition: msvc.h:10
UINT64 MIDL_uhyper
Definition: rpcndr.h:118
INT64 hyper
Definition: rpcndr.h:117
#define V_UI8(A)
Definition: oleauto.h:272
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
smooth NULL
Definition: ftsmooth.c:416
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
#define V_I8(A)
Definition: oleauto.h:249
int64_t LONGLONG
Definition: typedefs.h:66
GLfloat f
Definition: glext.h:7540
#define V_R4(A)
Definition: oleauto.h:260
#define d
Definition: ke_i.h:81
#define V_I4REF(A)
Definition: oleauto.h:248
static refpint_t pi[]
Definition: server.c:96
LONG HRESULT
Definition: typedefs.h:77
uint64_t ULONGLONG
Definition: typedefs.h:65
#define V_UI1(A)
Definition: oleauto.h:266
const GLubyte * c
Definition: glext.h:8905
#define V_UI4REF(A)
Definition: oleauto.h:271
#define V_UI4(A)
Definition: oleauto.h:270
Definition: compat.h:1948
static const WCHAR L[]
Definition: oid.c:1250
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
GLdouble s
Definition: gl.h:2039
#define V_R4REF(A)
Definition: oleauto.h:261
#define V_UI8REF(A)
Definition: oleauto.h:273
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define V_UI1REF(A)
Definition: oleauto.h:267
#define f
Definition: ke_i.h:83
#define ok(value,...)
Definition: atltest.h:57
#define V_R8REF(A)
Definition: oleauto.h:263
#define M_PI
Definition: macros.h:263
struct stdole::DISPPARAMS DISPPARAMS
#define c
Definition: ke_i.h:80
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
#define LOCALE_NEUTRAL
Definition: compat.h:1949
Definition: compat.h:1946

Referenced by test_typelibmarshal().

◆ test_marshal_bstr()

static void test_marshal_bstr ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2394 of file tmarshal.c.

2395 {
2396  VARIANTARG arg[4];
2397  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
2398  BSTR in, out, in_ptr, in_out;
2399  HRESULT hr;
2400  UINT len;
2401 
2402  testmode = 0;
2404  out = NULL;
2405  in_ptr = SysAllocString(test_bstr2);
2406  in_out = SysAllocString(test_bstr3);
2407 
2408  V_VT(&arg[3]) = VT_BSTR; V_BSTR(&arg[3]) = in;
2409  V_VT(&arg[2]) = VT_BSTR|VT_BYREF; V_BSTRREF(&arg[2]) = &out;
2410  V_VT(&arg[1]) = VT_BSTR|VT_BYREF; V_BSTRREF(&arg[1]) = &in_ptr;
2411  V_VT(&arg[0]) = VT_BSTR|VT_BYREF; V_BSTRREF(&arg[0]) = &in_out;
2412  hr = IDispatch_Invoke(disp, DISPID_TM_BSTR, &IID_NULL, LOCALE_NEUTRAL,
2413  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2414  ok(hr == S_OK, "Got hr %#x.\n", hr);
2415  ok(in[1] == test_bstr1[1], "[in] parameter should not be changed.\n");
2416  ok(in_ptr[1] == 'X', "[in] pointer should be changed.\n");
2417  ok(in_out[1] == 'X', "[in, out] parameter should be changed.\n");
2418  len = SysStringLen(out);
2419  ok(len == lstrlenW(test_bstr4), "Got wrong length %d.\n", len);
2420  ok(!memcmp(out, test_bstr4, len), "Got string %s.\n", wine_dbgstr_wn(out, len));
2421 
2422  in[1] = test_bstr1[1];
2423  in_ptr[1] = test_bstr2[1];
2424  in_out[1] = test_bstr3[1];
2425  SysFreeString(out);
2426  out = (BSTR)0xdeadbeef;
2427  hr = IWidget_bstr(widget, in, &out, &in_ptr, &in_out);
2428  ok(hr == S_OK, "Got hr %#x.\n", hr);
2429  ok(in[1] == test_bstr1[1], "[in] parameter should not be changed.\n");
2430  ok(in_ptr[1] == test_bstr2[1], "[in] pointer should not be changed.\n");
2431  ok(in_out[1] == 'X', "[in, out] parameter should be changed.\n");
2432  len = SysStringLen(out);
2433  ok(len == lstrlenW(test_bstr4), "Got wrong length %d.\n", len);
2434  ok(!memcmp(out, test_bstr4, len), "Got string %s.\n", wine_dbgstr_wn(out, len));
2435  SysFreeString(in);
2436  SysFreeString(out);
2437  SysFreeString(in_ptr);
2438  SysFreeString(in_out);
2439 
2440  testmode = 1;
2441  out = in_ptr = in_out = NULL;
2442  hr = IWidget_bstr(widget, NULL, &out, &in_ptr, &in_out);
2443  ok(hr == S_OK, "Got hr %#x.\n", hr);
2444 }
static const WCHAR test_bstr1[]
Definition: tmarshal.c:48
disp
Definition: i386-dis.c:3181
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HRESULT hr
Definition: shlfolder.c:183
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
static const WCHAR test_bstr3[]
Definition: tmarshal.c:50
void * arg
Definition: msvc.h:10
OLECHAR * BSTR
Definition: compat.h:1942
#define lstrlenW
Definition: compat.h:415
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static const WCHAR test_bstr2[]
Definition: tmarshal.c:49
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static const WCHAR test_bstr4[]
Definition: tmarshal.c:51
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
GLenum GLsizei len
Definition: glext.h:6722
const char * wine_dbgstr_wn(const WCHAR *str, int n)
Definition: compat.c:342
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:196
#define V_BSTR(A)
Definition: oleauto.h:226
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static int testmode
Definition: tmarshal.c:660
unsigned int UINT
Definition: ndis.h:50
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
#define V_BSTRREF(A)
Definition: oleauto.h:227

Referenced by test_typelibmarshal().

◆ test_marshal_coclass()

static void test_marshal_coclass ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2632 of file tmarshal.c.

2633 {
2634  VARIANTARG arg[3];
2635  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
2636  struct coclass_obj *class1, *class2, *class3;
2637  IUnknown *unk_in, *unk_out, *unk_in_out;
2638  ICoclass1 *in, *out, *in_out;
2639  HRESULT hr;
2640 
2641  class1 = create_coclass_obj();
2642  class2 = create_coclass_obj();
2643  class3 = create_coclass_obj();
2644 
2645  hr = IWidget_Coclass(widget, (Coclass1 *)&class1->ICoclass1_iface,
2646  (Coclass2 *)&class2->ICoclass1_iface, (Coclass3 *)&class3->ICoclass1_iface);
2647  ok(hr == S_OK, "Got hr %#x.\n", hr);
2648 
2649  hr = IWidget_Coclass(widget, (Coclass1 *)&class1->ICoclass2_iface,
2650  (Coclass2 *)&class2->ICoclass2_iface, (Coclass3 *)&class3->ICoclass2_iface);
2651  ok(hr == S_OK, "Got hr %#x.\n", hr);
2652 
2653  release_iface(&class1->ICoclass1_iface);
2654  release_iface(&class2->ICoclass1_iface);
2655  release_iface(&class3->ICoclass1_iface);
2656 
2657  testmode = 0;
2658  class1 = create_coclass_obj();
2659  class2 = create_coclass_obj();
2660  class3 = create_coclass_obj();
2661  in = &class1->ICoclass1_iface;
2662  out = &class2->ICoclass1_iface;
2663  in_out = &class3->ICoclass1_iface;
2664  hr = IWidget_Coclass_ptr(widget, (Coclass1 **)&in, (Coclass1 **)&out, (Coclass1 **)&in_out);
2665  ok(hr == S_OK, "Got hr %#x.\n", hr);
2666  ok(in == &class1->ICoclass1_iface, "[in] parameter should not have changed.\n");
2667  ok(!out, "[out] parameter should have been cleared.\n");
2668  ok(in_out == &class3->ICoclass1_iface, "[in, out] parameter should not have changed.\n");
2669  release_iface(&class1->ICoclass1_iface);
2670  release_iface(&class2->ICoclass1_iface);
2671  release_iface(&class3->ICoclass1_iface);
2672 
2673  testmode = 1;
2674  class1 = create_coclass_obj();
2675  class3 = create_coclass_obj();
2676  in = &class1->ICoclass1_iface;
2677  in_out = &class3->ICoclass1_iface;
2678  ICoclass1_AddRef(in_out);
2679  hr = IWidget_Coclass_ptr(widget, (Coclass1 **)&in,
2680  (Coclass1 **)&out, (Coclass1 **)&in_out);
2681  ok(hr == S_OK, "Got hr %#x.\n", hr);
2682  hr = ICoclass1_test(out);
2683  ok(hr == 1, "Got hr %#x.\n", hr);
2684  ok(in_out != &class3->ICoclass1_iface, "[in, out] parameter should have changed.\n");
2685  hr = ICoclass1_test(in_out);
2686  ok(hr == 1, "Got hr %#x.\n", hr);
2687  release_iface(out);
2688  release_iface(in_out);
2689  release_iface(&class1->ICoclass1_iface);
2690  release_iface(&class3->ICoclass1_iface);
2691 
2692  testmode = 2;
2693  in = out = in_out = NULL;
2694  hr = IWidget_Coclass_ptr(widget, (Coclass1 **)&in,
2695  (Coclass1 **)&out, (Coclass1 **)&in_out);
2696  ok(hr == S_OK, "Got hr %#x.\n", hr);
2697  hr = ICoclass1_test(in_out);
2698  ok(hr == 1, "Got hr %#x.\n", hr);
2699  release_iface(in_out);
2700 
2701  testmode = 3;
2702  in = out = NULL;
2703  class3 = create_coclass_obj();
2704  in_out = &class3->ICoclass1_iface;
2705  hr = IWidget_Coclass_ptr(widget, (Coclass1 **)&in,
2706  (Coclass1 **)&out, (Coclass1 **)&in_out);
2707  ok(hr == S_OK, "Got hr %#x.\n", hr);
2708  ok(!in_out, "Got [in, out] %p.\n", in_out);
2709 
2710  /* Test with Invoke(). Note that since we pass VT_UNKNOWN, we don't get our
2711  * interface back, but rather an IUnknown. */
2712 
2713  class1 = create_coclass_obj();
2714  class2 = create_coclass_obj();
2715  class3 = create_coclass_obj();
2716 
2717  V_VT(&arg[2]) = VT_UNKNOWN; V_UNKNOWN(&arg[2]) = (IUnknown *)&class1->ICoclass1_iface;
2718  V_VT(&arg[1]) = VT_UNKNOWN; V_UNKNOWN(&arg[1]) = (IUnknown *)&class2->ICoclass1_iface;
2719  V_VT(&arg[0]) = VT_UNKNOWN; V_UNKNOWN(&arg[0]) = (IUnknown *)&class3->ICoclass1_iface;
2720  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS, &IID_NULL, LOCALE_NEUTRAL,
2721  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2722  ok(hr == S_OK, "Got hr %#x.\n", hr);
2723 
2724  V_VT(&arg[2]) = VT_UNKNOWN; V_UNKNOWN(&arg[2]) = (IUnknown *)&class1->ICoclass2_iface;
2725  V_VT(&arg[1]) = VT_UNKNOWN; V_UNKNOWN(&arg[1]) = (IUnknown *)&class2->ICoclass2_iface;
2726  V_VT(&arg[0]) = VT_UNKNOWN; V_UNKNOWN(&arg[0]) = (IUnknown *)&class3->ICoclass2_iface;
2727  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS, &IID_NULL, LOCALE_NEUTRAL,
2728  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2729  ok(hr == S_OK, "Got hr %#x.\n", hr);
2730 
2731  V_VT(&arg[2]) = VT_DISPATCH; V_DISPATCH(&arg[2]) = (IDispatch *)&class1->ICoclass1_iface;
2732  V_VT(&arg[1]) = VT_DISPATCH; V_DISPATCH(&arg[1]) = (IDispatch *)&class2->ICoclass1_iface;
2733  V_VT(&arg[0]) = VT_DISPATCH; V_DISPATCH(&arg[0]) = (IDispatch *)&class3->ICoclass1_iface;
2734  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS, &IID_NULL, LOCALE_NEUTRAL,
2735  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2736  ok(hr == S_OK, "Got hr %#x.\n", hr);
2737 
2738  release_iface(&class1->ICoclass1_iface);
2739  release_iface(&class2->ICoclass1_iface);
2740  release_iface(&class3->ICoclass1_iface);
2741 
2742  testmode = 0;
2743  class1 = create_coclass_obj();
2744  class3 = create_coclass_obj();
2745  unk_in = (IUnknown *)&class1->ICoclass1_iface;
2746  unk_out = NULL;
2747  unk_in_out = (IUnknown *)&class3->ICoclass1_iface;
2748  V_VT(&arg[2]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[2]) = &unk_in;
2750  V_VT(&arg[0]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[0]) = &unk_in_out;
2751  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS_PTR, &IID_NULL, LOCALE_NEUTRAL,
2752  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2753 todo_wine
2754  ok(hr == S_OK, "Got hr %#x.\n", hr);
2755  ok(unk_in == (IUnknown *)&class1->ICoclass1_iface, "[in] parameter should not have changed.\n");
2756  ok(!unk_out, "[out] parameter should have been cleared.\n");
2757  ok(unk_in_out == (IUnknown *)&class3->ICoclass1_iface, "[in, out] parameter should not have changed.\n");
2758  release_iface(&class1->ICoclass1_iface);
2759  release_iface(&class3->ICoclass1_iface);
2760 
2761  testmode = 1;
2762  class1 = create_coclass_obj();
2763  class3 = create_coclass_obj();
2764  unk_in = (IUnknown *)&class1->ICoclass1_iface;
2765  unk_out = NULL;
2766  unk_in_out = (IUnknown *)&class3->ICoclass1_iface;
2767  IUnknown_AddRef(unk_in_out);
2768  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS_PTR, &IID_NULL, LOCALE_NEUTRAL,
2769  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2770 todo_wine
2771  ok(hr == S_OK, "Got hr %#x.\n", hr);
2772 
2773 if (hr == S_OK) {
2774  hr = IUnknown_QueryInterface(unk_out, &IID_ICoclass1, (void **)&out);
2775  ok(hr == S_OK, "Got hr %#x.\n", hr);
2776  hr = ICoclass1_test(out);
2777  ok(hr == 1, "Got hr %#x.\n", hr);
2778  ICoclass1_Release(out);
2779 
2780  ok(unk_in_out != (IUnknown *)&class3->ICoclass1_iface, "[in, out] parameter should have changed.\n");
2781  hr = IUnknown_QueryInterface(unk_in_out, &IID_ICoclass1, (void **)&in_out);
2782  ok(hr == S_OK, "Got hr %#x.\n", hr);
2783  hr = ICoclass1_test(in_out);
2784  ok(hr == 1, "Got hr %#x.\n", hr);
2785  ICoclass1_Release(in_out);
2786 
2788  release_iface(unk_in_out);
2789 }
2790  release_iface(&class1->ICoclass1_iface);
2791 todo_wine
2792  release_iface(&class3->ICoclass1_iface);
2793 
2794  testmode = 2;
2795  unk_in = unk_out = unk_in_out = NULL;
2796  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS_PTR, &IID_NULL, LOCALE_NEUTRAL,
2797  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2798 todo_wine
2799  ok(hr == S_OK, "Got hr %#x.\n", hr);
2800 
2801  ok(!unk_out, "[out] parameter should not have been set.\n");
2802 if (hr == S_OK) {
2803  hr = IUnknown_QueryInterface(unk_in_out, &IID_ICoclass1, (void **)&in_out);
2804  ok(hr == S_OK, "Got hr %#x.\n", hr);
2805  hr = ICoclass1_test(in_out);
2806  ok(hr == 1, "Got hr %#x.\n", hr);
2807  ICoclass1_Release(in_out);
2808 
2809  release_iface(unk_in_out);
2810 }
2811 
2812  testmode = 3;
2813  unk_in = unk_out = NULL;
2814  class3 = create_coclass_obj();
2815  unk_in_out = (IUnknown *)&class3->ICoclass1_iface;
2816  IUnknown_AddRef(unk_in_out);
2817  hr = IDispatch_Invoke(disp, DISPID_TM_COCLASS_PTR, &IID_NULL, LOCALE_NEUTRAL,
2818  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2819 todo_wine
2820  ok(hr == S_OK, "Got hr %#x.\n", hr);
2821 todo_wine
2822  ok(!unk_in_out, "[in, out] parameter should have been cleared.\n");
2823 
2824 todo_wine
2825  release_iface(&class3->ICoclass1_iface);
2826 }
disp
Definition: i386-dis.c:3181
ICoclass1 ICoclass1_iface
Definition: tmarshal.c:494
HRESULT hr
Definition: shlfolder.c:183
void * arg
Definition: msvc.h:10
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define V_UNKNOWNREF(A)
Definition: oleauto.h:282
smooth NULL
Definition: ftsmooth.c:416
static RefUnk unk_in
Definition: misc.c:2110
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
static struct coclass_obj * create_coclass_obj(void)
Definition: tmarshal.c:653
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:162
#define V_VT(A)
Definition: oleauto.h:211
#define V_UNKNOWN(A)
Definition: oleauto.h:281
static RefUnk unk_out
Definition: misc.c:2110
#define release_iface(a)
Definition: tmarshal.c:43
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static int testmode
Definition: tmarshal.c:660
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
ICoclass2 ICoclass2_iface
Definition: tmarshal.c:495

Referenced by test_typelibmarshal().

◆ test_marshal_dispinterface()

static void test_marshal_dispinterface ( void  )
static

Definition at line 3649 of file tmarshal.c.

3650 {
3651  static const LARGE_INTEGER zero;
3652 
3653  ISomethingFromDispatch *disp_obj = create_disp_obj();
3654  ITypeInfo *typeinfo = NULL;
3655  IDispatch *proxy_disp;
3656  IStream *stream;
3657  HANDLE thread;
3658  HRESULT hr;
3659  ULONG ref;
3660  DWORD tid;
3661 
3663  tid = start_host_object(stream, &DIID_ItestIF4, (IUnknown *)disp_obj, MSHLFLAGS_NORMAL, &thread);
3664  IStream_Seek(stream, zero, STREAM_SEEK_SET, NULL);
3665  hr = CoUnmarshalInterface(stream, &DIID_ItestIF4, (void **)&proxy_disp);
3666  ok(hr == S_OK, "Got hr %#x.\n", hr);
3667 
3668  hr = IDispatch_GetTypeInfo(proxy_disp, 0xdeadbeef, 0, &typeinfo);
3669  ok(hr == 0xbeefdead, "Got hr %#x.\n", hr);
3670 
3671  ref = IDispatch_Release(proxy_disp);
3672  ok(!ref, "Got outstanding refcount %d.\n", ref);
3673  ref = IStream_Release(stream);
3674  ok(!ref, "Got outstanding refcount %d.\n", ref);
3676  ref = ISomethingFromDispatch_Release(disp_obj);
3677  ok(!ref, "Got outstanding refcount %d.\n", ref);
3678 }
HRESULT WINAPI CoUnmarshalInterface(IStream *pStream, REFIID riid, LPVOID *ppv)
Definition: marshal.c:1981
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
smooth NULL
Definition: ftsmooth.c:416
static DWORD start_host_object(IStream *stream, REFIID riid, IUnknown *object, MSHLFLAGS marshal_flags, HANDLE *thread)
Definition: tmarshal.c:155
LONG HRESULT
Definition: typedefs.h:77
static void end_host_object(DWORD tid, HANDLE thread)
Definition: tmarshal.c:172
unsigned long DWORD
Definition: ntddk_ex.h:95
static HANDLE thread
Definition: service.c:33
static double zero
Definition: j0_y0.c:96
Definition: parse.h:22
GLuint GLuint stream
Definition: glext.h:7522
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1
static TfClientId tid
static ISomethingFromDispatch * create_disp_obj(void)
Definition: tmarshal.c:484

Referenced by START_TEST().

◆ test_marshal_iface()

static void test_marshal_iface ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2156 of file tmarshal.c.

2157 {
2158  VARIANTARG arg[3];
2159  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
2160  ISomethingFromDispatch *sfd1, *sfd2, *sfd3, *proxy_sfd, *sfd_in, *sfd_out, *sfd_in_out;
2161  IUnknown *proxy_unk, *proxy_unk2, *unk_in, *unk_out, *unk_in_out;
2162  IDispatch *proxy_disp;
2163  HRESULT hr;
2164 
2165  testmode = 0;
2166  sfd1 = create_disp_obj();
2167  sfd2 = create_disp_obj();
2168  sfd3 = create_disp_obj();
2169  hr = IWidget_iface_in(widget, (IUnknown *)sfd1,
2170  (IDispatch *)sfd2, sfd3);
2171  ok(hr == S_OK, "Got hr %#x.\n", hr);
2172  release_iface(sfd1);
2173  release_iface(sfd2);
2174  release_iface(sfd3);
2175 
2176  testmode = 1;
2177  hr = IWidget_iface_in(widget, NULL, NULL, NULL);
2178  ok(hr == S_OK, "Got hr %#x.\n", hr);
2179 
2180  testmode = 0;
2181  proxy_unk = (IUnknown *)0xdeadbeef;
2182  proxy_disp = (IDispatch *)0xdeadbeef;
2183  proxy_sfd = (ISomethingFromDispatch *)0xdeadbeef;
2184  hr = IWidget_iface_out(widget, &proxy_unk, &proxy_disp, &proxy_sfd);
2185  ok(hr == S_OK, "Got hr %#x.\n", hr);
2186  check_iface_marshal(proxy_unk, proxy_disp, proxy_sfd);
2187  release_iface(proxy_unk);
2188  release_iface(proxy_disp);
2189  release_iface(proxy_sfd);
2190 
2191  testmode = 1;
2192  hr = IWidget_iface_out(widget, &proxy_unk, &proxy_disp, &proxy_sfd);
2193  ok(hr == S_OK, "Got hr %#x.\n", hr);
2194  ok(!proxy_unk, "Got unexpected proxy %p.\n", proxy_unk);
2195  ok(!proxy_disp, "Got unexpected proxy %p.\n", proxy_disp);
2196  ok(!proxy_sfd, "Got unexpected proxy %p.\n", proxy_sfd);
2197 
2198  testmode = 0;
2199  sfd_in = sfd1 = create_disp_obj();
2200  sfd_out = sfd2 = create_disp_obj();
2201  sfd_in_out = sfd3 = create_disp_obj();
2202  hr = IWidget_iface_ptr(widget, &sfd_in, &sfd_out, &sfd_in_out);
2203  ok(hr == S_OK, "Got hr %#x.\n", hr);
2204  ok(sfd_in == sfd1, "[in] parameter should not have changed.\n");
2205  ok(!sfd_out, "[out] parameter should have been cleared.\n");
2206  ok(sfd_in_out == sfd3, "[in, out] parameter should not have changed.\n");
2207  release_iface(sfd1);
2208  release_iface(sfd2);
2209  release_iface(sfd3);
2210 
2211  testmode = 1;
2212  sfd_in = sfd1 = create_disp_obj();
2213  sfd_in_out = sfd3 = create_disp_obj();
2214  ISomethingFromDispatch_AddRef(sfd_in_out);
2215  hr = IWidget_iface_ptr(widget, &sfd_in, &sfd_out, &sfd_in_out);
2216  ok(hr == S_OK, "Got hr %#x.\n", hr);
2217  hr = ISomethingFromDispatch_anotherfn(sfd_out);
2218  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2219  ok(sfd_in_out != sfd3, "[in, out] parameter should have changed.\n");
2220  hr = ISomethingFromDispatch_anotherfn(sfd_in_out);
2221  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2222  release_iface(sfd_out);
2223  release_iface(sfd_in_out);
2224  release_iface(sfd1);
2225  release_iface(sfd3);
2226 
2227  testmode = 2;
2228  sfd_in = sfd_out = sfd_in_out = NULL;
2229  hr = IWidget_iface_ptr(widget, &sfd_in, &sfd_out, &sfd_in_out);
2230  ok(hr == S_OK, "Got hr %#x.\n", hr);
2231  ok(!sfd_out, "[out] parameter should not have been set.\n");
2232  hr = ISomethingFromDispatch_anotherfn(sfd_in_out);
2233  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2234  release_iface(sfd_in_out);
2235 
2236  testmode = 3;
2237  sfd_in = sfd_out = NULL;
2238  sfd_in_out = sfd3 = create_disp_obj();
2239  ISomethingFromDispatch_AddRef(sfd_in_out);
2240  hr = IWidget_iface_ptr(widget, &sfd_in, &sfd_out, &sfd_in_out);
2241  ok(hr == S_OK, "Got hr %#x.\n", hr);
2242  ok(!sfd_in_out, "Got [in, out] %p.\n", sfd_in_out);
2243  release_iface(sfd3);
2244 
2245  /* Test with Invoke(). Note that since we pass VT_UNKNOWN, we don't get our
2246  * interface back, but rather an IUnknown. */
2247 
2248  testmode = 0;
2249  sfd1 = create_disp_obj();
2250  sfd2 = create_disp_obj();
2251  sfd3 = create_disp_obj();
2252 
2253  V_VT(&arg[2]) = VT_UNKNOWN; V_UNKNOWN(&arg[2]) = (IUnknown *)sfd1;
2254  V_VT(&arg[1]) = VT_UNKNOWN; V_UNKNOWN(&arg[1]) = (IUnknown *)sfd2;
2255  V_VT(&arg[0]) = VT_UNKNOWN; V_UNKNOWN(&arg[0]) = (IUnknown *)sfd3;
2256  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_IN, &IID_NULL, LOCALE_NEUTRAL,
2257  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2258  ok(hr == S_OK, "Got hr %#x.\n", hr);
2259 
2260  V_VT(&arg[2]) = VT_DISPATCH; V_DISPATCH(&arg[2]) = (IDispatch *)sfd1;
2261  V_VT(&arg[1]) = VT_DISPATCH; V_DISPATCH(&arg[1]) = (IDispatch *)sfd2;
2262  V_VT(&arg[0]) = VT_DISPATCH; V_DISPATCH(&arg[0]) = (IDispatch *)sfd3;
2263  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_IN, &IID_NULL, LOCALE_NEUTRAL,
2264  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2265  ok(hr == S_OK, "Got hr %#x.\n", hr);
2266 
2267  release_iface(sfd1);
2268  release_iface(sfd2);
2269  release_iface(sfd3);
2270 
2271  testmode = 1;
2272  V_VT(&arg[2]) = VT_UNKNOWN; V_UNKNOWN(&arg[2]) = NULL;
2273  V_VT(&arg[1]) = VT_UNKNOWN; V_UNKNOWN(&arg[1]) = NULL;
2274  V_VT(&arg[0]) = VT_UNKNOWN; V_UNKNOWN(&arg[0]) = NULL;
2275  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_IN, &IID_NULL, LOCALE_NEUTRAL,
2276  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2277  ok(hr == S_OK, "Got hr %#x.\n", hr);
2278 
2279  testmode = 0;
2280  proxy_unk = proxy_unk2 = NULL;
2281  proxy_disp = NULL;
2282  V_VT(&arg[2]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[2]) = &proxy_unk;
2283  V_VT(&arg[1]) = VT_DISPATCH|VT_BYREF; V_DISPATCHREF(&arg[1]) = &proxy_disp;
2284  V_VT(&arg[0]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[0]) = &proxy_unk2;
2285  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_OUT, &IID_NULL, LOCALE_NEUTRAL,
2286  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2287 todo_wine
2288  ok(hr == S_OK, "Got hr %#x.\n", hr);
2289 if (hr == S_OK) {
2290  hr = IUnknown_QueryInterface(proxy_unk2, &IID_ISomethingFromDispatch, (void **)&proxy_sfd);
2291  ok(hr == S_OK, "Got hr %#x.\n", hr);
2292  check_iface_marshal(proxy_unk, proxy_disp, proxy_sfd);
2293  ISomethingFromDispatch_Release(proxy_sfd);
2294  release_iface(proxy_unk);
2295  release_iface(proxy_disp);
2296  release_iface(proxy_unk2);
2297 }
2298 
2299  testmode = 1;
2300  proxy_unk = proxy_unk2 = NULL;
2301  proxy_disp = NULL;
2302  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_OUT, &IID_NULL, LOCALE_NEUTRAL,
2303  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2304 todo_wine
2305  ok(hr == S_OK, "Got hr %#x.\n", hr);
2306  ok(!proxy_unk, "Got unexpected proxy %p.\n", proxy_unk);
2307  ok(!proxy_disp, "Got unexpected proxy %p.\n", proxy_disp);
2308  ok(!proxy_unk2, "Got unexpected proxy %p.\n", proxy_unk2);
2309 
2310  testmode = 0;
2311  sfd1 = create_disp_obj();
2312  sfd3 = create_disp_obj();
2313  unk_in = (IUnknown *)sfd1;
2314  unk_out = NULL;
2315  unk_in_out = (IUnknown *)sfd3;
2316  V_VT(&arg[2]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[2]) = &unk_in;
2318  V_VT(&arg[0]) = VT_UNKNOWN|VT_BYREF; V_UNKNOWNREF(&arg[0]) = &unk_in_out;
2319  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_PTR, &IID_NULL, LOCALE_NEUTRAL,
2320  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2321 todo_wine
2322  ok(hr == S_OK, "Got hr %#x.\n", hr);
2323  ok(unk_in == (IUnknown *)sfd1, "[in] parameter should not have changed.\n");
2324  ok(!unk_out, "[out] parameter should have been cleared.\n");
2325  ok(unk_in_out == (IUnknown *)sfd3, "[in, out] parameter should not have changed.\n");
2326  release_iface(sfd1);
2327  release_iface(sfd3);
2328 
2329  testmode = 1;
2330  sfd1 = create_disp_obj();
2331  sfd3 = create_disp_obj();
2332  unk_in = (IUnknown *)sfd1;
2333  unk_out = NULL;
2334  unk_in_out = (IUnknown *)sfd3;
2335  IUnknown_AddRef(unk_in_out);
2336  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_PTR, &IID_NULL, LOCALE_NEUTRAL,
2337  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2338 todo_wine
2339  ok(hr == S_OK, "Got hr %#x.\n", hr);
2340 
2341 if (hr == S_OK) {
2342  hr = IUnknown_QueryInterface(unk_out, &IID_ISomethingFromDispatch, (void **)&sfd_out);
2343  ok(hr == S_OK, "Got hr %#x.\n", hr);
2344  hr = ISomethingFromDispatch_anotherfn(sfd_out);
2345  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2346  ISomethingFromDispatch_Release(sfd_out);
2347 
2348  ok(unk_in_out != (IUnknown *)sfd3, "[in, out] parameter should have changed.\n");
2349  hr = IUnknown_QueryInterface(unk_in_out, &IID_ISomethingFromDispatch, (void **)&sfd_in_out);
2350  ok(hr == S_OK, "Got hr %#x.\n", hr);
2351  hr = ISomethingFromDispatch_anotherfn(sfd_in_out);
2352  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2353  ISomethingFromDispatch_Release(sfd_in_out);
2354 
2356  release_iface(unk_in_out);
2357 }
2358  release_iface(sfd1);
2359 todo_wine
2360  release_iface(sfd3);
2361 
2362  testmode = 2;
2363  unk_in = unk_out = unk_in_out = NULL;
2364  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_PTR, &IID_NULL, LOCALE_NEUTRAL,
2365  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2366 todo_wine
2367  ok(hr == S_OK, "Got hr %#x.\n", hr);
2368 
2369  ok(!unk_out, "[out] parameter should not have been set.\n");
2370 if (hr == S_OK) {
2371  hr = IUnknown_QueryInterface(unk_in_out, &IID_ISomethingFromDispatch, (void **)&sfd_in_out);
2372  ok(hr == S_OK, "Got hr %#x.\n", hr);
2373  hr = ISomethingFromDispatch_anotherfn(sfd_in_out);
2374  ok(hr == 0x01234567, "Got hr %#x.\n", hr);
2375  ISomethingFromDispatch_Release(sfd_in_out);
2376 
2377  release_iface(unk_in_out);
2378 }
2379 
2380  testmode = 3;
2381  unk_in = unk_out = NULL;
2382  sfd3 = create_disp_obj();
2383  unk_in_out = (IUnknown *)sfd3;
2384  IUnknown_AddRef(unk_in_out);
2385  hr = IDispatch_Invoke(disp, DISPID_TM_IFACE_PTR, &IID_NULL, LOCALE_NEUTRAL,
2386  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2387 todo_wine {
2388  ok(hr == S_OK, "Got hr %#x.\n", hr);
2389  ok(!unk_in_out, "[in, out] parameter should have been cleared.\n");
2390  release_iface(sfd3);
2391 }
2392 }
disp
Definition: i386-dis.c:3181
static void check_iface_marshal(IUnknown *unk, IDispatch *disp, ISomethingFromDispatch *sfd)
Definition: tmarshal.c:1212
HRESULT hr
Definition: shlfolder.c:183
void * arg
Definition: msvc.h:10
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define V_UNKNOWNREF(A)
Definition: oleauto.h:282
smooth NULL
Definition: ftsmooth.c:416
static RefUnk unk_in
Definition: misc.c:2110
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:162
#define V_VT(A)
Definition: oleauto.h:211
#define V_UNKNOWN(A)
Definition: oleauto.h:281
static RefUnk unk_out
Definition: misc.c:2110
#define release_iface(a)
Definition: tmarshal.c:43
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static int testmode
Definition: tmarshal.c:660
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
#define V_DISPATCHREF(A)
Definition: oleauto.h:240
static ISomethingFromDispatch * create_disp_obj(void)
Definition: tmarshal.c:484

Referenced by test_typelibmarshal().

◆ test_marshal_pointer()

static void test_marshal_pointer ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2042 of file tmarshal.c.

2043 {
2044  VARIANTARG arg[3];
2045  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
2046  int in, out, in_out, *in_ptr, *out_ptr, *in_out_ptr;
2047  HRESULT hr;
2048 
2049  testmode = 0;
2050 
2051  in = 123;
2052  out = 456;
2053  in_out = 789;
2054  V_VT(&arg[2]) = VT_BYREF|VT_I4; V_I4REF(&arg[2]) = &in;
2055  V_VT(&arg[1]) = VT_BYREF|VT_I4; V_I4REF(&arg[1]) = &out;
2056  V_VT(&arg[0]) = VT_BYREF|VT_I4; V_I4REF(&arg[0]) = &in_out;
2057  hr = IDispatch_Invoke(disp, DISPID_TM_INT_PTR, &IID_NULL, LOCALE_NEUTRAL,
2058  DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
2059  ok(hr == S_OK, "Got hr %#x.\n", hr);
2060  ok(in == 987, "Got [in] %d.\n", in);
2061  ok(out == 654, "Got [out] %d.\n", out);
2062  ok(in_out == 321, "Got [in, out] %d.\n", in_out);
2063 
2064  testmode = 1;
2065 
2066  in = 123;
2067  out = 456;
2068  in_out = 789;
2069  hr = IWidget_int_ptr(widget, &in, &out, &in_out);
2070  ok(hr == S_OK, "Got hr %#x.\n", hr);
2071  ok(in == 123, "Got [in] %d.\n", in);
2072  ok(out == 654, "Got [out] %d.\n", out);
2073  ok(in_out == 321, "Got [in, out] %d.\n", in_out);
2074 
2075  out = in_out = -1;
2076  hr = IWidget_int_ptr(widget, NULL, &out, &in_out);
2077  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2078  ok(!out, "[out] parameter should have been cleared.\n");
2079  ok(in_out == -1, "[in, out] parameter should not have been cleared.\n");
2080 
2081  in = in_out = -1;
2082  hr = IWidget_int_ptr(widget, &in, NULL, &in_out);
2083  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2084  ok(in == -1, "[in] parameter should not have been cleared.\n");
2085  ok(in_out == -1, "[in, out] parameter should not have been cleared.\n");
2086 
2087  in = out = -1;
2088  hr = IWidget_int_ptr(widget, &in, &out, NULL);
2089  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2090  ok(in == -1, "[in] parameter should not have been cleared.\n");
2091  ok(!out, "[out] parameter should have been cleared.\n");
2092 
2093  /* We can't test Invoke() with double pointers, as it is not possible to fit
2094  * more than one level of indirection into a VARIANTARG. */
2095 
2096  testmode = 0;
2097  in_ptr = out_ptr = in_out_ptr = NULL;
2098  hr = IWidget_int_ptr_ptr(widget, &in_ptr, &out_ptr, &in_out_ptr);
2099  ok(hr == S_OK, "Got hr %#x\n", hr);
2100  ok(!in_ptr, "Got [in] %p.\n", in_ptr);
2101  ok(!out_ptr, "Got [out] %p.\n", out_ptr);
2102  ok(!in_out_ptr, "Got [in, out] %p.\n", in_out_ptr);
2103 
2104  testmode = 1;
2105  hr = IWidget_int_ptr_ptr(widget, &in_ptr, &out_ptr, &in_out_ptr);
2106  ok(hr == S_OK, "Got hr %#x\n", hr);
2107  ok(*out_ptr == 654, "Got [out] %d.\n", *out_ptr);
2108  ok(*in_out_ptr == 321, "Got [in, out] %d.\n", *in_out_ptr);
2109  CoTaskMemFree(out_ptr);
2110  CoTaskMemFree(in_out_ptr);
2111 
2112  testmode = 2;
2113  in = 123;
2114  out = 456;
2115  in_out = 789;
2116  in_ptr = &in;
2117  out_ptr = &out;
2118  in_out_ptr = &in_out;
2119  hr = IWidget_int_ptr_ptr(widget, &in_ptr, &out_ptr, &in_out_ptr);
2120  ok(hr == S_OK, "Got hr %#x.\n", hr);
2121  ok(out_ptr != &out, "[out] ptr should have changed.\n");
2122  ok(in_out_ptr == &in_out, "[in, out] ptr should not have changed.\n");
2123  ok(*out_ptr == 654, "Got [out] %d.\n", *out_ptr);
2124  ok(*in_out_ptr == 321, "Got [in, out] %d.\n", *in_out_ptr);
2125 
2126  testmode = 3;
2127  in_ptr = out_ptr = NULL;
2128  in_out = 789;
2129  in_out_ptr = &in_out;
2130  hr = IWidget_int_ptr_ptr(widget, &in_ptr, &out_ptr, &in_out_ptr);
2131  ok(hr == S_OK, "Got hr %#x.\n", hr);
2132  ok(!in_out_ptr, "Got [in, out] %p.\n", in_out_ptr);
2133 
2134  out_ptr = &out;
2135  in_out_ptr = &in_out;
2136  hr = IWidget_int_ptr_ptr(widget, NULL, &out_ptr, &in_out_ptr);
2137  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2138  ok(!out_ptr, "[out] parameter should have been cleared.\n");
2139  ok(in_out_ptr == &in_out, "[in, out] parameter should not have been cleared.\n");
2140 
2141  in_ptr = &in;
2142  in_out_ptr = &in_out;
2143  hr = IWidget_int_ptr_ptr(widget, &in_ptr, NULL, &in_out_ptr);
2144  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2145  ok(in_ptr == &in, "[in] parameter should not have been cleared.\n");
2146  ok(in_out_ptr == &in_out, "[in, out] parameter should not have been cleared.\n");
2147 
2148  in_ptr = &in;
2149  out_ptr = &out;
2150  hr = IWidget_int_ptr_ptr(widget, &in_ptr, &out_ptr, NULL);
2151  ok(hr == HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER), "Got hr %#x.\n", hr);
2152  ok(in_ptr == &in, "[in] parameter should not have been cleared.\n");
2153  ok(!out_ptr, "[out] parameter should have been cleared.\n");
2154 }
disp
Definition: i386-dis.c:3181
Definition: compat.h:1947
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
HRESULT hr
Definition: shlfolder.c:183
void * arg
Definition: msvc.h:10
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
#define V_I4REF(A)
Definition: oleauto.h:248
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
static int testmode
Definition: tmarshal.c:660
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL

Referenced by test_typelibmarshal().

◆ test_marshal_safearray()

static void test_marshal_safearray ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2498 of file tmarshal.c.

2499 {
2500  SAFEARRAY *in, *out, *out2, *in_ptr, *in_out;
2501  HRESULT hr;
2502 
2503  in = make_safearray(3);
2504  out = out2 = make_safearray(5);
2505  in_ptr = make_safearray(7);
2506  in_out = make_safearray(9);
2507  hr = IWidget_safearray(widget, in, &out, &in_ptr, &in_out);
2508  ok(hr == S_OK, "Got hr %#x.\n", hr);
2509  check_safearray(in, 3);
2510  check_safearray(out, 4);
2511  check_safearray(out2, 5);
2512  check_safearray(in_ptr, 7);
2513  check_safearray(in_out, 6);
2514 
2517  SafeArrayDestroy(out2);
2518  SafeArrayDestroy(in_ptr);
2519  SafeArrayDestroy(in_out);
2520 }
static SAFEARRAY * make_safearray(ULONG len)
Definition: tmarshal.c:1354
HRESULT hr
Definition: shlfolder.c:183
static void check_safearray(SAFEARRAY *sa, LONG expect)
Definition: tmarshal.c:1367
LONG HRESULT
Definition: typedefs.h:77
static FILE * out
Definition: regtests2xml.c:44
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
#define S_OK
Definition: intsafe.h:59
GLuint in
Definition: glext.h:9616
#define ok(value,...)
Definition: atltest.h:57

Referenced by test_typelibmarshal().

◆ test_marshal_struct()

static void test_marshal_struct ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2522 of file tmarshal.c.

2523 {
2524  MYSTRUCT out, in_ptr, in_out, *in_ptr_ptr;
2525  RECT rect_out, rect_in_ptr, rect_in_out;
2526  ISomethingFromDispatch *sfd;
2527  struct complex complex;
2528  int i, i2, *pi = &i2;
2529  HRESULT hr;
2530 
2531  memcpy(&out, &test_mystruct2, sizeof(MYSTRUCT));
2532  memcpy(&in_ptr, &test_mystruct3, sizeof(MYSTRUCT));
2533  memcpy(&in_out, &test_mystruct4, sizeof(MYSTRUCT));
2534  hr = IWidget_mystruct(widget, test_mystruct1, &out, &in_ptr, &in_out);
2535  ok(hr == S_OK, "Got hr %#x.\n", hr);
2536  ok(!memcmp(&out, &test_mystruct5, sizeof(MYSTRUCT)), "Structs didn't match.\n");
2537  ok(!memcmp(&in_ptr, &test_mystruct3, sizeof(MYSTRUCT)), "Structs didn't match.\n");
2538  ok(!memcmp(&in_out, &test_mystruct7, sizeof(MYSTRUCT)), "Structs didn't match.\n");
2539 
2540  memcpy(&in_ptr, &test_mystruct1, sizeof(MYSTRUCT));
2541  in_ptr_ptr = &in_ptr;
2542  hr = IWidget_mystruct_ptr_ptr(widget, &in_ptr_ptr);
2543  ok(hr == S_OK, "Got hr %#x.\n", hr);
2544 
2545  /* Make sure that "thin" structs (<=8 bytes) are handled correctly in x86-64. */
2546 
2547  hr = IWidget_thin_struct(widget, test_thin_struct);
2548  ok(hr == S_OK, "Got hr %#x.\n", hr);
2549 
2550  /* Make sure we can handle an imported type. */
2551 
2552  rect_out = test_rect2;
2553  rect_in_ptr = test_rect3;
2554  rect_in_out = test_rect4;
2555  hr = IWidget_rect(widget, test_rect1, &rect_out, &rect_in_ptr, &rect_in_out);
2556  ok(hr == S_OK, "Got hr %#x.\n", hr);
2557  ok(EqualRect(&rect_out, &test_rect5), "Rects didn't match.\n");
2558  ok(EqualRect(&rect_in_ptr, &test_rect3), "Rects didn't match.\n");
2559  ok(EqualRect(&rect_in_out, &test_rect7), "Rects didn't match.\n");
2560 
2561  /* Test complex structs. */
2562  complex.c = 98;
2563  complex.i = 76543;
2564  i = 2;
2565  complex.pi = &i;
2566  i2 = 10;
2567  complex.ppi = &pi;
2568  complex.iface = create_disp_obj();
2569  sfd = create_disp_obj();
2570  complex.iface_ptr = &sfd;
2572  V_VT(&complex.var) = VT_I4;
2573  V_I4(&complex.var) = 123;
2574  memcpy(&complex.mystruct, &test_mystruct1, sizeof(MYSTRUCT));
2575  memcpy(complex.arr, test_array1, sizeof(array_t));
2576  complex.myint = 456;
2577  hr = IWidget_complex_struct(widget, complex);
2578  ok(hr == S_OK, "Got hr %#x.\n", hr);
2579 }
static const RECT test_rect1
Definition: tmarshal.c:63
int array_t[4]
Definition: tmarshal.idl:109
static const struct thin test_thin_struct
Definition: tmarshal.c:61
Definition: compat.h:1947
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static const RECT test_rect4
Definition: tmarshal.c:66
HRESULT hr
Definition: shlfolder.c:183
static const MYSTRUCT test_mystruct7
Definition: tmarshal.c:59
static const RECT test_rect7
Definition: tmarshal.c:69
#define V_I4(A)
Definition: oleauto.h:247
struct TestTypelib::tagMYSTRUCT MYSTRUCT
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 const MYSTRUCT test_mystruct2
Definition: tmarshal.c:54
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
static const array_t test_array1
Definition: tmarshal.c:71
static const WCHAR test_bstr2[]
Definition: tmarshal.c:49
LONG HRESULT
Definition: typedefs.h:77
static refpint_t pi[]
Definition: server.c:96
static const MYSTRUCT test_mystruct4
Definition: tmarshal.c:56
static FILE * out
Definition: regtests2xml.c:44
static const MYSTRUCT test_mystruct3
Definition: tmarshal.c:55
#define V_VT(A)
Definition: oleauto.h:211
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const RECT test_rect2
Definition: tmarshal.c:64
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)
#define ok(value,...)
Definition: atltest.h:57
static const RECT test_rect5
Definition: tmarshal.c:67
static const RECT test_rect3
Definition: tmarshal.c:65
static const MYSTRUCT test_mystruct5
Definition: tmarshal.c:57
static const MYSTRUCT test_mystruct1
Definition: tmarshal.c:53
static ISomethingFromDispatch * create_disp_obj(void)
Definition: tmarshal.c:484

Referenced by test_typelibmarshal().

◆ test_marshal_variant()

static void test_marshal_variant ( IWidget *  widget,
IDispatch disp 
)
static

Definition at line 2446 of file tmarshal.c.

2447 {
2448  VARIANTARG arg[4];
2449  DISPPARAMS dispparams = {arg, NULL, ARRAY_SIZE(arg), 0};
2450  VARIANT out, in_ptr, in_out;
2451  HRESULT hr;
2452  BSTR bstr;
2453 
2454  testmode = 0;
2455  V_VT(&out) = VT_I4;
2456  V_I4(&out) = 1;
2457  V_VT(&in_ptr) = VT_I4;
2458  V_I4(&in_ptr) = -1;
2459  V_VT(&in_out) = VT_BSTR;
2460