ReactOS 0.4.16-dev-297-gc569aee
run.c File Reference
#include <stdio.h>
#include <ole2.h>
#include <dispex.h>
#include <activscp.h>
#include "vbsregexp55.h"
#include "wine/test.h"
Include dependency graph for run.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface
 
#define IActiveScriptParse_Release   IActiveScriptParse32_Release
 
#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew
 
#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText
 
#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release
 
#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText
 
#define DEFINE_EXPECT(func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)    expect_ ## func = TRUE
 
#define REF_EXPECT(func)    (&expect_ ## func), (&called_ ## func)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define CHECK_NOT_CALLED(func)
 
#define CLEAR_CALLED(func)    expect_ ## func = called_ ## func = FALSE
 
#define DISPID_GLOBAL_REPORTSUCCESS   1000
 
#define DISPID_GLOBAL_TRACE   1001
 
#define DISPID_GLOBAL_OK   1002
 
#define DISPID_GLOBAL_GETVT   1003
 
#define DISPID_GLOBAL_ISENGLANG   1004
 
#define DISPID_GLOBAL_VBVAR   1005
 
#define DISPID_GLOBAL_TESTOBJ   1006
 
#define DISPID_GLOBAL_ISNULLDISP   1007
 
#define DISPID_GLOBAL_TESTDISP   1008
 
#define DISPID_GLOBAL_REFOBJ   1009
 
#define DISPID_GLOBAL_COUNTER   1010
 
#define DISPID_GLOBAL_PROPARGPUT   1011
 
#define DISPID_GLOBAL_PROPARGPUT1   1012
 
#define DISPID_GLOBAL_COLLOBJ   1013
 
#define DISPID_GLOBAL_DOUBLEASSTRING   1014
 
#define DISPID_GLOBAL_TESTARRAY   1015
 
#define DISPID_GLOBAL_THROWINT   1016
 
#define DISPID_GLOBAL_TESTOPTIONALARG   1017
 
#define DISPID_GLOBAL_LETOBJ   1018
 
#define DISPID_GLOBAL_SETOBJ   1019
 
#define DISPID_GLOBAL_TODO_WINE_OK   1020
 
#define DISPID_GLOBAL_WEEKSTARTDAY   1021
 
#define DISPID_GLOBAL_GLOBALCALLBACK   1022
 
#define DISPID_GLOBAL_TESTERROROBJECT   1023
 
#define DISPID_TESTOBJ_PROPGET   2000
 
#define DISPID_TESTOBJ_PROPPUT   2001
 
#define DISPID_TESTOBJ_KEYWORD   2002
 
#define DISPID_COLLOBJ_RESET   3000
 
#define FACILITY_VBS   0xa
 
#define MAKE_VBSERROR(code)   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code)
 
#define test_grfdex(a, b)   _test_grfdex(__LINE__,a,b)
 
#define parse_htmlscript_a(a)   _parse_htmlscript_a(__LINE__,a)
 

Functions

 DEFINE_EXPECT (global_success_d)
 
 DEFINE_EXPECT (global_success_i)
 
 DEFINE_EXPECT (global_vbvar_d)
 
 DEFINE_EXPECT (global_vbvar_i)
 
 DEFINE_EXPECT (global_letobj_i)
 
 DEFINE_EXPECT (global_setobj_i)
 
 DEFINE_EXPECT (global_globalcallback_i)
 
 DEFINE_EXPECT (testobj_propget_d)
 
 DEFINE_EXPECT (testobj_propget_i)
 
 DEFINE_EXPECT (testobj_propput_d)
 
 DEFINE_EXPECT (testobj_propput_i)
 
 DEFINE_EXPECT (testobj_value_i)
 
 DEFINE_EXPECT (global_propargput_d)
 
 DEFINE_EXPECT (global_propargput_i)
 
 DEFINE_EXPECT (global_propargput1_d)
 
 DEFINE_EXPECT (global_propargput1_i)
 
 DEFINE_EXPECT (global_testoptionalarg_i)
 
 DEFINE_EXPECT (global_testerrorobject_i)
 
 DEFINE_EXPECT (collectionobj_newenum_i)
 
 DEFINE_EXPECT (Next)
 
 DEFINE_EXPECT (GetWindow)
 
 DEFINE_EXPECT (GetUIBehavior)
 
 DEFINE_EXPECT (EnableModeless)
 
 DEFINE_EXPECT (OnScriptError)
 
 DEFINE_EXPECT (OnEnterScript)
 
 DEFINE_EXPECT (OnLeaveScript)
 
static BSTR a2bstr (const char *str)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static int stricmp_wa (LPCWSTR strw, const char *stra)
 
static const charvt2a (VARIANT *v)
 
static void detect_locale (void)
 
static HRESULT WINAPI ServiceProvider_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ServiceProvider_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI ServiceProvider_Release (IServiceProvider *iface)
 
static HRESULT WINAPI ServiceProvider_QueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
static void test_disp (IDispatch *disp)
 
static void test_safearray (SAFEARRAY *safearray, unsigned indims)
 
static void _test_grfdex (unsigned line, DWORD grfdex, DWORD expect)
 
static HRESULT WINAPI EnumVARIANT_QueryInterface (IEnumVARIANT *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI EnumVARIANT_AddRef (IEnumVARIANT *iface)
 
static ULONG WINAPI EnumVARIANT_Release (IEnumVARIANT *iface)
 
static HRESULT WINAPI EnumVARIANT_Next (IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
 
static HRESULT WINAPI EnumVARIANT_Skip (IEnumVARIANT *iface, ULONG celt)
 
static HRESULT WINAPI EnumVARIANT_Reset (IEnumVARIANT *iface)
 
static HRESULT WINAPI EnumVARIANT_Clone (IEnumVARIANT *iface, IEnumVARIANT **ppEnum)
 
static HRESULT WINAPI DispatchEx_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DispatchEx_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI DispatchEx_Release (IDispatchEx *iface)
 
static HRESULT WINAPI DispatchEx_GetTypeInfoCount (IDispatchEx *iface, UINT *pctinfo)
 
static HRESULT WINAPI DispatchEx_GetTypeInfo (IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI DispatchEx_GetIDsOfNames (IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI DispatchEx_Invoke (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByName (IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID (IDispatchEx *iface, DISPID id)
 
static HRESULT WINAPI DispatchEx_GetMemberProperties (IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
 
static HRESULT WINAPI DispatchEx_GetMemberName (IDispatchEx *iface, DISPID id, BSTR *pbstrName)
 
static HRESULT WINAPI DispatchEx_GetNextDispID (IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
 
static HRESULT WINAPI DispatchEx_GetNameSpaceParent (IDispatchEx *iface, IUnknown **ppunk)
 
static HRESULT WINAPI DispatchEx_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI DispatchEx_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI testObj_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI testObj_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI enumDisp_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI collectionObj_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI collectionObj_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static ULONG WINAPI RefObj_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI RefObj_Release (IDispatchEx *iface)
 
static ULONG WINAPI Global_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI Global_Release (IDispatchEx *iface)
 
static HRESULT WINAPI Global_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI Global_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface (IActiveScriptSiteWindow *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteWindow_AddRef (IActiveScriptSiteWindow *iface)
 
static ULONG WINAPI ActiveScriptSiteWindow_Release (IActiveScriptSiteWindow *iface)
 
static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow (IActiveScriptSiteWindow *iface, HWND *phwnd)
 
static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless (IActiveScriptSiteWindow *iface, BOOL fEnable)
 
static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface (IActiveScriptSiteUIControl *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSiteUIControl_AddRef (IActiveScriptSiteUIControl *iface)
 
static ULONG WINAPI ActiveScriptSiteUIControl_Release (IActiveScriptSiteUIControl *iface)
 
static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior (IActiveScriptSiteUIControl *iface, SCRIPTUICITEM UicItem, SCRIPTUICHANDLING *pUicHandling)
 
static HRESULT WINAPI ActiveScriptSite_QueryInterface (IActiveScriptSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptSite_AddRef (IActiveScriptSite *iface)
 
static ULONG WINAPI ActiveScriptSite_Release (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_GetLCID (IActiveScriptSite *iface, LCID *plcid)
 
static HRESULT WINAPI ActiveScriptSite_GetItemInfo (IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
 
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString (IActiveScriptSite *iface, BSTR *pbstrVersion)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate (IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
 
static HRESULT WINAPI ActiveScriptSite_OnStateChange (IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
 
static HRESULT WINAPI ActiveScriptSite_OnScriptError (IActiveScriptSite *iface, IActiveScriptError *pscripterror)
 
static HRESULT WINAPI ActiveScriptSite_OnEnterScript (IActiveScriptSite *iface)
 
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript (IActiveScriptSite *iface)
 
static IActiveScriptcreate_script (void)
 
static IActiveScriptcreate_and_init_script (DWORD flags, BOOL start)
 
static void close_script (IActiveScript *script)
 
static HRESULT parse_script (DWORD flags, BSTR script_str, const WCHAR *delim)
 
static void parse_script_af (DWORD flags, const char *src)
 
static HRESULT parse_script_ar (const char *src)
 
static void test_parse_context (void)
 
static void parse_script_a (const char *src)
 
static void _parse_htmlscript_a (unsigned line, const char *src)
 
static IDispatchExparse_procedure (IActiveScriptParseProcedure2 *parse_proc, const char *src, DWORD flags)
 
static void test_procedures (void)
 
static void free_ei (EXCEPINFO *ei)
 
static void test_callbacks (void)
 
static void test_gc (void)
 
static void test_parse_errors (void)
 
static void test_msgbox (void)
 
static HRESULT test_global_vars_ref (BOOL use_close)
 
static void test_isexpression (void)
 
static BSTR get_script_from_file (const char *filename)
 
static void run_from_file (const char *filename)
 
static void run_from_res (const char *name)
 
static void run_tests (void)
 
static BOOL check_vbscript (void)
 
 START_TEST (run)
 

Variables

const CLSID CLSID_VBScript
 
const CLSID CLSID_VBScriptRegExp
 
static const WCHAR testW [] = {'t','e','s','t',0}
 
static const WCHAR emptyW [] = {0}
 
static BOOL strict_dispid_check
 
static BOOL is_english
 
static BOOL allow_ui
 
static int first_day_of_week
 
static const chartest_name = "(null)"
 
static int test_counter
 
static SCRIPTUICHANDLING uic_handling = SCRIPTUICHANDLING_NOUIERROR
 
static IDispatchEx testObj = { &testObjVtbl }
 
static HRESULT onerror_hres = E_NOTIMPL
 
static BOOL strict_enter_script
 
static const IServiceProviderVtbl ServiceProviderVtbl
 
static IServiceProvider caller_sp = { &ServiceProviderVtbl }
 
static IDispatchEx enumDisp = { &enumDispVtbl }
 
static unsigned next_cnt
 
static const IEnumVARIANTVtbl EnumVARIANTVtbl
 
static IEnumVARIANT enumObj = { &EnumVARIANTVtbl }
 
static IDispatchExVtbl testObjVtbl
 
static IDispatchExVtbl enumDispVtbl
 
static IDispatchExVtbl collectionObjVtbl
 
static IDispatchEx collectionObj = { &collectionObjVtbl }
 
static ULONG refobj_ref
 
static IDispatchExVtbl RefObjVtbl
 
static IDispatchEx RefObj = { &RefObjVtbl }
 
static ULONG global_ref
 
static IDispatchExVtbl GlobalVtbl
 
static IDispatchEx Global = { &GlobalVtbl }
 
static const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl
 
static IActiveScriptSiteWindow ActiveScriptSiteWindow = { &ActiveScriptSiteWindowVtbl }
 
static const IActiveScriptSiteUIControlVtbl ActiveScriptSiteUIControlVtbl
 
static IActiveScriptSiteUIControl ActiveScriptSiteUIControl = { &ActiveScriptSiteUIControlVtbl }
 
static IActiveScriptError ** store_script_error
 
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
 
static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }
 

Macro Definition Documentation

◆ CHECK_CALLED

#define CHECK_CALLED (   func)
Value:
do { \
ok(called_ ## func, "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
#define FALSE
Definition: types.h:117
GLenum func
Definition: glext.h:6028
#define expect_(expected, got, precision)
Definition: font.c:29

Definition at line 76 of file run.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)

Definition at line 70 of file run.c.

◆ CHECK_EXPECT2

#define CHECK_EXPECT2 (   func)
Value:
do { \
ok(expect_ ##func, "unexpected call " #func "\n"); \
called_ ## func = TRUE; \
}while(0)
#define TRUE
Definition: types.h:120

Definition at line 64 of file run.c.

◆ CHECK_NOT_CALLED

#define CHECK_NOT_CALLED (   func)
Value:
do { \
ok(!called_ ## func, "unexpected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)

Definition at line 82 of file run.c.

◆ CLEAR_CALLED

#define CLEAR_CALLED (   func)     expect_ ## func = called_ ## func = FALSE

Definition at line 88 of file run.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file run.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 22 of file run.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)     static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 55 of file run.c.

◆ DISPID_COLLOBJ_RESET

#define DISPID_COLLOBJ_RESET   3000

Definition at line 147 of file run.c.

◆ DISPID_GLOBAL_COLLOBJ

#define DISPID_GLOBAL_COLLOBJ   1013

Definition at line 131 of file run.c.

◆ DISPID_GLOBAL_COUNTER

#define DISPID_GLOBAL_COUNTER   1010

Definition at line 128 of file run.c.

◆ DISPID_GLOBAL_DOUBLEASSTRING

#define DISPID_GLOBAL_DOUBLEASSTRING   1014

Definition at line 132 of file run.c.

◆ DISPID_GLOBAL_GETVT

#define DISPID_GLOBAL_GETVT   1003

Definition at line 121 of file run.c.

◆ DISPID_GLOBAL_GLOBALCALLBACK

#define DISPID_GLOBAL_GLOBALCALLBACK   1022

Definition at line 140 of file run.c.

◆ DISPID_GLOBAL_ISENGLANG

#define DISPID_GLOBAL_ISENGLANG   1004

Definition at line 122 of file run.c.

◆ DISPID_GLOBAL_ISNULLDISP

#define DISPID_GLOBAL_ISNULLDISP   1007

Definition at line 125 of file run.c.

◆ DISPID_GLOBAL_LETOBJ

#define DISPID_GLOBAL_LETOBJ   1018

Definition at line 136 of file run.c.

◆ DISPID_GLOBAL_OK

#define DISPID_GLOBAL_OK   1002

Definition at line 120 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT

#define DISPID_GLOBAL_PROPARGPUT   1011

Definition at line 129 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT1

#define DISPID_GLOBAL_PROPARGPUT1   1012

Definition at line 130 of file run.c.

◆ DISPID_GLOBAL_REFOBJ

#define DISPID_GLOBAL_REFOBJ   1009

Definition at line 127 of file run.c.

◆ DISPID_GLOBAL_REPORTSUCCESS

#define DISPID_GLOBAL_REPORTSUCCESS   1000

Definition at line 118 of file run.c.

◆ DISPID_GLOBAL_SETOBJ

#define DISPID_GLOBAL_SETOBJ   1019

Definition at line 137 of file run.c.

◆ DISPID_GLOBAL_TESTARRAY

#define DISPID_GLOBAL_TESTARRAY   1015

Definition at line 133 of file run.c.

◆ DISPID_GLOBAL_TESTDISP

#define DISPID_GLOBAL_TESTDISP   1008

Definition at line 126 of file run.c.

◆ DISPID_GLOBAL_TESTERROROBJECT

#define DISPID_GLOBAL_TESTERROROBJECT   1023

Definition at line 141 of file run.c.

◆ DISPID_GLOBAL_TESTOBJ

#define DISPID_GLOBAL_TESTOBJ   1006

Definition at line 124 of file run.c.

◆ DISPID_GLOBAL_TESTOPTIONALARG

#define DISPID_GLOBAL_TESTOPTIONALARG   1017

Definition at line 135 of file run.c.

◆ DISPID_GLOBAL_THROWINT

#define DISPID_GLOBAL_THROWINT   1016

Definition at line 134 of file run.c.

◆ DISPID_GLOBAL_TODO_WINE_OK

#define DISPID_GLOBAL_TODO_WINE_OK   1020

Definition at line 138 of file run.c.

◆ DISPID_GLOBAL_TRACE

#define DISPID_GLOBAL_TRACE   1001

Definition at line 119 of file run.c.

◆ DISPID_GLOBAL_VBVAR

#define DISPID_GLOBAL_VBVAR   1005

Definition at line 123 of file run.c.

◆ DISPID_GLOBAL_WEEKSTARTDAY

#define DISPID_GLOBAL_WEEKSTARTDAY   1021

Definition at line 139 of file run.c.

◆ DISPID_TESTOBJ_KEYWORD

#define DISPID_TESTOBJ_KEYWORD   2002

Definition at line 145 of file run.c.

◆ DISPID_TESTOBJ_PROPGET

#define DISPID_TESTOBJ_PROPGET   2000

Definition at line 143 of file run.c.

◆ DISPID_TESTOBJ_PROPPUT

#define DISPID_TESTOBJ_PROPPUT   2001

Definition at line 144 of file run.c.

◆ FACILITY_VBS

#define FACILITY_VBS   0xa

Definition at line 149 of file run.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 45 of file run.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 46 of file run.c.

◆ IActiveScriptParse_QueryInterface

#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface

Definition at line 43 of file run.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 44 of file run.c.

◆ IActiveScriptParseProcedure2_ParseProcedureText

#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText

Definition at line 48 of file run.c.

◆ IActiveScriptParseProcedure2_Release

#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release

Definition at line 47 of file run.c.

◆ MAKE_VBSERROR

#define MAKE_VBSERROR (   code)    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code)

Definition at line 150 of file run.c.

◆ parse_htmlscript_a

#define parse_htmlscript_a (   a)    _parse_htmlscript_a(__LINE__,a)

Definition at line 2113 of file run.c.

◆ REF_EXPECT

#define REF_EXPECT (   func)     (&expect_ ## func), (&called_ ## func)

Definition at line 61 of file run.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)     expect_ ## func = TRUE

Definition at line 58 of file run.c.

◆ test_grfdex

#define test_grfdex (   a,
  b 
)    _test_grfdex(__LINE__,a,b)

Definition at line 592 of file run.c.

Function Documentation

◆ _parse_htmlscript_a()

static void _parse_htmlscript_a ( unsigned  line,
const char src 
)
static

Definition at line 2114 of file run.c.

2115{
2116 BSTR tmp;
2117 HRESULT hres;
2118
2119 static const WCHAR script_delimW[] = {'<','/','S','C','R','I','P','T','>',0};
2120
2121 tmp = a2bstr(src);
2122 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp, script_delimW);
2123 SysFreeString(tmp);
2124 ok_(__FILE__,line)(hres == S_OK, "parse_script failed: %08x\n", hres);
2125}
#define ok_(x1, x2)
Definition: atltest.h:61
OLECHAR * BSTR
Definition: compat.h:2293
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:52
HRESULT hres
Definition: protocol.c:465
static BSTR a2bstr(const char *str)
Definition: run.c:207
static HRESULT parse_script(DWORD flags, BSTR script_str)
Definition: run.c:1810
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
Definition: parser.c:49
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ _test_grfdex()

static void _test_grfdex ( unsigned  line,
DWORD  grfdex,
DWORD  expect 
)
static

Definition at line 593 of file run.c.

594{
595 ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
596}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 164 of file run.c.

165{
166 BSTR ret;
167 int len;
168
169 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
172
173 return ret;
174}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const WCHAR * str
int ret

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 1819 of file run.c.

1820{
1821 return 2;
1822}

◆ ActiveScriptSite_GetDocVersionString()

static HRESULT WINAPI ActiveScriptSite_GetDocVersionString ( IActiveScriptSite iface,
BSTR pbstrVersion 
)
static

Definition at line 1849 of file run.c.

1850{
1851 return E_NOTIMPL;
1852}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_GetItemInfo()

static HRESULT WINAPI ActiveScriptSite_GetItemInfo ( IActiveScriptSite iface,
LPCOLESTR  pstrName,
DWORD  dwReturnMask,
IUnknown **  ppiunkItem,
ITypeInfo **  ppti 
)
static

Definition at line 1835 of file run.c.

1837{
1838 ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
1839 ok(!ppti, "ppti != NULL\n");
1840
1841 if(strcmp_wa(pstrName, "test"))
1842 ok(0, "unexpected pstrName %s\n", wine_dbgstr_w(pstrName));
1843
1844 *ppiunkItem = (IUnknown*)&Global;
1845 IUnknown_AddRef(*ppiunkItem);
1846 return S_OK;
1847}
#define ok(value,...)
Definition: atltest.h:57
#define wine_dbgstr_w
Definition: kernel32.h:34
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
static IDispatchEx Global
Definition: run.c:1648

◆ ActiveScriptSite_GetLCID()

static HRESULT WINAPI ActiveScriptSite_GetLCID ( IActiveScriptSite iface,
LCID plcid 
)
static

Definition at line 1829 of file run.c.

1830{
1831 *plcid = GetUserDefaultLCID();
1832 return S_OK;
1833}
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1211

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 1900 of file run.c.

1901{
1903 CHECK_EXPECT(OnEnterScript);
1904 return E_NOTIMPL;
1905}
#define CHECK_EXPECT(func)
Definition: run.c:67
static BOOL strict_enter_script
Definition: run.c:162

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 1907 of file run.c.

1908{
1910 CHECK_EXPECT(OnLeaveScript);
1911 return E_NOTIMPL;
1912}

◆ ActiveScriptSite_OnScriptError()

static HRESULT WINAPI ActiveScriptSite_OnScriptError ( IActiveScriptSite iface,
IActiveScriptError pscripterror 
)
static

Definition at line 1867 of file run.c.

1868{
1870
1871 if(!expect_OnScriptError) {
1873 ULONG line;
1874 HRESULT hres;
1875
1876 hres = IActiveScriptError_GetSourcePosition(pscripterror, NULL, &line, NULL);
1877 if(SUCCEEDED(hres))
1878 hres = IActiveScriptError_GetExceptionInfo(pscripterror, &info);
1879 if(SUCCEEDED(hres))
1880 trace("Error in line %u: %x %s\n", line+1, info.wCode, wine_dbgstr_w(info.bstrDescription));
1881 }else {
1882 IDispatchEx *dispex;
1883
1884 hres = IActiveScriptError_QueryInterface(pscripterror, &IID_IDispatchEx, (void**)&dispex);
1885 ok(hres == E_NOINTERFACE, "QI(IDispatchEx) returned: %08x\n", hres);
1886 }
1887
1888 if(store_script_error) {
1889 IActiveScriptError_AddRef(pscripterror);
1890 *store_script_error = pscripterror;
1892 }
1893
1894 CHECK_EXPECT(OnScriptError);
1896
1897 return hr;
1898}
#define trace
Definition: atltest.h:70
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static IActiveScriptError ** store_script_error
Definition: run.c:1865
static HRESULT onerror_hres
Definition: run.c:161
struct stdole::EXCEPINFO EXCEPINFO
HRESULT hr
Definition: shlfolder.c:183
uint32_t ULONG
Definition: typedefs.h:59
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ActiveScriptSite_OnScriptTerminate()

static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate ( IActiveScriptSite iface,
const VARIANT pvarResult,
const EXCEPINFO *  pexcepinfo 
)
static

Definition at line 1854 of file run.c.

1856{
1857 return E_NOTIMPL;
1858}

◆ ActiveScriptSite_OnStateChange()

static HRESULT WINAPI ActiveScriptSite_OnStateChange ( IActiveScriptSite iface,
SCRIPTSTATE  ssScriptState 
)
static

Definition at line 1860 of file run.c.

1861{
1862 return E_NOTIMPL;
1863}

◆ ActiveScriptSite_QueryInterface()

static HRESULT WINAPI ActiveScriptSite_QueryInterface ( IActiveScriptSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1800 of file run.c.

1801{
1802 *ppv = NULL;
1803
1805 *ppv = iface;
1806 else if(IsEqualGUID(&IID_IActiveScriptSite, riid))
1807 *ppv = iface;
1808 else if(IsEqualGUID(&IID_IActiveScriptSiteWindow, riid))
1810 else if(IsEqualGUID(&IID_IActiveScriptSiteUIControl, riid))
1812 else
1813 return E_NOINTERFACE;
1814
1815 IUnknown_AddRef((IUnknown*)*ppv);
1816 return S_OK;
1817}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IActiveScriptSiteWindow ActiveScriptSiteWindow
Definition: run.c:1762
static IActiveScriptSiteUIControl ActiveScriptSiteUIControl
Definition: run.c:1798
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 1824 of file run.c.

1825{
1826 return 1;
1827}

◆ ActiveScriptSiteUIControl_AddRef()

static ULONG WINAPI ActiveScriptSiteUIControl_AddRef ( IActiveScriptSiteUIControl iface)
static

Definition at line 1770 of file run.c.

1771{
1772 return 2;
1773}

◆ ActiveScriptSiteUIControl_GetUIBehavior()

static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior ( IActiveScriptSiteUIControl iface,
SCRIPTUICITEM  UicItem,
SCRIPTUICHANDLING pUicHandling 
)
static

Definition at line 1780 of file run.c.

1782{
1783 if(!allow_ui) {
1784 CHECK_EXPECT(GetUIBehavior);
1785 ok(UicItem == SCRIPTUICITEM_MSGBOX, "UidItem = %d\n", UicItem);
1786 }
1787 *pUicHandling = uic_handling;
1788 return S_OK;
1789}
@ SCRIPTUICITEM_MSGBOX
Definition: activscp.idl:72
static BOOL allow_ui
Definition: run.c:155
static SCRIPTUICHANDLING uic_handling
Definition: run.c:159

◆ ActiveScriptSiteUIControl_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface ( IActiveScriptSiteUIControl iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1764 of file run.c.

1765{
1766 ok(0, "unexpected call\n");
1767 return E_NOINTERFACE;
1768}

◆ ActiveScriptSiteUIControl_Release()

static ULONG WINAPI ActiveScriptSiteUIControl_Release ( IActiveScriptSiteUIControl iface)
static

Definition at line 1775 of file run.c.

1776{
1777 return 1;
1778}

◆ ActiveScriptSiteWindow_AddRef()

static ULONG WINAPI ActiveScriptSiteWindow_AddRef ( IActiveScriptSiteWindow iface)
static

Definition at line 1726 of file run.c.

1727{
1728 return 2;
1729}

◆ ActiveScriptSiteWindow_EnableModeless()

static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless ( IActiveScriptSiteWindow iface,
BOOL  fEnable 
)
static

Definition at line 1744 of file run.c.

1745{
1746 if(allow_ui)
1747 return S_OK;
1748
1750 ok(!fEnable, "fEnable = %x\n", fEnable);
1751 return E_FAIL;
1752}
#define E_FAIL
Definition: ddrawi.h:102
#define EnableModeless(type)
Definition: ordinal.c:3540

◆ ActiveScriptSiteWindow_GetWindow()

static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow ( IActiveScriptSiteWindow iface,
HWND phwnd 
)
static

Definition at line 1736 of file run.c.

1737{
1738 if(!allow_ui)
1740 *phwnd = NULL;
1741 return S_OK;
1742}
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)

◆ ActiveScriptSiteWindow_QueryInterface()

static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface ( IActiveScriptSiteWindow iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1720 of file run.c.

1721{
1722 ok(0, "unexpected call\n");
1723 return E_NOINTERFACE;
1724}

◆ ActiveScriptSiteWindow_Release()

static ULONG WINAPI ActiveScriptSiteWindow_Release ( IActiveScriptSiteWindow iface)
static

Definition at line 1731 of file run.c.

1732{
1733 return 1;
1734}

◆ check_vbscript()

static BOOL check_vbscript ( void  )
static

Definition at line 3052 of file run.c.

3053{
3054 IRegExp2 *regexp;
3055 IUnknown *unk;
3056 HRESULT hres;
3057
3059 CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
3060 &IID_IUnknown, (void**)&unk);
3062 return FALSE;
3063 ok(hres == S_OK, "CoCreateInstance(CLSID_VBScriptRegExp) failed: %x\n", hres);
3064
3065 hres = IUnknown_QueryInterface(unk, &IID_IRegExp2, (void**)&regexp);
3066 if(SUCCEEDED(hres))
3067 IRegExp2_Release(regexp);
3068 IUnknown_Release(unk);
3069
3070 return hres == S_OK;
3071}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
const CLSID CLSID_VBScriptRegExp
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696

Referenced by START_TEST().

◆ close_script()

static void close_script ( IActiveScript script)
static

Definition at line 1976 of file run.c.

1977{
1978 ULONG ref;
1979 HRESULT hres;
1980
1981 hres = IActiveScript_Close(script);
1982 ok(hres == S_OK, "Close failed: %08x\n", hres);
1983
1984 ref = IActiveScript_Release(script);
1985 ok(!ref, "ref=%u\n", ref);
1986}
script
Definition: msipriv.h:383
Definition: send.c:48

Referenced by test_callbacks(), test_isexpression(), test_parse_context(), and test_procedures().

◆ collectionObj_GetDispID()

static HRESULT WINAPI collectionObj_GetDispID ( IDispatchEx iface,
BSTR  bstrName,
DWORD  grfdex,
DISPID pid 
)
static

Definition at line 977 of file run.c.

978{
979 if(!strcmp_wa(bstrName, "reset")) {
981 return S_OK;
982 }
983
984 ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName));
985 return DISP_E_UNKNOWNNAME;
986}
#define DISPID_COLLOBJ_RESET
Definition: run.c:147
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515

◆ collectionObj_InvokeEx()

static HRESULT WINAPI collectionObj_InvokeEx ( IDispatchEx iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 988 of file run.c.

990{
991 switch(id) {
992 case DISPID_NEWENUM:
994 CHECK_EXPECT(collectionobj_newenum_i);
995
996 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
997 ok(pdp != NULL, "pdp == NULL\n");
998 ok(!pdp->rgvarg, "rgvarg == NULL\n");
999 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1000 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1001 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1002 ok(pvarRes != NULL, "pvarRes == NULL\n");
1003 ok(pei != NULL, "pei == NULL\n");
1004
1005 V_VT(pvarRes) = VT_UNKNOWN;
1006 V_UNKNOWN(pvarRes) = (IUnknown*)&enumObj;
1007 return S_OK;
1009 next_cnt = 0;
1010 return S_OK;
1011 }
1012
1013 ok(0, "unexpected call %d\n", id);
1014 return E_NOTIMPL;
1015}
@ VT_UNKNOWN
Definition: compat.h:2308
static BOOL strict_dispid_check
Definition: run.c:176
static IEnumVARIANT enumObj
Definition: run.c:674
static unsigned next_cnt
Definition: run.c:626
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_VT(A)
Definition: oleauto.h:211
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ create_and_init_script()

static IActiveScript * create_and_init_script ( DWORD  flags,
BOOL  start 
)
static

Definition at line 1942 of file run.c.

1943{
1944 IActiveScriptParse *parser;
1945 IActiveScript *engine;
1946 HRESULT hres;
1947
1948 engine = create_script();
1949 if(!engine)
1950 return NULL;
1951
1952 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1953 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1954
1956 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1957
1959
1960 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1961 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1962
1963 hres = IActiveScript_AddNamedItem(engine, testW,
1964 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
1965 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1966
1967 if (start)
1968 {
1969 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1970 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1971 }
1972
1973 return engine;
1974}
@ SCRIPTSTATE_STARTED
Definition: activscp.idl:58
GLuint start
Definition: gl.h:1545
GLbitfield flags
Definition: glext.h:7161
static const WCHAR testW[]
Definition: run.c:170
#define IActiveScriptParse_InitNew
Definition: run.c:43
#define IActiveScriptParse_Release
Definition: run.c:42
static IActiveScript * create_script(void)
Definition: run.c:1788
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1743
Definition: import.c:81

Referenced by parse_script(), test_callbacks(), test_isexpression(), test_parse_context(), and test_procedures().

◆ create_script()

static IActiveScript * create_script ( void  )
static

Definition at line 1930 of file run.c.

1931{
1933 HRESULT hres;
1934
1935 hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1936 &IID_IActiveScript, (void**)&script);
1937 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
1938
1939 return script;
1940}
const CLSID CLSID_VBScript

◆ DEFINE_EXPECT() [1/26]

DEFINE_EXPECT ( collectionobj_newenum_i  )

◆ DEFINE_EXPECT() [2/26]

DEFINE_EXPECT ( EnableModeless  )

◆ DEFINE_EXPECT() [3/26]

DEFINE_EXPECT ( GetUIBehavior  )

◆ DEFINE_EXPECT() [4/26]

DEFINE_EXPECT ( GetWindow  )

◆ DEFINE_EXPECT() [5/26]

DEFINE_EXPECT ( global_globalcallback_i  )

◆ DEFINE_EXPECT() [6/26]

DEFINE_EXPECT ( global_letobj_i  )

◆ DEFINE_EXPECT() [7/26]

DEFINE_EXPECT ( global_propargput1_d  )

◆ DEFINE_EXPECT() [8/26]

DEFINE_EXPECT ( global_propargput1_i  )

◆ DEFINE_EXPECT() [9/26]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [10/26]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [11/26]

DEFINE_EXPECT ( global_setobj_i  )

◆ DEFINE_EXPECT() [12/26]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [13/26]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [14/26]

DEFINE_EXPECT ( global_testerrorobject_i  )

◆ DEFINE_EXPECT() [15/26]

DEFINE_EXPECT ( global_testoptionalarg_i  )

◆ DEFINE_EXPECT() [16/26]

DEFINE_EXPECT ( global_vbvar_d  )

◆ DEFINE_EXPECT() [17/26]

DEFINE_EXPECT ( global_vbvar_i  )

◆ DEFINE_EXPECT() [18/26]

DEFINE_EXPECT ( Next  )

◆ DEFINE_EXPECT() [19/26]

DEFINE_EXPECT ( OnEnterScript  )

◆ DEFINE_EXPECT() [20/26]

DEFINE_EXPECT ( OnLeaveScript  )

◆ DEFINE_EXPECT() [21/26]

DEFINE_EXPECT ( OnScriptError  )

◆ DEFINE_EXPECT() [22/26]

DEFINE_EXPECT ( testobj_propget_d  )

◆ DEFINE_EXPECT() [23/26]

DEFINE_EXPECT ( testobj_propget_i  )

◆ DEFINE_EXPECT() [24/26]

DEFINE_EXPECT ( testobj_propput_d  )

◆ DEFINE_EXPECT() [25/26]

DEFINE_EXPECT ( testobj_propput_i  )

◆ DEFINE_EXPECT() [26/26]

DEFINE_EXPECT ( testobj_value_i  )

◆ detect_locale()

static void detect_locale ( void  )
static

Definition at line 237 of file run.c.

238{
239 HMODULE kernel32 = GetModuleHandleA("kernel32.dll");
240 LANGID (WINAPI *pGetThreadUILanguage)(void) = (void*)GetProcAddress(kernel32, "GetThreadUILanguage");
241
242 is_english = ((!pGetThreadUILanguage || PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH) &&
245
247 (void*)&first_day_of_week, sizeof(first_day_of_week));
248 first_day_of_week = 1 + (first_day_of_week + 1) % 7;
249}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: locale.c:1375
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: locale.c:1600
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
USHORT LANGID
Definition: mui.h:9
static BOOL is_english
Definition: run.c:155
static int first_day_of_week
Definition: run.c:156
#define LOCALE_USER_DEFAULT
#define LANG_ENGLISH
Definition: nls.h:52
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define WINAPI
Definition: msvc.h:6
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:77

Referenced by START_TEST().

◆ DispatchEx_AddRef()

static ULONG WINAPI DispatchEx_AddRef ( IDispatchEx iface)
static

Definition at line 693 of file run.c.

694{
695 return 2;
696}

◆ DispatchEx_DeleteMemberByDispID()

static HRESULT WINAPI DispatchEx_DeleteMemberByDispID ( IDispatchEx iface,
DISPID  id 
)
static

Definition at line 737 of file run.c.

738{
739 ok(0, "unexpected call\n");
740 return E_NOTIMPL;
741}

◆ DispatchEx_DeleteMemberByName()

static HRESULT WINAPI DispatchEx_DeleteMemberByName ( IDispatchEx iface,
BSTR  bstrName,
DWORD  grfdex 
)
static

Definition at line 731 of file run.c.

732{
733 ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
734 return E_NOTIMPL;
735}

◆ DispatchEx_GetDispID()

static HRESULT WINAPI DispatchEx_GetDispID ( IDispatchEx iface,
BSTR  bstrName,
DWORD  grfdex,
DISPID pid 
)
static

Definition at line 767 of file run.c.

768{
769 ok(0, "unexpected call\n");
770 return E_NOTIMPL;
771}

◆ DispatchEx_GetIDsOfNames()

static HRESULT WINAPI DispatchEx_GetIDsOfNames ( IDispatchEx iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 715 of file run.c.

718{
719 ok(0, "unexpected call\n");
720 return E_NOTIMPL;
721}

◆ DispatchEx_GetMemberName()

static HRESULT WINAPI DispatchEx_GetMemberName ( IDispatchEx iface,
DISPID  id,
BSTR pbstrName 
)
static

Definition at line 749 of file run.c.

750{
751 ok(0, "unexpected call\n");
752 return E_NOTIMPL;
753}

◆ DispatchEx_GetMemberProperties()

static HRESULT WINAPI DispatchEx_GetMemberProperties ( IDispatchEx iface,
DISPID  id,
DWORD  grfdexFetch,
DWORD pgrfdex 
)
static

Definition at line 743 of file run.c.

744{
745 ok(0, "unexpected call\n");
746 return E_NOTIMPL;
747}

◆ DispatchEx_GetNameSpaceParent()

static HRESULT WINAPI DispatchEx_GetNameSpaceParent ( IDispatchEx iface,
IUnknown **  ppunk 
)
static

Definition at line 761 of file run.c.

762{
763 ok(0, "unexpected call\n");
764 return E_NOTIMPL;
765}

◆ DispatchEx_GetNextDispID()

static HRESULT WINAPI DispatchEx_GetNextDispID ( IDispatchEx iface,
DWORD  grfdex,
DISPID  id,
DISPID pid 
)
static

Definition at line 755 of file run.c.

756{
757 ok(0, "unexpected call\n");
758 return E_NOTIMPL;
759}

◆ DispatchEx_GetTypeInfo()

static HRESULT WINAPI DispatchEx_GetTypeInfo ( IDispatchEx iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 709 of file run.c.

711{
712 return E_NOTIMPL;
713}

◆ DispatchEx_GetTypeInfoCount()

static HRESULT WINAPI DispatchEx_GetTypeInfoCount ( IDispatchEx iface,
UINT pctinfo 
)
static

Definition at line 703 of file run.c.

704{
705 ok(0, "unexpected call\n");
706 return E_NOTIMPL;
707}

◆ DispatchEx_Invoke()

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

Definition at line 723 of file run.c.

726{
727 ok(0, "unexpected call\n");
728 return E_NOTIMPL;
729}

◆ DispatchEx_InvokeEx()

static HRESULT WINAPI DispatchEx_InvokeEx ( IDispatchEx iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 773 of file run.c.

775{
776 ok(0, "unexpected call %d\n", id);
777 return E_NOTIMPL;
778}

◆ DispatchEx_QueryInterface()

static HRESULT WINAPI DispatchEx_QueryInterface ( IDispatchEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 676 of file run.c.

677{
678 *ppv = NULL;
679
682 || IsEqualGUID(riid, &IID_IDispatchEx))
683 *ppv = iface;
684 else {
685 trace("QI %s\n", wine_dbgstr_guid(riid));
686 return E_NOINTERFACE;
687 }
688
689 IUnknown_AddRef((IUnknown*)*ppv);
690 return S_OK;
691}
const GUID IID_IDispatch
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx iface)
static

Definition at line 698 of file run.c.

699{
700 return 1;
701}

◆ enumDisp_QueryInterface()

static HRESULT WINAPI enumDisp_QueryInterface ( IDispatchEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 952 of file run.c.

953{
954 return IEnumVARIANT_QueryInterface(&enumObj, riid, ppv);
955}

◆ EnumVARIANT_AddRef()

static ULONG WINAPI EnumVARIANT_AddRef ( IEnumVARIANT iface)
static

Definition at line 616 of file run.c.

617{
618 return 2;
619}

◆ EnumVARIANT_Clone()

static HRESULT WINAPI EnumVARIANT_Clone ( IEnumVARIANT iface,
IEnumVARIANT **  ppEnum 
)
static

Definition at line 658 of file run.c.

659{
660 ok(0, "unexpected call\n");
661 return E_NOTIMPL;
662}

◆ EnumVARIANT_Next()

static HRESULT WINAPI EnumVARIANT_Next ( IEnumVARIANT iface,
ULONG  celt,
VARIANT rgVar,
ULONG pCeltFetched 
)
static

Definition at line 628 of file run.c.

629{
631 CHECK_EXPECT2(Next);
632
633 ok(celt == 1, "celt = %d\n", celt);
634 ok(V_VT(rgVar) == VT_EMPTY, "V_VT(rgVar) = %d\n", V_VT(rgVar));
635 ok(!pCeltFetched, "pCeltFetched = %p\n", pCeltFetched);
636
637 if(next_cnt++ < 3) {
638 V_VT(rgVar) = VT_I2;
639 V_I2(rgVar) = next_cnt;
640 return S_OK;
641 }
642
643 return S_FALSE;
644}
@ VT_I2
Definition: compat.h:2297
@ VT_EMPTY
Definition: compat.h:2295
#define CHECK_EXPECT2(func)
Definition: run.c:64
#define V_I2(A)
Definition: oleauto.h:245
#define S_FALSE
Definition: winerror.h:2357

◆ EnumVARIANT_QueryInterface()

static HRESULT WINAPI EnumVARIANT_QueryInterface ( IEnumVARIANT iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 600 of file run.c.

601{
602 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumVARIANT)) {
603 *ppv = iface;
604 return S_OK;
605 }
606
608 *ppv = &enumDisp;
609 return S_OK;
610 }
611
612 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
613 return E_NOINTERFACE;
614}
static IDispatchEx enumDisp
Definition: run.c:598

◆ EnumVARIANT_Release()

static ULONG WINAPI EnumVARIANT_Release ( IEnumVARIANT iface)
static

Definition at line 621 of file run.c.

622{
623 return 1;
624}

◆ EnumVARIANT_Reset()

static HRESULT WINAPI EnumVARIANT_Reset ( IEnumVARIANT iface)
static

Definition at line 652 of file run.c.

653{
654 ok(0, "unexpected call\n");
655 return E_NOTIMPL;
656}

◆ EnumVARIANT_Skip()

static HRESULT WINAPI EnumVARIANT_Skip ( IEnumVARIANT iface,
ULONG  celt 
)
static

Definition at line 646 of file run.c.

647{
648 ok(0, "unexpected call\n");
649 return E_NOTIMPL;
650}

◆ free_ei()

static void free_ei ( EXCEPINFO *  ei)
static

Definition at line 2203 of file run.c.

2204{
2205 SysFreeString(ei->bstrSource);
2206 SysFreeString(ei->bstrDescription);
2207 SysFreeString(ei->bstrHelpFile);
2208}

Referenced by test_callbacks().

◆ get_script_from_file()

static BSTR get_script_from_file ( const char filename)
static

Definition at line 2725 of file run.c.

2726{
2727 DWORD size, len;
2728 HANDLE file, map;
2729 const char *file_map;
2730 BSTR ret;
2731
2733 if(file == INVALID_HANDLE_VALUE) {
2734 trace("Could not open file: %u\n", GetLastError());
2735 return NULL;
2736 }
2737
2739
2742 if(map == INVALID_HANDLE_VALUE) {
2743 trace("Could not create file mapping: %u\n", GetLastError());
2744 return NULL;
2745 }
2746
2747 file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
2749 if(!file_map) {
2750 trace("MapViewOfFile failed: %u\n", GetLastError());
2751 return NULL;
2752 }
2753
2754 len = MultiByteToWideChar(CP_ACP, 0, file_map, size, NULL, 0);
2756 MultiByteToWideChar(CP_ACP, 0, file_map, size, ret, len);
2757
2758 UnmapViewOfFile(file_map);
2759
2760 return ret;
2761}
Definition: _map.h:48
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
const char * filename
Definition: ioapi.h:137
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
Definition: fci.c:127
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

◆ Global_AddRef()

static ULONG WINAPI Global_AddRef ( IDispatchEx iface)
static

Definition at line 1071 of file run.c.

1072{
1073 return ++global_ref;
1074}
static ULONG global_ref
Definition: run.c:1069

◆ Global_GetDispID()

static HRESULT WINAPI Global_GetDispID ( IDispatchEx iface,
BSTR  bstrName,
DWORD  grfdex,
DISPID pid 
)
static

Definition at line 1081 of file run.c.

1082{
1083 if(!strcmp_wa(bstrName, "ok")) {
1084 test_grfdex(grfdex, fdexNameCaseInsensitive);
1086 return S_OK;
1087 }
1088 if(!strcmp_wa(bstrName, "todo_wine_ok")) {
1089 test_grfdex(grfdex, fdexNameCaseInsensitive);
1091 return S_OK;
1092 }
1093 if(!strcmp_wa(bstrName, "trace")) {
1094 test_grfdex(grfdex, fdexNameCaseInsensitive);
1096 return S_OK;
1097 }
1098 if(!strcmp_wa(bstrName, "reportSuccess")) {
1099 CHECK_EXPECT(global_success_d);
1100 test_grfdex(grfdex, fdexNameCaseInsensitive);
1102 return S_OK;
1103 }
1104 if(!strcmp_wa(bstrName, "getVT")) {
1105 test_grfdex(grfdex, fdexNameCaseInsensitive);
1107 return S_OK;
1108 }
1109 if(!strcmp_wa(bstrName, "isEnglishLang")) {
1110 test_grfdex(grfdex, fdexNameCaseInsensitive);
1112 return S_OK;
1113 }
1114 if(!strcmp_wa(bstrName, "firstDayOfWeek")) {
1115 test_grfdex(grfdex, fdexNameCaseInsensitive);
1117 return S_OK;
1118 }
1119 if(!strcmp_wa(bstrName, "globalCallback")) {
1120 test_grfdex(grfdex, fdexNameCaseInsensitive);
1122 return S_OK;
1123 }
1124 if(!strcmp_wa(bstrName, "testObj")) {
1125 test_grfdex(grfdex, fdexNameCaseInsensitive);
1127 return S_OK;
1128 }
1129 if(!strcmp_wa(bstrName, "collectionObj")) {
1130 test_grfdex(grfdex, fdexNameCaseInsensitive);
1132 return S_OK;
1133 }
1134 if(!strcmp_wa(bstrName, "vbvar")) {
1135 CHECK_EXPECT(global_vbvar_d);
1136 test_grfdex(grfdex, fdexNameCaseInsensitive);
1138 return S_OK;
1139 }
1140 if(!strcmp_wa(bstrName, "letobj")) {
1141 test_grfdex(grfdex, fdexNameCaseInsensitive);
1143 return S_OK;
1144 }
1145 if(!strcmp_wa(bstrName, "setobj")) {
1146 test_grfdex(grfdex, fdexNameCaseInsensitive);
1148 return S_OK;
1149 }
1150 if(!strcmp_wa(bstrName, "isNullDisp")) {
1151 test_grfdex(grfdex, fdexNameCaseInsensitive);
1153 return S_OK;
1154 }
1155 if(!strcmp_wa(bstrName, "testDisp")) {
1156 test_grfdex(grfdex, fdexNameCaseInsensitive);
1158 return S_OK;
1159 }
1160 if(!strcmp_wa(bstrName, "RefObj")) {
1161 test_grfdex(grfdex, fdexNameCaseInsensitive);
1163 return S_OK;
1164 }
1165 if(!strcmp_wa(bstrName, "propargput")) {
1166 CHECK_EXPECT(global_propargput_d);
1167 test_grfdex(grfdex, fdexNameCaseInsensitive);
1169 return S_OK;
1170 }
1171 if(!strcmp_wa(bstrName, "propargput1")) {
1172 CHECK_EXPECT(global_propargput1_d);
1173 test_grfdex(grfdex, fdexNameCaseInsensitive);
1175 return S_OK;
1176 }
1177 if(!strcmp_wa(bstrName, "counter")) {
1178 test_grfdex(grfdex, fdexNameCaseInsensitive);
1180 return S_OK;
1181 }
1182 if(!strcmp_wa(bstrName, "doubleAsString")) {
1183 test_grfdex(grfdex, fdexNameCaseInsensitive);
1185 return S_OK;
1186 }
1187 if(!strcmp_wa(bstrName, "testArray")) {
1188 test_grfdex(grfdex, fdexNameCaseInsensitive);
1190 return S_OK;
1191 }
1192 if(!strcmp_wa(bstrName, "throwInt")) {
1193 test_grfdex(grfdex, fdexNameCaseInsensitive);
1195 return S_OK;
1196 }
1197 if(!strcmp_wa(bstrName, "testOptionalArg")) {
1198 test_grfdex(grfdex, fdexNameCaseInsensitive);
1200 return S_OK;
1201 }
1202 if(!strcmp_wa(bstrName, "testErrorObject")) {
1203 test_grfdex(grfdex, fdexNameCaseInsensitive);
1205 return S_OK;
1206 }
1207
1208 if(strict_dispid_check && strcmp_wa(bstrName, "x"))
1209 ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
1210 return DISP_E_UNKNOWNNAME;
1211}
#define test_grfdex(a, b)
Definition: run.c:226
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:127
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:131
#define DISPID_GLOBAL_TRACE
Definition: run.c:128
#define DISPID_GLOBAL_OK
Definition: run.c:129
#define DISPID_GLOBAL_GETVT
Definition: run.c:130
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:143
#define DISPID_GLOBAL_ISNULLDISP
Definition: run.c:125
#define DISPID_GLOBAL_ISENGLANG
Definition: run.c:122
#define DISPID_GLOBAL_LETOBJ
Definition: run.c:136
#define DISPID_GLOBAL_DOUBLEASSTRING
Definition: run.c:132
#define DISPID_GLOBAL_WEEKSTARTDAY
Definition: run.c:139
#define DISPID_GLOBAL_GLOBALCALLBACK
Definition: run.c:140
#define DISPID_GLOBAL_TESTOPTIONALARG
Definition: run.c:135
#define DISPID_GLOBAL_TODO_WINE_OK
Definition: run.c:138
#define DISPID_GLOBAL_VBVAR
Definition: run.c:123
#define DISPID_GLOBAL_THROWINT
Definition: run.c:134
#define DISPID_GLOBAL_COLLOBJ
Definition: run.c:131
#define DISPID_GLOBAL_TESTERROROBJECT
Definition: run.c:141
#define DISPID_GLOBAL_TESTDISP
Definition: run.c:126
#define DISPID_GLOBAL_COUNTER
Definition: run.c:128
#define DISPID_GLOBAL_TESTARRAY
Definition: run.c:133
#define DISPID_GLOBAL_SETOBJ
Definition: run.c:137
#define DISPID_GLOBAL_PROPARGPUT1
Definition: run.c:130
#define DISPID_GLOBAL_REFOBJ
Definition: run.c:127

◆ Global_InvokeEx()

static HRESULT WINAPI Global_InvokeEx ( IDispatchEx iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 1213 of file run.c.

1215{
1216 switch(id) {
1218 case DISPID_GLOBAL_OK: {
1219 VARIANT *b;
1220
1221 ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1222 ok(pdp != NULL, "pdp == NULL\n");
1223 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1224 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1225 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1226 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1227 if(wFlags & INVOKE_PROPERTYGET)
1228 ok(pvarRes != NULL, "pvarRes == NULL\n");
1229 else
1230 ok(!pvarRes, "pvarRes != NULL\n");
1231 ok(pei != NULL, "pei == NULL\n");
1232
1233 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1234
1235 b = pdp->rgvarg+1;
1236 if(V_VT(b) == (VT_BYREF|VT_VARIANT))
1237 b = V_BYREF(b);
1238
1239 ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b));
1240
1242 ok(V_BOOL(b), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1243 return S_OK;
1244 }
1245
1247 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1248 ok(pdp != NULL, "pdp == NULL\n");
1249 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1250 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1251 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1252 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1253 ok(!pvarRes, "pvarRes != NULL\n");
1254 ok(pei != NULL, "pei == NULL\n");
1255
1256 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1257 if(V_VT(pdp->rgvarg) == VT_BSTR)
1258 trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1259
1260 return S_OK;
1261
1263 CHECK_EXPECT(global_success_i);
1264
1265 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1266 ok(pdp != NULL, "pdp == NULL\n");
1267 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1268 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1269 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1270 ok(!pvarRes, "pvarRes != NULL\n");
1271 ok(pei != NULL, "pei == NULL\n");
1272
1273 return S_OK;
1274
1276 ok(pdp != NULL, "pdp == NULL\n");
1277 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1278 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1279 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1280 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1281 ok(pvarRes != NULL, "pvarRes == NULL\n");
1282 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1283 ok(pei != NULL, "pei == NULL\n");
1284
1285 V_VT(pvarRes) = VT_BSTR;
1286 V_BSTR(pvarRes) = a2bstr(vt2a(pdp->rgvarg));
1287 return S_OK;
1288
1290 ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1291 ok(pdp != NULL, "pdp == NULL\n");
1292 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1293 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1294 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1295 ok(pvarRes != NULL, "pvarRes == NULL\n");
1296 ok(pei != NULL, "pei == NULL\n");
1297
1298 V_VT(pvarRes) = VT_BOOL;
1299 V_BOOL(pvarRes) = is_english ? VARIANT_TRUE : VARIANT_FALSE;
1300 return S_OK;
1301
1303 V_VT(pvarRes) = VT_I4;
1304 V_I4(pvarRes) = first_day_of_week;
1305 return S_OK;
1306
1308 CHECK_EXPECT(global_vbvar_i);
1309
1310 ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1311 ok(pdp != NULL, "pdp == NULL\n");
1312 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1313 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1314 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1315 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1316 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1317 ok(!pvarRes, "pvarRes != NULL\n");
1318 ok(pei != NULL, "pei == NULL\n");
1319
1320 ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1321 ok(V_I2(pdp->rgvarg) == 3, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1322 return S_OK;
1323
1325 CHECK_EXPECT(global_letobj_i);
1326
1327 ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1328 ok(pdp != NULL, "pdp == NULL\n");
1329 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1330 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1331 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1332 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1333 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1334 ok(!pvarRes, "pvarRes != NULL\n");
1335 ok(pei != NULL, "pei == NULL\n");
1336
1337 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1338 ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n");
1339 return S_OK;
1340
1342 CHECK_EXPECT(global_setobj_i);
1343
1344 ok(wFlags == DISPATCH_PROPERTYPUTREF, "wFlags = %x\n", wFlags);
1345 ok(pdp != NULL, "pdp == NULL\n");
1346 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1347 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1348 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1349 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1350 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1351 ok(!pvarRes, "pvarRes != NULL\n");
1352 ok(pei != NULL, "pei == NULL\n");
1353
1354 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1355 ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n");
1356 return S_OK;
1357
1359 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1360
1361 ok(pdp != NULL, "pdp == NULL\n");
1362 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1363 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1364 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1365 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1366 ok(pvarRes != NULL, "pvarRes == NULL\n");
1367 ok(pei != NULL, "pei == NULL\n");
1368
1369 V_VT(pvarRes) = VT_DISPATCH;
1370 V_DISPATCH(pvarRes) = (IDispatch*)&testObj;
1371 return S_OK;
1372
1374 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1375
1376 ok(pdp != NULL, "pdp == NULL\n");
1377 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1378 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1379 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1380 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1381 ok(pvarRes != NULL, "pvarRes == NULL\n");
1382 ok(pei != NULL, "pei == NULL\n");
1383
1384 V_VT(pvarRes) = VT_DISPATCH;
1385 V_DISPATCH(pvarRes) = (IDispatch*)&collectionObj;
1386 return S_OK;
1387
1389 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1390
1391 ok(pdp != NULL, "pdp == NULL\n");
1392 ok(!pdp->rgvarg, "rgvarg == NULL\n");
1393 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1394 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1395 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1396 ok(pvarRes != NULL, "pvarRes == NULL\n");
1397 ok(pei != NULL, "pei == NULL\n");
1398
1399 IDispatchEx_AddRef(&RefObj);
1400 V_VT(pvarRes) = VT_DISPATCH;
1401 V_DISPATCH(pvarRes) = (IDispatch*)&RefObj;
1402 return S_OK;
1403
1405 VARIANT *v;
1406
1407 ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1408 ok(pdp != NULL, "pdp == NULL\n");
1409 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1410 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1411 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1412 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1413 ok(pvarRes != NULL, "pvarRes == NULL\n");
1414 ok(pei != NULL, "pei == NULL\n");
1415
1416 v = pdp->rgvarg;
1417 if(V_VT(v) == (VT_VARIANT|VT_BYREF))
1418 v = V_VARIANTREF(v);
1419
1420 ok(V_VT(v) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1421 V_VT(pvarRes) = VT_BOOL;
1422 V_BOOL(pvarRes) = V_DISPATCH(v) ? VARIANT_FALSE : VARIANT_TRUE;
1423 return S_OK;
1424 }
1425
1427 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1428 ok(pdp != NULL, "pdp == NULL\n");
1429 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1430 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1431 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1432 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1433 ok(!pvarRes, "pvarRes != NULL\n");
1434 ok(pei != NULL, "pei == NULL\n");
1435
1436 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1437 test_disp(V_DISPATCH(pdp->rgvarg));
1438 return S_OK;
1439
1441 CHECK_EXPECT(global_propargput_i);
1442
1443 ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1444 ok(pdp != NULL, "pdp == NULL\n");
1445 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1446 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1447 ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1448 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1449 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1450 ok(!pvarRes, "pvarRes != NULL\n");
1451 ok(pei != NULL, "pei == NULL\n");
1452
1453 ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1454 ok(V_I2(pdp->rgvarg) == 0, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1455
1456 ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1457 ok(V_I2(pdp->rgvarg+1) == 2, "V_I2(psp->rgvargs+1) = %d\n", V_I2(pdp->rgvarg+1));
1458
1459 ok(V_VT(pdp->rgvarg+2) == VT_I2, "V_VT(psp->rgvargs+2) = %d\n", V_VT(pdp->rgvarg+2));
1460 ok(V_I2(pdp->rgvarg+2) == 1, "V_I2(psp->rgvargs+2) = %d\n", V_I2(pdp->rgvarg+2));
1461 return S_OK;
1462
1464 CHECK_EXPECT(global_propargput1_i);
1465
1466 ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1467 ok(pdp != NULL, "pdp == NULL\n");
1468 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1469 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1470 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1471 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1472 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1473 ok(!pvarRes, "pvarRes != NULL\n");
1474 ok(pei != NULL, "pei == NULL\n");
1475
1476 ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1477 ok(V_I2(pdp->rgvarg) == 0, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1478
1479 ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1480 ok(V_I2(pdp->rgvarg+1) == 1, "V_I2(psp->rgvargs+1) = %d\n", V_I2(pdp->rgvarg+1));
1481
1482 return S_OK;
1483
1485 ok(pdp != NULL, "pdp == NULL\n");
1486 todo_wine ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1487 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1488 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1489 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1490 ok(pvarRes != NULL, "pvarRes == NULL\n");
1491 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1492 ok(pei != NULL, "pei == NULL\n");
1493
1494 V_VT(pvarRes) = VT_I2;
1495 V_I2(pvarRes) = test_counter++;
1496 return S_OK;
1497
1499 ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1500 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1501 ok(V_VT(pdp->rgvarg) == VT_R8, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1502 ok(pvarRes != NULL, "pvarRes == NULL\n");
1503
1504 V_VT(pvarRes) = VT_BSTR;
1505 return VarBstrFromR8(V_R8(pdp->rgvarg), 0, 0, &V_BSTR(pvarRes));
1506
1508 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1509 ok(pdp != NULL, "pdp == NULL\n");
1510 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1511 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1512 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1513 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1514 ok(!pvarRes, "pvarRes != NULL\n");
1515 ok(pei != NULL, "pei == NULL\n");
1516
1517 ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1518 ok(V_VT(pdp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1519 ok(V_VT(V_VARIANTREF(pdp->rgvarg)) == (VT_ARRAY|VT_BYREF|VT_VARIANT),
1520 "V_VT(V_VARIANTREF(psp->rgvargs)) = %d\n", V_VT(V_VARIANTREF(pdp->rgvarg)));
1521 if(V_I2(pdp->rgvarg+1) == -1)
1522 ok(!*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)), "*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)) != NULL\n");
1523 else
1524 test_safearray(*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)), V_I2(pdp->rgvarg+1));
1525 return S_OK;
1526
1528 VARIANT *v = pdp->rgvarg;
1529 HRESULT hres;
1530
1531 ok((wFlags & ~INVOKE_PROPERTYGET) == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1532 ok(pdp != NULL, "pdp == NULL\n");
1533 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1534 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1535 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1536 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1537 ok(pei != NULL, "pei == NULL\n");
1538 if(pvarRes) {
1539 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1540 V_VT(pvarRes) = VT_BOOL;
1541 V_BOOL(pvarRes) = VARIANT_FALSE;
1542 }
1543
1544 if(V_VT(v) == (VT_VARIANT|VT_BYREF))
1545 v = V_VARIANTREF(v);
1546
1547 switch(V_VT(v)) {
1548 case VT_I2:
1549 hres = V_I2(v);
1550 break;
1551 case VT_I4:
1552 hres = V_I4(v);
1553 break;
1554 default:
1555 ok(0, "unexpected vt %d\n", V_VT(v));
1556 return E_INVALIDARG;
1557 }
1558
1559 return hres;
1560 }
1561
1563 VARIANT *v;
1564 int opt;
1565
1566 CHECK_EXPECT(global_testoptionalarg_i);
1567
1568 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1569 ok(pdp != NULL, "pdp == NULL\n");
1570 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1571 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1572 ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1573 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1574 ok(!pvarRes, "pvarRes != NULL\n");
1575 ok(pei != NULL, "pei == NULL\n");
1576
1577 ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1578 opt = V_I2(pdp->rgvarg);
1579 ok(opt == 1 || opt == 2, "opt = %d\n", opt);
1580 v = pdp->rgvarg+pdp->cArgs-opt;
1581 ok(V_VT(v) == VT_ERROR, "V_VT(v) = %d\n", V_VT(v));
1582 ok(V_ERROR(v) == DISP_E_PARAMNOTFOUND, "V_ERROR(v) = %08x\n", V_ERROR(v));
1583 return S_OK;
1584 }
1586 DISPPARAMS dp = {0};
1587 IDispatchEx *dispex;
1588 EXCEPINFO ei;
1589 VARIANT v;
1590 DISPID id;
1591 BSTR str;
1592 HRESULT hres;
1593
1594 CHECK_EXPECT(global_globalcallback_i);
1595 CHECK_CALLED(OnEnterScript);
1596
1597 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1598 ok(pdp != NULL, "pdp == NULL\n");
1599 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1600 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1601 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1602 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1603 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1604 ok(!pvarRes, "pvarRes != NULL\n");
1605 ok(pei != NULL, "pei == NULL\n");
1606
1607 hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&dispex);
1608 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1609
1610 str = SysAllocString(L"callback");
1611 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
1612 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
1614
1615 SET_EXPECT(OnEnterScript);
1616 SET_EXPECT(OnLeaveScript);
1617 memset(&ei, 0, sizeof(ei));
1618 hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_METHOD, &dp, &v, &ei, pspCaller);
1619 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1620 CHECK_CALLED(OnEnterScript);
1621 CHECK_CALLED(OnLeaveScript);
1622 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
1623 ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
1624
1625 IDispatchEx_Release(dispex);
1626
1627 SET_EXPECT(OnLeaveScript);
1628 return S_OK;
1629 }
1632 IDispatchEx *dispex;
1633 DISPPARAMS dp;
1634 VARIANT v, r;
1635 EXCEPINFO ei;
1636 IDispatch *disp;
1637 WCHAR *names[1];
1638 UINT count, i;
1639 DISPID id;
1640 HRESULT hres;
1641
1642 static WCHAR props[][32] = { L"clear", L"description", L"helpcontext", L"helpFILE", L"number", L"raise", L"source" };
1643
1644 CHECK_EXPECT(global_testerrorobject_i);
1645
1646 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1647 ok(pdp != NULL, "pdp == NULL\n");
1648 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1649 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1650 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1651 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1652 ok(!pvarRes, "pvarRes != NULL\n");
1653 ok(pei != NULL, "pei == NULL\n");
1654
1655 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1656 disp = V_DISPATCH(pdp->rgvarg);
1657 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1658 ok(hres == E_NOINTERFACE, "Could not get IDispatchEx iface: %08x\n", hres);
1659
1660 hres = IDispatch_GetTypeInfoCount(disp, &count);
1661 ok(hres == S_OK, "GetTypeInfoCount returned: %08x\n", hres);
1662 ok(count == 0, "count = %u\n", count);
1663
1664 hres = IDispatch_GetTypeInfo(disp, 0, 0, &typeinfo);
1665 ok(hres == DISP_E_BADINDEX, "GetTypeInfo returned: %08x\n", hres);
1666
1667 for(i = 0; i < ARRAY_SIZE(props); i++) {
1668 names[0] = props[i];
1669 hres = IDispatch_GetIDsOfNames(disp, &IID_NULL, names, 1, 0, &id);
1670 ok(hres == S_OK, "GetIDsOfNames failed: %08x\n", hres);
1671 ok(id == i + 1, "%s id = %u\n", wine_dbgstr_w(props[i]), id);
1672 }
1673
1674 memset(&dp, 0, sizeof(dp));
1675 memset(&ei, 0, sizeof(ei));
1676 V_VT(&v) = VT_ERROR;
1677 hres = IDispatch_Invoke(disp, 5, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
1678 ok(hres == S_OK, "Invoke failed: %08x\n", hres);
1679 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
1680 ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v));
1681 hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
1682 ok(hres == S_OK, "Invoke failed: %08x\n", hres);
1683 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
1684 ok(V_I4(&v) == 1, "V_I4(v) = %d\n", V_I4(&v));
1685
1686 dp.rgvarg = &v;
1687 V_VT(&v) = VT_I4;
1688 V_I4(&v) = 6;
1689 V_VT(&r) = VT_EMPTY;
1690 hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 6, DISPATCH_METHOD|DISPATCH_PROPERTYGET, &dp, &r, &ei, NULL);
1691 ok(hres == S_OK, "Invoke failed: %08x\n", hres);
1692 return S_OK;
1693 }
1694 }
1695
1696 ok(0, "unexpected call %d\n", id);
1697 return DISP_E_MEMBERNOTFOUND;
1698}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define E_INVALIDARG
Definition: ddrawi.h:101
@ VT_BSTR
Definition: compat.h:2303
@ VT_BYREF
Definition: compat.h:2342
@ VT_ERROR
Definition: compat.h:2305
@ VT_ARRAY
Definition: compat.h:2341
@ VT_R8
Definition: compat.h:2300
@ VT_VARIANT
Definition: compat.h:2307
@ VT_I4
Definition: compat.h:2298
@ VT_BOOL
Definition: compat.h:2306
@ VT_DISPATCH
Definition: compat.h:2304
HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6587
#define test_disp(u, id, v)
Definition: dom.c:662
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint * names
Definition: glext.h:11545
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint id
Definition: glext.h:5910
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define b
Definition: ke_i.h:79
#define SET_EXPECT(func)
Definition: run.c:58
#define CHECK_CALLED(func)
Definition: run.c:73
static const char * test_name
Definition: run.c:177
static IDispatchEx testObj
Definition: run.c:595
#define todo_wine_if(is_todo)
Definition: custom.c:86
#define todo_wine
Definition: custom.c:89
static void test_safearray(void)
Definition: safearray.c:380
static VARIANTARG static DISPID
Definition: ordinal.c:52
static int test_counter
Definition: run.c:158
static IDispatchEx RefObj
Definition: run.c:1067
static const char * vt2a(VARIANT *v)
Definition: run.c:190
static IDispatchEx collectionObj
Definition: run.c:1035
struct stdole::DISPPARAMS DISPPARAMS
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define V_ERROR(A)
Definition: oleauto.h:241
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_ARRAYREF(A)
Definition: oleauto.h:223
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_BYREF(A)
Definition: oleauto.h:228
#define V_I4(A)
Definition: oleauto.h:247
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define V_R8(A)
Definition: oleauto.h:262
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009
#define IID_NULL
Definition: guiddef.h:98
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR props[]
Definition: wbemdisp.c:288
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISP_E_BADINDEX
Definition: winerror.h:2520

◆ Global_Release()

static ULONG WINAPI Global_Release ( IDispatchEx iface)
static

Definition at line 1076 of file run.c.

1077{
1078 return --global_ref;
1079}

◆ parse_procedure()

static IDispatchEx * parse_procedure ( IActiveScriptParseProcedure2 *  parse_proc,
const char src,
DWORD  flags 
)
static

Definition at line 2127 of file run.c.

2128{
2129 IDispatchEx *dispex;
2130 IDispatch *disp;
2131 BSTR str;
2132 HRESULT hres;
2133
2134 static const WCHAR delimiterW[] = {'\"',0};
2135
2136 str = a2bstr(src);
2137 hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, str, NULL, emptyW, NULL, NULL, delimiterW, 0, 0,
2138 SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS|flags, &disp);
2140 ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
2141 ok(disp != NULL, "disp = NULL\n");
2142
2143 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
2144 IDispatch_Release(disp);
2145 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2146
2147 return dispex;
2148}
#define IActiveScriptParseProcedure2_ParseProcedureText
Definition: run.c:46
static const WCHAR emptyW[]
Definition: run.c:174

Referenced by test_procedures().

◆ parse_script()

static HRESULT parse_script ( DWORD  flags,
BSTR  script_str,
const WCHAR delim 
)
static

Definition at line 1988 of file run.c.

1989{
1990 IActiveScriptParse *parser;
1991 IActiveScript *engine;
1993 LONG ref;
1994 HRESULT hres;
1995
1997 if(!engine)
1998 return S_OK;
1999
2000 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2001 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2002 if (FAILED(hres))
2003 {
2004 IActiveScript_Release(engine);
2005 return hres;
2006 }
2007
2008 hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
2009 ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
2010 ok(script_disp != NULL, "script_disp == NULL\n");
2011 ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
2012
2013 test_counter = 0;
2014
2015 hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, delim, 0, 0, 0, NULL, NULL);
2016
2017 IActiveScript_Close(engine);
2018
2019 IDispatch_Release(script_disp);
2020 IActiveScript_Release(engine);
2021
2023 ok(!ref, "ref=%d\n", ref);
2024 return hres;
2025}
#define FAILED(hr)
Definition: intsafe.h:51
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
static IDispatch * script_disp
Definition: run.c:178
static IActiveScript * create_and_init_script(DWORD flags, BOOL start)
Definition: run.c:1942
long LONG
Definition: pedump.c:60

◆ parse_script_a()

static void parse_script_a ( const char src)
static

Definition at line 2108 of file run.c.

2109{
2110 parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src);
2111}
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:2094

◆ parse_script_af()

static void parse_script_af ( DWORD  flags,
const char src 
)
static

Definition at line 2027 of file run.c.

2028{
2029 BSTR tmp;
2030 HRESULT hres;
2031
2032 tmp = a2bstr(src);
2033 hres = parse_script(flags, tmp, NULL);
2034 SysFreeString(tmp);
2035 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2036}

◆ parse_script_ar()

static HRESULT parse_script_ar ( const char src)
static

Definition at line 2038 of file run.c.

2039{
2040 BSTR tmp;
2041 HRESULT hres;
2042
2043 tmp = a2bstr(src);
2044 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp, NULL);
2045 SysFreeString(tmp);
2046 return hres;
2047}

Referenced by run_tests(), test_msgbox(), and test_parse_errors().

◆ RefObj_AddRef()

static ULONG WINAPI RefObj_AddRef ( IDispatchEx iface)
static

Definition at line 1039 of file run.c.

1040{
1041 return ++refobj_ref;
1042}
static ULONG refobj_ref
Definition: run.c:1037

◆ RefObj_Release()

static ULONG WINAPI RefObj_Release ( IDispatchEx iface)
static

Definition at line 1044 of file run.c.

1045{
1046 return --refobj_ref;
1047}

◆ run_from_file()

static void run_from_file ( const char filename)
static

Definition at line 2763 of file run.c.

2764{
2765 BSTR script_str;
2766 HRESULT hres;
2767
2768 script_str = get_script_from_file(filename);
2769 if(!script_str)
2770 return;
2771
2773 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str, NULL);
2774 SysFreeString(script_str);
2775 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2776}
static BSTR get_script_from_file(const char *filename)
Definition: run.c:2148

◆ run_from_res()

static void run_from_res ( const char name)
static

Definition at line 2778 of file run.c.

2779{
2780 const char *data;
2781 DWORD size, len;
2782 BSTR str;
2783 HRSRC src;
2784 HRESULT hres;
2785
2787 test_name = name;
2788
2789 src = FindResourceA(NULL, name, (LPCSTR)40);
2790 ok(src != NULL, "Could not find resource %s\n", name);
2791
2794
2798
2799 SET_EXPECT(global_success_d);
2800 SET_EXPECT(global_success_i);
2801 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, str, NULL);
2802 CHECK_CALLED(global_success_d);
2803 CHECK_CALLED(global_success_i);
2804
2805 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2807 test_name = "";
2808}
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
Definition: name.c:39
const char * LPCSTR
Definition: xmlstorage.h:183

◆ run_tests()

static void run_tests ( void  )
static

Definition at line 2810 of file run.c.

2811{
2812 HRESULT hres;
2813
2815
2816 parse_script_a("");
2817 parse_script_a("' empty ;");
2818
2819 SET_EXPECT(global_success_d);
2820 SET_EXPECT(global_success_i);
2821 parse_script_a("reportSuccess");
2822 CHECK_CALLED(global_success_d);
2823 CHECK_CALLED(global_success_i);
2824
2825 SET_EXPECT(global_success_d);
2826 SET_EXPECT(global_success_i);
2827 parse_script_a("reportSuccess()");
2828 CHECK_CALLED(global_success_d);
2829 CHECK_CALLED(global_success_i);
2830
2831 SET_EXPECT(global_success_d);
2832 SET_EXPECT(global_success_i);
2833 parse_script_a("Call reportSuccess");
2834 CHECK_CALLED(global_success_d);
2835 CHECK_CALLED(global_success_i);
2836
2837 SET_EXPECT(global_success_d);
2838 SET_EXPECT(global_success_i);
2839 parse_script_a("test.reportSuccess()");
2840 CHECK_CALLED(global_success_d);
2841 CHECK_CALLED(global_success_i);
2842
2843 SET_EXPECT(global_success_d);
2844 SET_EXPECT(global_success_i);
2845 parse_script_af(0, "TEST.reportSuccess()");
2846 CHECK_CALLED(global_success_d);
2847 CHECK_CALLED(global_success_i);
2848
2849 SET_EXPECT(global_vbvar_d);
2850 SET_EXPECT(global_vbvar_i);
2851 parse_script_a("Option Explicit\nvbvar = 3");
2852 CHECK_CALLED(global_vbvar_d);
2853 CHECK_CALLED(global_vbvar_i);
2854
2855 SET_EXPECT(global_vbvar_d);
2856 SET_EXPECT(global_vbvar_i);
2857 parse_script_a("Option Explicit\nvbvar() = 3");
2858 CHECK_CALLED(global_vbvar_d);
2859 CHECK_CALLED(global_vbvar_i);
2860
2861 SET_EXPECT(global_letobj_i);
2862 parse_script_a("Option Explicit\nletobj = testObj");
2863 CHECK_CALLED(global_letobj_i);
2864
2865 SET_EXPECT(global_letobj_i);
2866 parse_script_a("Option Explicit\ntest.letobj = testObj");
2867 CHECK_CALLED(global_letobj_i);
2868
2869 SET_EXPECT(global_setobj_i);
2870 parse_script_a("Option Explicit\nset setobj = testObj");
2871 CHECK_CALLED(global_setobj_i);
2872
2873 SET_EXPECT(global_setobj_i);
2874 parse_script_a("Option Explicit\nset test.setobj = testObj");
2875 CHECK_CALLED(global_setobj_i);
2876
2877 SET_EXPECT(OnScriptError);
2878 hres = parse_script_ar("dim x\nx = testObj.rem");
2879 todo_wine
2880 ok(hres == S_OK, "use of 'rem' as dot identifier failed: %x08\n", hres);
2881 todo_wine
2882 CHECK_NOT_CALLED(OnScriptError);
2883
2884 SET_EXPECT(testobj_propget_d);
2885 SET_EXPECT(testobj_propget_i);
2886 parse_script_a("dim x\nx = testObj.propget");
2887 CHECK_CALLED(testobj_propget_d);
2888 CHECK_CALLED(testobj_propget_i);
2889
2890 SET_EXPECT(testobj_propput_d);
2891 SET_EXPECT(testobj_propput_i);
2892 parse_script_a("testObj.propput = 1");
2893 CHECK_CALLED(testobj_propput_d);
2894 CHECK_CALLED(testobj_propput_i);
2895
2896 SET_EXPECT(global_propargput_d);
2897 SET_EXPECT(global_propargput_i);
2898 parse_script_a("propargput(counter(), counter()) = counter()");
2899 CHECK_CALLED(global_propargput_d);
2900 CHECK_CALLED(global_propargput_i);
2901
2902 SET_EXPECT(global_propargput_d);
2903 SET_EXPECT(global_propargput_i);
2904 parse_script_a("test.propargput(counter(), counter()) = counter()");
2905 CHECK_CALLED(global_propargput_d);
2906 CHECK_CALLED(global_propargput_i);
2907
2908 SET_EXPECT(global_propargput1_d);
2909 SET_EXPECT(global_propargput1_i);
2910 parse_script_a("propargput1 (counter()) = counter()");
2911 CHECK_CALLED(global_propargput1_d);
2912 CHECK_CALLED(global_propargput1_i);
2913
2914 SET_EXPECT(global_propargput1_d);
2915 SET_EXPECT(global_propargput1_i);
2916 parse_script_a("test.propargput1(counter()) = counter()");
2917 CHECK_CALLED(global_propargput1_d);
2918 CHECK_CALLED(global_propargput1_i);
2919
2920 parse_htmlscript_a("<!--");
2921 parse_htmlscript_a(" -->");
2922 parse_htmlscript_a("<!--\ndim x\nx=1\n-->\n");
2923 parse_htmlscript_a("<!--\ndim x\n-->\n<!--\nx=1\n-->\n");
2924
2925 SET_EXPECT(OnScriptError);
2926 hres = parse_script_ar("<!--");
2927 ok(FAILED(hres), "script didn't fail\n");
2928 CHECK_CALLED(OnScriptError);
2929
2930 SET_EXPECT(global_success_d);
2931 SET_EXPECT(global_success_i);
2932 parse_htmlscript_a("<!--\n<!-- ignore this <> <>\n--> <>\nCall reportSuccess()\n-->\n");
2933 CHECK_CALLED(global_success_d);
2934 CHECK_CALLED(global_success_i);
2935
2936 next_cnt = 0;
2937 SET_EXPECT(collectionobj_newenum_i);
2938 SET_EXPECT(Next);
2939 parse_script_a("for each x in collectionObj\nnext");
2940 CHECK_CALLED(collectionobj_newenum_i);
2941 CHECK_CALLED(Next);
2942 ok(next_cnt == 4, "next_cnt = %d\n", next_cnt);
2943
2944 parse_script_a("x = 1\n Call ok(x = 1, \"x = \" & x)");
2945
2946 parse_script_a("x = _ \n3");
2947
2950
2951 SET_EXPECT(OnScriptError);
2952 hres = parse_script_ar("throwInt(&h80080008&)");
2953 ok(hres == 0x80080008, "hres = %08x\n", hres);
2954 CHECK_CALLED(OnScriptError);
2955
2956 /* DISP_E_BADINDEX */
2957 SET_EXPECT(OnScriptError);
2958 hres = parse_script_ar("throwInt(&h8002000b&)");
2959 ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres);
2960 CHECK_CALLED(OnScriptError);
2961
2962 SET_EXPECT(OnScriptError);
2963 hres = parse_script_ar("throwInt(&h800a0009&)");
2964 ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres);
2965 CHECK_CALLED(OnScriptError);
2966
2968 SET_EXPECT(OnScriptError);
2969 hres = parse_script_ar("throwInt(&h800a0009&)");
2970 ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres);
2971 CHECK_CALLED(OnScriptError);
2972
2973 /* E_NOTIMPL */
2974 SET_EXPECT(OnScriptError);
2975 hres = parse_script_ar("throwInt(&h80004001&)");
2976 ok(hres == MAKE_VBSERROR(445), "hres = %08x\n", hres);
2977 CHECK_CALLED(OnScriptError);
2978
2980 SET_EXPECT(OnScriptError);
2981 hres = parse_script_ar("throwInt(&h80004001&)");
2982 ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres);
2983 CHECK_CALLED(OnScriptError);
2984
2985 SET_EXPECT(global_testoptionalarg_i);
2986 parse_script_a("call testOptionalArg(1,,2)");
2987 CHECK_CALLED(global_testoptionalarg_i);
2988
2989 SET_EXPECT(global_testoptionalarg_i);
2990 parse_script_a("call testOptionalArg(,1,1)");
2991 CHECK_CALLED(global_testoptionalarg_i);
2992
2993 SET_EXPECT(global_testoptionalarg_i);
2994 parse_script_a("testOptionalArg 1,,2");
2995 CHECK_CALLED(global_testoptionalarg_i);
2996
2998
2999 SET_EXPECT(testobj_value_i);
3000 parse_script_a("dim n,o\n set o = testObj\n n = o(1,2)\n call ok(n=2, \"n = \" & n)\n");
3001 CHECK_CALLED(testobj_value_i);
3002
3003 SET_EXPECT(testobj_value_i);
3004 parse_script_a("dim n,o\n set o = testObj\n n = o\n call ok(n=0, \"n = \" & n)\n");
3005 CHECK_CALLED(testobj_value_i);
3006
3007 parse_script_a("Sub testsub\n"
3008 "x = 1\n"
3009 "Call ok(x = 1, \"x = \" & x)\n"
3010 "End Sub\n"
3011 "Call testsub()");
3012
3013 parse_script_a("Call ok(getVT(x) = \"VT_EMPTY*\", \"getVT(x) = \" & getVT(x))\n");
3014 parse_script_a("Call ok(x = \"\", \"x = \" & x)\n");
3015 parse_script_a("x = y\n"
3016 "Call ok(getVT(x) = \"VT_EMPTY*\", \"getVT(x) = \" & getVT(x))\n"
3017 "Call ok(getVT(y) = \"VT_EMPTY*\", \"getVT(y) = \" & getVT(y))");
3018 SET_EXPECT(OnScriptError);
3019 hres = parse_script_ar("x = y(\"a\")");
3020 ok(FAILED(hres), "script didn't fail\n");
3021 CHECK_CALLED(OnScriptError);
3022
3023 SET_EXPECT(global_success_d);
3024 SET_EXPECT(global_success_i);
3025 parse_script_a("' comment\r"
3026 "x = _\r3\r"
3027 "x = _\n3\r"
3028 "x = _\r\n3\r"
3029 "Sub testsub(arg)\r"
3030 "If arg = 1 Then\r\r"
3031 "Call reportSuccess()\n\n"
3032 "End If\r\n"
3033 "End Sub\n\r"
3034 "Call testsub(1)");
3035 CHECK_CALLED(global_success_d);
3036 CHECK_CALLED(global_success_i);
3037
3038 run_from_res("lang.vbs");
3039 run_from_res("api.vbs");
3040 run_from_res("regexp.vbs");
3041 run_from_res("error.vbs");
3042
3044 test_gc();
3045 test_msgbox();
3050}
#define parse_script_a(p, s)
Definition: activex.c:704
static void run_from_res(const char *name)
Definition: run.c:2224
static void test_parse_errors(void)
Definition: run.c:2428
static HRESULT test_global_vars_ref(BOOL use_close)
Definition: run.c:2533
#define parse_htmlscript_a(a)
Definition: run.c:2113
static void test_procedures(void)
Definition: run.c:2151
static void test_gc(void)
Definition: run.c:2373
static void test_isexpression(void)
Definition: run.c:2590
static void test_callbacks(void)
Definition: run.c:2210
static HRESULT parse_script_ar(const char *src)
Definition: run.c:2038
#define MAKE_VBSERROR(code)
Definition: run.c:150
#define CHECK_NOT_CALLED(func)
Definition: run.c:82
static void test_parse_context(void)
Definition: run.c:2049
static void test_msgbox(void)
Definition: run.c:2484

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 257 of file run.c.

258{
259 return 2;
260}

◆ ServiceProvider_QueryInterface()

static HRESULT WINAPI ServiceProvider_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 251 of file run.c.

252{
253 ok(0, "unexpected call\n");
254 return E_NOINTERFACE;
255}

◆ ServiceProvider_QueryService()

static HRESULT WINAPI ServiceProvider_QueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 267 of file run.c.

269{
270 ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
271 return E_NOINTERFACE;
272}

◆ ServiceProvider_Release()

static ULONG WINAPI ServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 262 of file run.c.

263{
264 return 1;
265}

◆ START_TEST()

START_TEST ( run  )

Definition at line 3073 of file run.c.

3074{
3075 int argc;
3076 char **argv;
3077
3078 detect_locale();
3079 if(!is_english)
3080 skip("Skipping some tests in non-English locale\n");
3081
3083
3085
3086 if(!check_vbscript()) {
3087 win_skip("Broken engine, probably too old\n");
3088 }else if(argc > 2) {
3089 allow_ui = TRUE;
3091 run_from_file(argv[2]);
3092 }else {
3093 run_tests();
3094 }
3095
3097}
static int argc
Definition: ServiceArgs.c:12
@ SCRIPTUICHANDLING_ALLOW
Definition: activscp.idl:76
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static BOOL run_tests(void)
Definition: run.c:2756
static void run_from_file(const char *filename)
Definition: run.c:2186
static BOOL check_vbscript(void)
Definition: run.c:3052
static void detect_locale(void)
Definition: run.c:237
#define argv
Definition: mplay32.c:18
#define win_skip
Definition: test.h:163
int winetest_get_mainargs(char ***pargv)

◆ strcmp_wa()

static int strcmp_wa ( LPCWSTR  strw,
const char stra 
)
static

Definition at line 176 of file run.c.

177{
178 CHAR buf[512];
179 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0);
180 return lstrcmpA(buf, stra);
181}
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4195
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
char CHAR
Definition: xmlstorage.h:175

◆ stricmp_wa()

static int stricmp_wa ( LPCWSTR  strw,
const char stra 
)
static

Definition at line 183 of file run.c.

184{
185 CHAR buf[512];
186 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0);
187 return lstrcmpiA(buf, stra);
188}
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4224

Referenced by testObj_GetDispID().

◆ test_callbacks()

static void test_callbacks ( void  )
static

Definition at line 2210 of file run.c.

2211{
2213 IActiveScriptParse *parser;
2214 DISPPARAMS dp = {NULL};
2216 IDispatchEx *dispex;
2217 IDispatch *disp;
2218 DISPID id;
2219 EXCEPINFO ei = {0};
2220 BSTR str;
2221 VARIANT v;
2222 HRESULT hres;
2223
2225 script = create_and_init_script(SCRIPTITEM_GLOBALMEMBERS, TRUE);
2226
2227 hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
2228 ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2 iface: %08x\n", hres);
2229
2230 SET_EXPECT(OnEnterScript);
2231 SET_EXPECT(OnLeaveScript);
2233 L"class CallbackClass\n"
2234 L" public function callback()\n"
2235 L" call ok(err.number = 2, \"err.number = \" & err.number)\n"
2236 L" callback = true\n"
2237 L" end function\n"
2238 L"end class\n"
2239 L"function callGlobalCallback()\n"
2240 L" on error resume next\n"
2241 L" err.raise 2\n"
2242 L" call test.globalCallback(new CallbackClass)\n"
2243 L" call ok(err.number = 2, \"err.number = \" & err.numner)\n"
2244 L"end function\n",
2245 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2246 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2247 CHECK_CALLED(OnEnterScript);
2248 CHECK_CALLED(OnLeaveScript);
2249
2250 hres = IActiveScript_GetScriptDispatch(script, NULL, &disp);
2251 ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
2252
2253 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
2254 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2255 IDispatch_Release(disp);
2256
2257 str = SysAllocString(L"callGlobalCallback");
2258 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
2259 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
2261
2262 SET_EXPECT(OnEnterScript);
2263 /* OnLeaveScript will be set in global callback */
2264 SET_EXPECT(global_globalcallback_i);
2265 hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp);
2266 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2267 /* OnEnterScript was checked in global callback */
2268 CHECK_CALLED(OnLeaveScript);
2269 CHECK_CALLED(global_globalcallback_i);
2270
2272
2273 SET_EXPECT(OnEnterScript);
2274 SET_EXPECT(OnLeaveScript);
2275 SET_EXPECT(OnScriptError);
2277 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2278 ok(hres == MAKE_VBSERROR(2), "ParseScriptText failed: %08x\n", hres);
2279 CHECK_CALLED(OnEnterScript);
2280 CHECK_CALLED(OnLeaveScript);
2281 CHECK_CALLED(OnScriptError);
2282
2284
2285 SET_EXPECT(OnEnterScript);
2286 SET_EXPECT(OnLeaveScript);
2287 SET_EXPECT(OnScriptError);
2289 L"call ok(err.number = 0, \"err.number = \" & err.number)\n"
2290 L"err.raise &h86664004&, \"src\", \"desc\", \"help\", 1\n",
2291 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2292 ok(hres == SCRIPT_E_RECORDED, "ParseScriptText failed: %08x\n", hres);
2293 CHECK_CALLED(OnEnterScript);
2294 CHECK_CALLED(OnLeaveScript);
2295 CHECK_CALLED(OnScriptError);
2296
2297 memset(&ei, 0xcc, sizeof(ei));
2298 hres = IActiveScriptError_GetExceptionInfo(error1, &ei);
2299 ok(hres == S_OK, "GetExceptionInfo returned %08x\n", hres);
2300 ok(!ei.wCode, "wCode = %x\n", ei.wCode);
2301 ok(!ei.wReserved, "wReserved = %x\n", ei.wReserved);
2302 if(is_english) {
2303 ok(!wcscmp(ei.bstrSource, L"Microsoft VBScript runtime error"),
2304 "bstrSource = %s\n", wine_dbgstr_w(ei.bstrSource));
2305 ok(!wcscmp(ei.bstrDescription, L"Object doesn't support this property or method"),
2306 "bstrDescription = %s\n", wine_dbgstr_w(ei.bstrDescription));
2307 }
2308 ok(!ei.bstrHelpFile, "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile));
2309 ok(!ei.dwHelpContext, "dwHelpContext = %x\n", ei.dwHelpContext);
2310 ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved);
2311 ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn);
2312 ok(ei.scode == MAKE_VBSERROR(2), "scode = %x\n", ei.scode);
2313 free_ei(&ei);
2314
2315 IActiveScriptError_Release(error1);
2316
2317 memset(&ei, 0xcc, sizeof(ei));
2318 hres = IActiveScriptError_GetExceptionInfo(error2, &ei);
2319 ok(hres == S_OK, "GetExceptionInfo returned %08x\n", hres);
2320 ok(!ei.wCode, "wCode = %x\n", ei.wCode);
2321 ok(!ei.wReserved, "wReserved = %x\n", ei.wReserved);
2322 ok(!wcscmp(ei.bstrSource, L"src"), "bstrSource = %s\n", wine_dbgstr_w(ei.bstrSource));
2323 ok(!wcscmp(ei.bstrDescription, L"desc"), "bstrDescription = %s\n", wine_dbgstr_w(ei.bstrDescription));
2324 ok(!wcscmp(ei.bstrHelpFile, L"help"), "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile));
2325 ok(ei.dwHelpContext == 1, "dwHelpContext = %x\n", ei.dwHelpContext);
2326 ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved);
2327 ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn);
2328 ok(ei.scode == SCRIPT_E_RECORDED, "scode = %x\n", ei.scode);
2329 free_ei(&ei);
2330
2331 IActiveScriptError_Release(error2);
2332
2333 SET_EXPECT(OnEnterScript);
2334 SET_EXPECT(OnLeaveScript);
2335 SET_EXPECT(OnScriptError);
2336 hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise &hffff&\n",
2337 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2338 ok(hres == MAKE_VBSERROR(0xffff), "ParseScriptText failed: %08x\n", hres);
2339 CHECK_CALLED(OnEnterScript);
2340 CHECK_CALLED(OnLeaveScript);
2341 CHECK_CALLED(OnScriptError);
2342
2343 SET_EXPECT(OnEnterScript);
2344 SET_EXPECT(OnLeaveScript);
2345 SET_EXPECT(OnScriptError);
2346 hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise &h80102030&\n",
2347 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2348 ok(hres == 0x80102030, "ParseScriptText failed: %08x\n", hres);
2349 CHECK_CALLED(OnEnterScript);
2350 CHECK_CALLED(OnLeaveScript);
2351 CHECK_CALLED(OnScriptError);
2352
2353 SET_EXPECT(OnEnterScript);
2354 SET_EXPECT(global_testerrorobject_i);
2355 SET_EXPECT(OnLeaveScript);
2357 L"on error resume next\n"
2358 L"err.raise 1\n"
2359 L"testErrorObject err\n",
2360 NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2361 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2362 CHECK_CALLED(OnEnterScript);
2363 CHECK_CALLED(global_testerrorobject_i);
2364 CHECK_CALLED(OnLeaveScript);
2365
2366 IDispatchEx_Release(dispex);
2367
2371}
static IServiceProvider caller_sp
Definition: run.c:281
static void free_ei(EXCEPINFO *ei)
Definition: run.c:2203
static void close_script(IActiveScript *script)
Definition: run.c:1976
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define error2(s, a, b)
Definition: debug.h:126
#define error1(s, a)
Definition: debug.h:125

Referenced by run_tests().

◆ test_disp()

static void test_disp ( IDispatch disp)
static

Definition at line 283 of file run.c.

284{
285 DISPID id, public_prop_id, public_prop2_id, public_func_id, public_sub_id, defvalget_id, gs_getter_id;
286 DISPID named_args[5] = {DISPID_PROPERTYPUT};
287 VARIANT v, args[5];
288 DISPPARAMS dp = {args, named_args};
289 IDispatchEx *dispex;
290 EXCEPINFO ei = {0};
291 BSTR str;
293
294 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
295 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
296
297 str = a2bstr("publicProp");
298 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_prop_id);
300 ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
301
302 str = a2bstr("PUBLICPROP");
303 hres = IDispatchEx_GetDispID(dispex, str, 0, &id);
305 ok(hres == S_OK, "GetDispID(PUBLICPROP) failed: %08x\n", hres);
306 ok(public_prop_id == id, "id = %d\n", public_prop_id);
307
308 str = a2bstr("publicPROP2");
309 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_prop2_id);
311 ok(hres == S_OK, "GetDispID(publicProp2) failed: %08x\n", hres);
312
313 str = a2bstr("defValGet");
314 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &defvalget_id);
316 ok(hres == S_OK, "GetDispID(defValGet) failed: %08x\n", hres);
317 ok(defvalget_id == DISPID_VALUE, "id = %d\n", defvalget_id);
318
319 str = a2bstr("privateProp");
320 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
322 ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
323 ok(id == -1, "id = %d\n", id);
324
325 str = a2bstr("class_initialize");
326 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
328 ok(hres == S_OK, "GetDispID(publicProp2) failed: %08x\n", hres);
329
330 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
331 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
332 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
333
334 V_VT(args) = VT_BOOL;
335 V_BOOL(args) = VARIANT_TRUE;
336 dp.cArgs = dp.cNamedArgs = 1;
337 V_VT(&v) = VT_BOOL;
338 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, &v, &ei, NULL);
339 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
340 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
341
342 dp.cArgs = dp.cNamedArgs = 0;
343 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
344 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
345 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
346 ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
347
348 dp.cArgs = dp.cNamedArgs = 0;
349 hres = IDispatchEx_Invoke(dispex, public_prop_id, &IID_NULL, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
350 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
351 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
352 ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
353
354 dp.cArgs = dp.cNamedArgs = 0;
355 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
356 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
357 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
358 ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
359
360 dp.cArgs = 1;
361 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
362 ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
363 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
364
365 SET_EXPECT(testobj_value_i);
368 dp.cArgs = dp.cNamedArgs = 1;
369 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
370 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
371 CHECK_CALLED(testobj_value_i);
372
373 dp.cArgs = dp.cNamedArgs = 0;
374 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
375 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
376 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
377 ok(V_I2(&v) == 0, "V_I2(v) = %d\n", V_I2(&v));
378
381 dp.cArgs = dp.cNamedArgs = 1;
382 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
383 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
384
387 dp.cArgs = dp.cNamedArgs = 1;
388 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
389 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
390
391 dp.cArgs = dp.cNamedArgs = 0;
392 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
393 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
394 ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
395 ok(V_DISPATCH(&v) == (IDispatch*)&testObj, "V_DISPATCH(v) != testObj\n");
396
397 V_VT(args) = VT_BOOL;
398 V_BOOL(args) = VARIANT_TRUE;
399 dp.cArgs = dp.cNamedArgs = 1;
400 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
401 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
402
403 dp.cArgs = dp.cNamedArgs = 0;
404 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
405 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
406 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
407 ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
408
409 V_VT(args) = VT_BOOL;
410 V_BOOL(args) = VARIANT_FALSE;
411 dp.cArgs = dp.cNamedArgs = 1;
412 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
413 ok(hres == DISP_E_EXCEPTION, "InvokeEx failed: %08x, expected DISP_E_EXCEPTION\n", hres);
414
415 V_VT(args) = VT_BOOL;
416 V_BOOL(args) = VARIANT_FALSE;
417 dp.cArgs = 1;
418 dp.cNamedArgs = 0;
419 V_VT(&v) = VT_BOOL;
420 hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
421 ok(hres == DISP_E_PARAMNOTOPTIONAL, "InvokeEx failed: %08x, expected DISP_E_PARAMNOTOPTIONAL\n", hres);
422
423 str = a2bstr("publicFunction");
424 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_func_id);
426 ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres);
427 ok(public_func_id != -1, "public_func_id = -1\n");
428
429 str = a2bstr("publicSub");
430 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_sub_id);
432 ok(hres == S_OK, "GetDispID(publicSub) failed: %08x\n", hres);
433 ok(public_sub_id != -1, "public_func_id = -1\n");
434
435 dp.cArgs = dp.cNamedArgs = 0;
436 hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
437 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
438 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
439 ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
440
441 dp.cArgs = dp.cNamedArgs = 0;
442 hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
443 ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
444 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
445
446 dp.cArgs = dp.cNamedArgs = 0;
447 hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
448 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
449 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
450 ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
451
452 dp.cArgs = dp.cNamedArgs = 0;
453 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
454 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
455 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
456
457 dp.cArgs = dp.cNamedArgs = 0;
458 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
459 ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
460 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
461
462 dp.cArgs = dp.cNamedArgs = 0;
463 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
464 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
465 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
466
467 V_VT(args) = VT_BOOL;
468 V_BOOL(args) = VARIANT_TRUE;
469 dp.cArgs = dp.cNamedArgs = 1;
470 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
471 ok(FAILED(hres), "InvokeEx succeeded: %08x\n", hres);
472
473 dp.cArgs = dp.cNamedArgs = 0;
474 hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
475 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
476 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
477 ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
478
479 dp.cArgs = dp.cNamedArgs = 0;
480 hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
481 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
482 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
483 ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
484
485 dp.cArgs = dp.cNamedArgs = 0;
486 hres = IDispatchEx_Invoke(dispex, public_func_id, &IID_NULL, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
487 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
488 ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
489 ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
490
491 dp.cArgs = dp.cNamedArgs = 0;
492 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
493 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
494 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
495
496 dp.cArgs = dp.cNamedArgs = 0;
497 hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
498 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
499 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
500
501 str = a2bstr("privateSub");
502 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
504 ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateSub) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
505 ok(id == -1, "id = %d\n", id);
506
507 str = a2bstr("dynprop");
508 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive|fdexNameEnsure, &id);
509 ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
510 ok(id == -1, "id = %d\n", id);
511 hres = IDispatchEx_GetDispID(dispex, str, fdexNameEnsure, &id);
512 ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
513 ok(id == -1, "id = %d\n", id);
515
516 str = a2bstr("publicProp");
517 hres = IDispatchEx_GetDispID(dispex, str, 0x80000000|fdexNameCaseInsensitive, &public_prop_id);
519 ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
520
521 id = 0xdeadbeef;
522 str = a2bstr("publicProp");
523 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
525 ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
526 ok(id == public_prop_id, "id = %d, expected %d\n", id, public_prop_id);
527
528 id = 0xdeadbeef;
529 str = a2bstr("publicprop");
530 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
532 ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
533 ok(id == public_prop_id, "id = %d, expected %d\n", id, public_prop_id);
534
535 str = a2bstr("gsGetProp");
536 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &gs_getter_id);
538 ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres);
539 ok(gs_getter_id != -1, "gs_getter_id = -1\n");
540
541 V_VT(args) = VT_BOOL;
542 V_BOOL(args) = VARIANT_TRUE;
543 dp.cNamedArgs = 0;
544 dp.cArgs = 1;
545 V_VT(&v) = VT_I8;
546 hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
547 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
548 ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
549
550 hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, NULL, &ei, NULL);
551 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
552
553 V_VT(args) = VT_BOOL;
554 V_BOOL(args) = VARIANT_FALSE;
555 dp.cArgs = 1;
556 V_VT(&v) = VT_I8;
557 hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
558 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
559 ok(V_VT(&v) == VT_BOOL && !V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
560
561 V_VT(args) = VT_BOOL;
562 V_BOOL(args) = VARIANT_TRUE;
563 V_VT(&v) = VT_I8;
564 dp.cArgs = 1;
565 hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
566 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
567 ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
568
569 IDispatchEx_Release(dispex);
570}
@ VT_I8
Definition: compat.h:2314
#define args
Definition: format.c:66
Definition: match.c:390
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:2524

◆ test_gc()

static void test_gc ( void  )
static

Definition at line 2373 of file run.c.

2374{
2375 IActiveScriptParse *parser;
2376 IActiveScript *engine;
2377 BSTR src;
2378 HRESULT hres;
2379
2381
2382 engine = create_script();
2383 if(!engine)
2384 return;
2385
2386 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2387 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2388
2390 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2391
2392 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2393 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2394
2395 hres = IActiveScript_AddNamedItem(engine, testW,
2396 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2397 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2398
2399 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2400 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2401
2402 src = a2bstr(
2403 "class C\n"
2404 " Public ref\n"
2405 " Public Sub Class_Terminate\n"
2406 " Call reportSuccess()\n"
2407 " End Sub\n"
2408 "End Class\n"
2409 "Dim x\n"
2410 "set x = new C\n"
2411 "set x.ref = x\n"
2412 "set x = nothing\n");
2413
2415 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2417
2418 SET_EXPECT(global_success_d);
2419 SET_EXPECT(global_success_i);
2420 IActiveScript_Close(engine);
2421 CHECK_CALLED(global_success_d);
2422 CHECK_CALLED(global_success_i);
2423
2424 IActiveScript_Release(engine);
2426}

Referenced by run_tests().

◆ test_global_vars_ref()

static HRESULT test_global_vars_ref ( BOOL  use_close)
static

Definition at line 2533 of file run.c.

2534{
2535 IActiveScriptParse *parser;
2536 IActiveScript *engine;
2537 BSTR script_str;
2538 LONG ref;
2539 HRESULT hres;
2540
2541 engine = create_script();
2542 if(!engine)
2543 return S_OK;
2544
2545 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2546 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2547 if (FAILED(hres))
2548 {
2549 IActiveScript_Release(engine);
2550 return hres;
2551 }
2552
2554 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2555
2556 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2557 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2558
2559 hres = IActiveScript_AddNamedItem(engine, testW, SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2560 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2561
2562 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2563 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2564
2565 refobj_ref = 0;
2566
2567 script_str = a2bstr("Dim x\nset x = RefObj\n");
2568 hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2569 SysFreeString(script_str);
2570
2571 ok(refobj_ref, "refobj_ref = 0\n");
2572
2573 if(use_close) {
2574 hres = IActiveScript_Close(engine);
2575 ok(hres == S_OK, "Close failed: %08x\n", hres);
2576 }else {
2577 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_UNINITIALIZED);
2578 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2579 }
2580
2581 ok(!refobj_ref, "refobj_ref = %d\n", refobj_ref);
2582
2583 IActiveScript_Release(engine);
2584
2586 ok(!ref, "ref=%d\n", ref);
2587 return hres;
2588}
@ SCRIPTSTATE_UNINITIALIZED
Definition: activscp.idl:57

Referenced by run_tests().

◆ test_isexpression()

static void test_isexpression ( void  )
static

Definition at line 2590 of file run.c.

2591{
2592 IActiveScriptParse *parser;
2593 IActiveScript *engine;
2595 HRESULT hres;
2596 VARIANT var;
2597 BSTR str;
2598
2599 if (!(engine = create_and_init_script(0, FALSE)))
2600 return;
2601
2602 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2603 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2604 if (FAILED(hres))
2605 {
2606 close_script(engine);
2607 return;
2608 }
2609
2610 /* Expression when script is not started is still executed */
2611 hres = IActiveScript_GetScriptState(engine, &ss);
2612 ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
2613 ok(ss == SCRIPTSTATE_INITIALIZED, "Wrong script state %u\n", ss);
2614
2615 str = a2bstr("13");
2616 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2617 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2618 ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var));
2619 ok(V_I2(&var) == 13, "Expected 13, got %d\n", V_I2(&var));
2620 VariantClear(&var);
2622
2623 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2624 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2625
2626 /* Empty expressions */
2627 V_VT(&var) = VT_I2;
2628 str = a2bstr("");
2629 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2630 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2631 ok(V_VT(&var) == VT_EMPTY, "Expected VT_EMPTY, got %s\n", vt2a(&var));
2632 VariantClear(&var);
2634
2635 /* Two expressions fail */
2636 str = a2bstr("1\n3");
2637 SET_EXPECT(OnScriptError);
2638 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2639 ok(FAILED(hres), "ParseScriptText did not fail: %08x\n", hres);
2640 CHECK_CALLED(OnScriptError);
2641 VariantClear(&var);
2643
2644 /* Simple numerical expression */
2645 str = a2bstr("(1 + 7) * 2 - 3");
2646 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, NULL, NULL);
2647 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2648
2649 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2650 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2651 ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var));
2652 ok(V_I2(&var) == 13, "Expected 13, got %d\n", V_I2(&var));
2653 VariantClear(&var);
2655
2656 /* An expression can also refer to a variable, function, class, etc previously set */
2657 V_VT(&var) = VT_I2;
2658 str = a2bstr("If True Then foo = 42 Else foo = 0\n");
2660 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2661 ok(V_VT(&var) == VT_EMPTY, "Expected VT_EMPTY, got %s\n", vt2a(&var));
2662 VariantClear(&var);
2664
2665 str = a2bstr("foo\n\n");
2666 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2667 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2668 ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var));
2669 ok(V_I2(&var) == 42, "Expected 42, got %d\n", V_I2(&var));
2670 VariantClear(&var);
2672
2673 str = a2bstr("foo : ");
2674 SET_EXPECT(OnScriptError);
2675 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2676 ok(FAILED(hres), "ParseScriptText did not fail: %08x\n", hres);
2677 CHECK_CALLED(OnScriptError);
2678 VariantClear(&var);
2680
2681 str = a2bstr("\"foo is \" & CStr(foo) \n \n\n ");
2682 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2683 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2684 ok(V_VT(&var) == VT_BSTR, "Expected VT_BSTR, got %s\n", vt2a(&var));
2685 ok(!strcmp_wa(V_BSTR(&var), "foo is 42"), "Wrong string, got %s\n", wine_dbgstr_w(V_BSTR(&var)));
2686 VariantClear(&var);
2688
2689 str = a2bstr("Function test(x)\n"
2690 " test = x + 0.5\n"
2691 "End Function\n");
2693 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2695
2696 str = a2bstr("test(4) * 3\n");
2697 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2698 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2699 ok(V_VT(&var) == VT_R8, "Expected VT_R8, got %s\n", vt2a(&var));
2700 ok(V_R8(&var) == 13.5, "Expected %lf, got %lf\n", 13.5, V_R8(&var));
2701 VariantClear(&var);
2703
2704 str = a2bstr("Class C\n"
2705 " Public x\n"
2706 "End Class\n"
2707 "Set obj = New C\n"
2708 "obj.x = True\n");
2710 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2712
2713 str = a2bstr("obj.x");
2714 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2715 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2716 ok(V_VT(&var) == VT_BOOL, "Expected VT_BOOL, got %s\n", vt2a(&var));
2717 ok(V_BOOL(&var) == VARIANT_TRUE, "Expected %x, got %x\n", VARIANT_TRUE, V_BOOL(&var));
2718 VariantClear(&var);
2720
2722 close_script(engine);
2723}
@ SCRIPTSTATE_INITIALIZED
Definition: activscp.idl:62
enum tagSCRIPTSTATE SCRIPTSTATE
#define ss
Definition: i386-dis.c:441
const char * var
Definition: shader.c:5666
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648

Referenced by run_tests().

◆ test_msgbox()

static void test_msgbox ( void  )
static

Definition at line 2484 of file run.c.

2485{
2486 HRESULT hres;
2487
2489
2490 SET_EXPECT(GetUIBehavior);
2493 hres = parse_script_ar("MsgBox \"testing...\"");
2494 CLEAR_CALLED(GetUIBehavior);
2497 if(FAILED(hres)) {
2498 win_skip("Skipping MsgBox tests, broken (probably too old) vbscript\n");
2499 return;
2500 }
2501
2502 SET_EXPECT(GetUIBehavior);
2503 parse_script_a("dim r\n r=MsgBox(\"testing...\")\n Call ok(r=0, \"r=\"&r)");
2504 CHECK_CALLED(GetUIBehavior);
2505
2506 SET_EXPECT(GetUIBehavior);
2507 parse_script_a("MsgBox 10");
2508 CHECK_CALLED(GetUIBehavior);
2509
2511
2512 SET_EXPECT(GetUIBehavior);
2515 SET_EXPECT(OnScriptError);
2516 hres = parse_script_ar("MsgBox \"testing...\"");
2517 ok(FAILED(hres), "script not failed\n");
2518 CHECK_CALLED(GetUIBehavior);
2521 CHECK_CALLED(OnScriptError);
2522
2524
2525 SET_EXPECT(GetUIBehavior);
2526 SET_EXPECT(OnScriptError);
2527 hres = parse_script_ar("MsgBox \"testing...\"");
2528 ok(FAILED(hres), "script not failed\n");
2529 CHECK_CALLED(GetUIBehavior);
2530 CHECK_CALLED(OnScriptError);
2531}
@ SCRIPTUICHANDLING_NOUIERROR
Definition: activscp.idl:77
@ SCRIPTUICHANDLING_NOUIDEFAULT
Definition: activscp.idl:78
#define CLEAR_CALLED(func)
Definition: run.c:88

Referenced by run_tests().

◆ test_parse_context()

static void test_parse_context ( void  )
static

Definition at line 2049 of file run.c.

2050{
2051 IActiveScriptParse *parser;
2052 IActiveScript *engine;
2053 BSTR str;
2054 HRESULT hres;
2055
2056 static const WCHAR xW[] = {'x',0};
2057 static const WCHAR yW[] = {'y',0};
2058
2059 global_ref = 1;
2060 engine = create_and_init_script(0, TRUE);
2061 if(!engine)
2062 return;
2063
2064 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2065 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2066
2067 /* NULL code text succeeds but does nothing */
2069 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2070
2071 /* unknown identifier context is not a valid argument */
2072 str = a2bstr("Call reportSuccess()\n");
2074 ok(hres == E_INVALIDARG, "ParseScriptText failed: %08x\n", hres);
2076
2077 str = a2bstr("class Cl\n"
2078 " Public Sub ClMethod\n"
2079 " Call reportSuccess()\n"
2080 " End Sub\n"
2081 "End Class\n"
2082 "Dim x\n"
2083 "set x = new Cl\n");
2085 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2087
2088 /* known global variable is not a valid context */
2089 str = a2bstr("Call reportSuccess()\n");
2091 ok(hres == E_INVALIDARG, "ParseScriptText failed: %08x\n", hres);
2093
2094 SET_EXPECT(global_success_d);
2095 SET_EXPECT(global_success_i);
2096 str = a2bstr("Call reportSuccess()\n");
2098 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2100 CHECK_CALLED(global_success_d);
2101 CHECK_CALLED(global_success_i);
2102
2104 close_script(engine);
2105 ok(global_ref == 1, "global_ref = %u\n", global_ref);
2106}

Referenced by run_tests().

◆ test_parse_errors()

static void test_parse_errors ( void  )
static

Definition at line 2428 of file run.c.

2429{
2430 static const char *invalid_scripts[] =
2431 {
2432 /* If...End If */
2433 "If 0 > 1 Then\n"
2434 " x = 0 End If\n",
2435
2436 /* While...End While */
2437 "While False\n"
2438 " x = 0 End While\n",
2439
2440 /* While...Wend */
2441 "While False\n"
2442 " x = 0 Wend\n",
2443
2444 /* Do While...Loop */
2445 "Do While False\n"
2446 " x = 0 Loop\n",
2447
2448 /* Do Until...Loop */
2449 "Do Until True\n"
2450 " x = 0 Loop\n",
2451
2452 /* Do...Loop While */
2453 "Do\n"
2454 " x = 0 Loop While False\n",
2455
2456 /* Do...Loop Until */
2457 "Do\n"
2458 " x = 0 Loop Until True\n",
2459
2460 /* Select...End Select */
2461 "x = False\n"
2462 "Select Case 42\n"
2463 " Case 0\n"
2464 " Call ok(False, \"unexpected case\")\n"
2465 " Case 42\n"
2466 " x = True End Select\n"
2467 "Call ok(x, \"wrong case\")\n",
2468
2469 /* Class...End Class (empty) */
2470 "Class C End Class"
2471 };
2472 HRESULT hres;
2473 UINT i;
2474
2475 for (i = 0; i < ARRAY_SIZE(invalid_scripts); i++)
2476 {
2477 SET_EXPECT(OnScriptError);
2478 hres = parse_script_ar(invalid_scripts[i]);
2479 ok(FAILED(hres), "[%u] script did not fail\n", i);
2480 CHECK_CALLED(OnScriptError);
2481 }
2482}

Referenced by run_tests().

◆ test_procedures()

static void test_procedures ( void  )
static

Definition at line 2151 of file run.c.

2152{
2153 IActiveScriptParseProcedure2 *parse_proc;
2154 DISPPARAMS dp = {NULL};
2157 IDispatch *disp;
2158 EXCEPINFO ei = {0};
2159 VARIANT v;
2160 HRESULT hres;
2161
2164
2165 hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
2166 ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2 iface: %08x\n", hres);
2167
2169 ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
2170 IDispatch_Release(disp);
2171
2172 proc = parse_procedure(parse_proc, "dim x\nif true then x=false", 0);
2173
2174 SET_EXPECT(OnEnterScript);
2175 SET_EXPECT(OnLeaveScript);
2176 V_VT(&v) = VT_EMPTY;
2177 hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp);
2178 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2179 CHECK_CALLED(OnEnterScript);
2180 CHECK_CALLED(OnLeaveScript);
2181 VariantClear(&v);
2182 IDispatchEx_Release(proc);
2183
2184 proc = parse_procedure(parse_proc, "\"foobar\"", SCRIPTPROC_ISEXPRESSION);
2185
2186 SET_EXPECT(OnEnterScript);
2187 SET_EXPECT(OnLeaveScript);
2188 hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, &v, &ei, &caller_sp);
2189 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2190 CHECK_CALLED(OnEnterScript);
2191 CHECK_CALLED(OnLeaveScript);
2192 ok(V_VT(&v) == VT_BSTR, "Expected VT_BSTR, got %s\n", vt2a(&v));
2193 ok(!strcmp_wa(V_BSTR(&v), "foobar"), "Wrong string, got %s\n", wine_dbgstr_w(V_BSTR(&v)));
2194 VariantClear(&v);
2195 IDispatchEx_Release(proc);
2196
2198
2201}
#define IActiveScriptParseProcedure2_Release
Definition: run.c:45
static IDispatchEx * parse_procedure(IActiveScriptParseProcedure2 *parse_proc, const char *src, DWORD flags)
Definition: run.c:2127
static HANDLE proc()
Definition: pdb.c:34

Referenced by run_tests().

◆ test_safearray()

static void test_safearray ( SAFEARRAY safearray,
unsigned  indims 
)
static

Definition at line 572 of file run.c.

573{
574 int i, exdims = indims;
575
576 if(!exdims)
577 exdims = 1;
578 ok(safearray->cDims == exdims, "safearray->cDims = %d, expected %d\n", safearray->cDims, exdims);
580 ok(safearray->fFeatures == (FADF_VARIANT|FADF_HAVEVARTYPE|FADF_FIXEDSIZE|FADF_STATIC),
581 "safearray->fFeatures = %x\n", safearray->fFeatures);
582 ok(safearray->cbElements == sizeof(VARIANT), "safearray->cbElements = %x\n", safearray->cbElements);
583 ok(!safearray->cLocks, "safearray->cLocks = %x\n", safearray->cLocks);
584
585 for(i=0; i < safearray->cDims; i++) {
586 ok(safearray->rgsabound[i].cElements == (indims ? i+4 : 1), "safearray->rgsabound[%d].cElements = %d\n", i,
587 safearray->rgsabound[i].cElements);
588 ok(!safearray->rgsabound[i].lLbound, "safearray->rgsabound[%d].lLbound = %d\n", i, safearray->rgsabound[i].lLbound);
589 }
590}
USHORT fFeatures
Definition: compat.h:2356
SAFEARRAYBOUND rgsabound[1]
Definition: compat.h:2360
ULONG cLocks
Definition: compat.h:2358
USHORT cDims
Definition: compat.h:2355
ULONG cbElements
Definition: compat.h:2357

◆ testObj_GetDispID()

static HRESULT WINAPI testObj_GetDispID ( IDispatchEx iface,
BSTR  bstrName,
DWORD  grfdex,
DISPID pid 
)
static

Definition at line 780 of file run.c.

781{
782 typedef struct {
783 const char * const name;
784 DISPID pid;
785 BOOL *expect;
786 BOOL *called;
787 } dispid_t;
788
789 dispid_t dispids[] = {
790 { "propget", DISPID_TESTOBJ_PROPGET, REF_EXPECT(testobj_propget_d) },
791 { "propput", DISPID_TESTOBJ_PROPPUT, REF_EXPECT(testobj_propput_d) },
792 { "rem", DISPID_TESTOBJ_KEYWORD, NULL },
793 { "true", DISPID_TESTOBJ_KEYWORD, NULL },
794 { "false", DISPID_TESTOBJ_KEYWORD, NULL },
795 { "not", DISPID_TESTOBJ_KEYWORD, NULL },
796 { "and", DISPID_TESTOBJ_KEYWORD, NULL },
797 { "or", DISPID_TESTOBJ_KEYWORD, NULL },
798 { "xor", DISPID_TESTOBJ_KEYWORD, NULL },
799 { "eqv", DISPID_TESTOBJ_KEYWORD, NULL },
800 { "imp", DISPID_TESTOBJ_KEYWORD, NULL },
801 { "is", DISPID_TESTOBJ_KEYWORD, NULL },
802 { "mod", DISPID_TESTOBJ_KEYWORD, NULL },
803 { "call", DISPID_TESTOBJ_KEYWORD, NULL },
804 { "dim", DISPID_TESTOBJ_KEYWORD, NULL },
805 { "sub", DISPID_TESTOBJ_KEYWORD, NULL },
806 { "function", DISPID_TESTOBJ_KEYWORD, NULL },
807 { "get", DISPID_TESTOBJ_KEYWORD, NULL },
808 { "let", DISPID_TESTOBJ_KEYWORD, NULL },
809 { "const", DISPID_TESTOBJ_KEYWORD, NULL },
810 { "if", DISPID_TESTOBJ_KEYWORD, NULL },
811 { "else", DISPID_TESTOBJ_KEYWORD, NULL },
812 { "elseif", DISPID_TESTOBJ_KEYWORD, NULL },
813 { "end", DISPID_TESTOBJ_KEYWORD, NULL },
814 { "then", DISPID_TESTOBJ_KEYWORD, NULL },
815 { "exit", DISPID_TESTOBJ_KEYWORD, NULL },
816 { "while", DISPID_TESTOBJ_KEYWORD, NULL },
817 { "wend", DISPID_TESTOBJ_KEYWORD, NULL },
818 { "do", DISPID_TESTOBJ_KEYWORD, NULL },
819 { "loop", DISPID_TESTOBJ_KEYWORD, NULL },
820 { "until", DISPID_TESTOBJ_KEYWORD, NULL },
821 { "for", DISPID_TESTOBJ_KEYWORD, NULL },
822 { "to", DISPID_TESTOBJ_KEYWORD, NULL },
823 { "each", DISPID_TESTOBJ_KEYWORD, NULL },
824 { "in", DISPID_TESTOBJ_KEYWORD, NULL },
825 { "select", DISPID_TESTOBJ_KEYWORD, NULL },
826 { "case", DISPID_TESTOBJ_KEYWORD, NULL },
827 { "byref", DISPID_TESTOBJ_KEYWORD, NULL },
828 { "byval", DISPID_TESTOBJ_KEYWORD, NULL },
829 { "option", DISPID_TESTOBJ_KEYWORD, NULL },
830 { "nothing", DISPID_TESTOBJ_KEYWORD, NULL },
831 { "empty", DISPID_TESTOBJ_KEYWORD, NULL },
832 { "null", DISPID_TESTOBJ_KEYWORD, NULL },
833 { "class", DISPID_TESTOBJ_KEYWORD, NULL },
834 { "set", DISPID_TESTOBJ_KEYWORD, NULL },
835 { "new", DISPID_TESTOBJ_KEYWORD, NULL },
836 { "public", DISPID_TESTOBJ_KEYWORD, NULL },
837 { "private", DISPID_TESTOBJ_KEYWORD, NULL },
838 { "next", DISPID_TESTOBJ_KEYWORD, NULL },
839 { "on", DISPID_TESTOBJ_KEYWORD, NULL },
840 { "resume", DISPID_TESTOBJ_KEYWORD, NULL },
841 { "goto", DISPID_TESTOBJ_KEYWORD, NULL },
842 };
843 int i;
844
845 for (i = 0; i < ARRAY_SIZE(dispids); i++) {
846 if(!stricmp_wa(bstrName, dispids[i].name)) {
847 dispid_t *d = &dispids[i];
848 if(d->expect) {
849 ok(*d->expect, "unexpected call %s\n", d->name);
850 *d->called = TRUE;
851 *d->expect = FALSE;
852 }
853 test_grfdex(grfdex, fdexNameCaseInsensitive);
854 *pid = d->pid;
855 return S_OK;
856 }
857 }
858
859 ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName));
860 return DISP_E_UNKNOWNNAME;
861}
unsigned int BOOL
Definition: ntddk_ex.h:94
#define d
Definition: ke_i.h:81
static int stricmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:183
#define DISPID_TESTOBJ_PROPPUT
Definition: run.c:144
#define REF_EXPECT(func)
Definition: run.c:61
#define DISPID_TESTOBJ_KEYWORD
Definition: run.c:145
#define DISPID_TESTOBJ_PROPGET
Definition: run.c:143
char * name
Definition: compiler.c:66

◆ testObj_InvokeEx()

static HRESULT WINAPI testObj_InvokeEx ( IDispatchEx iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
IServiceProvider pspCaller 
)
static

Definition at line 863 of file run.c.

865{
866 switch(id) {
867 case DISPID_VALUE: {
868 VARIANT *arg;
869 int i;
870
871 CHECK_EXPECT(testobj_value_i);
872
873 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
874 ok(pdp != NULL, "pdp == NULL\n");
875 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
876 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
877 ok(pvarRes != NULL, "pvarRes == NULL\n");
878 ok(pei != NULL, "pei == NULL\n");
879
880 for(i=0; i<pdp->cArgs; i++) {
881 arg = pdp->rgvarg+pdp->cArgs-i-1;
882 ok(V_VT(arg) == VT_I2, "V_VT(arg) = %d\n", V_VT(arg));
883 ok(V_I2(arg) == i+1, "V_I2(arg) = %d\n", V_I2(arg));
884 }
885
886 V_VT(pvarRes) = VT_I2;
887 V_I2(pvarRes) = pdp->cArgs;
888 return S_OK;
889 }
891 CHECK_EXPECT(testobj_propget_i);
892
893 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
894 ok(pdp != NULL, "pdp == NULL\n");
895 ok(!pdp->rgvarg, "rgvarg == NULL\n");
896 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
897 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
898 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
899 ok(pvarRes != NULL, "pvarRes == NULL\n");
900 ok(pei != NULL, "pei == NULL\n");
901
902 V_VT(pvarRes) = VT_I2;
903 V_I2(pvarRes) = 10;
904 return S_OK;
906 CHECK_EXPECT(testobj_propput_i);
907
908 ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
909 ok(pdp != NULL, "pdp == NULL\n");
910 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
911 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
912 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
913 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
914 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
915 ok(!pvarRes, "pvarRes != NULL\n");
916 ok(pei != NULL, "pei == NULL\n");
917
918 ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
919 ok(V_I2(pdp->rgvarg) == 1, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
920 return S_OK;
921
923 V_VT(pvarRes) = VT_I2;
924 V_I2(pvarRes) = 10;
925 return S_OK;
926 }
927
928 ok(0, "unexpected call %d\n", id);
929 return E_FAIL;
930}
void * arg
Definition: msvc.h:10

◆ vt2a()

static const char * vt2a ( VARIANT v)
static

Definition at line 190 of file run.c.

191{
192 if(V_VT(v) == (VT_BYREF|VT_VARIANT)) {
193 static char buf[64];
194 sprintf(buf, "%s*", vt2a(V_BYREF(v)));
195 return buf;
196 }
197
198 switch(V_VT(v)) {
199 case VT_EMPTY:
200 return "VT_EMPTY";
201 case VT_NULL:
202 return "VT_NULL";
203 case VT_I2:
204 return "VT_I2";
205 case VT_I4:
206 return "VT_I4";
207 case VT_R4:
208 return "VT_R4";
209 case VT_R8:
210 return "VT_R8";
211 case VT_CY:
212 return "VT_CY";
213 case VT_DATE:
214 return "VT_DATE";
215 case VT_BSTR:
216 return "VT_BSTR";
217 case VT_DISPATCH:
218 return "VT_DISPATCH";
219 case VT_BOOL:
220 return "VT_BOOL";
221 case VT_ARRAY|VT_VARIANT:
222 return "VT_ARRAY|VT_VARIANT";
224 return "VT_ARRAY|VT_BYREF|VT_VARIANT";
225 case VT_UI1:
226 return "VT_UI1";
227 default:
228 ok(0, "unknown vt %d\n", V_VT(v));
229 return NULL;
230 }
231}
@ VT_R4
Definition: compat.h:2299
@ VT_NULL
Definition: compat.h:2296
@ VT_CY
Definition: compat.h:2301
@ VT_DATE
Definition: compat.h:2302
@ VT_UI1
Definition: compat.h:2311
#define sprintf(buf, format,...)
Definition: sprintf.c:55

Referenced by Global_InvokeEx(), test_isexpression(), test_procedures(), and vt2a().

Variable Documentation

◆ ActiveScriptSite

IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }
static

Definition at line 1928 of file run.c.

◆ ActiveScriptSiteUIControl

IActiveScriptSiteUIControl ActiveScriptSiteUIControl = { &ActiveScriptSiteUIControlVtbl }
static

Definition at line 1798 of file run.c.

Referenced by ActiveScriptSite_QueryInterface().

◆ ActiveScriptSiteUIControlVtbl

const IActiveScriptSiteUIControlVtbl ActiveScriptSiteUIControlVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSiteUIControl_Release(IActiveScriptSiteUIControl *iface)
Definition: run.c:1775
static ULONG WINAPI ActiveScriptSiteUIControl_AddRef(IActiveScriptSiteUIControl *iface)
Definition: run.c:1770
static HRESULT WINAPI ActiveScriptSiteUIControl_GetUIBehavior(IActiveScriptSiteUIControl *iface, SCRIPTUICITEM UicItem, SCRIPTUICHANDLING *pUicHandling)
Definition: run.c:1780
static HRESULT WINAPI ActiveScriptSiteUIControl_QueryInterface(IActiveScriptSiteUIControl *iface, REFIID riid, void **ppv)
Definition: run.c:1764

Definition at line 1791 of file run.c.

◆ ActiveScriptSiteVtbl

const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface)
Definition: run.c:1670
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface)
Definition: run.c:1722
static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
Definition: run.c:1707
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion)
Definition: run.c:1696
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
Definition: run.c:1681
static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
Definition: run.c:1650
static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface)
Definition: run.c:1717
static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface)
Definition: run.c:1665
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
Definition: run.c:1701
static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid)
Definition: run.c:1675
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: run.c:1712

Definition at line 1914 of file run.c.

◆ ActiveScriptSiteWindow

IActiveScriptSiteWindow ActiveScriptSiteWindow = { &ActiveScriptSiteWindowVtbl }
static

Definition at line 1762 of file run.c.

Referenced by ActiveScriptSite_QueryInterface().

◆ ActiveScriptSiteWindowVtbl

const IActiveScriptSiteWindowVtbl ActiveScriptSiteWindowVtbl
static
Initial value:
= {
}
static ULONG WINAPI ActiveScriptSiteWindow_Release(IActiveScriptSiteWindow *iface)
Definition: run.c:1731
static HRESULT WINAPI ActiveScriptSiteWindow_GetWindow(IActiveScriptSiteWindow *iface, HWND *phwnd)
Definition: run.c:1736
static HRESULT WINAPI ActiveScriptSiteWindow_EnableModeless(IActiveScriptSiteWindow *iface, BOOL fEnable)
Definition: run.c:1744
static HRESULT WINAPI ActiveScriptSiteWindow_QueryInterface(IActiveScriptSiteWindow *iface, REFIID riid, void **ppv)
Definition: run.c:1720
static ULONG WINAPI ActiveScriptSiteWindow_AddRef(IActiveScriptSiteWindow *iface)
Definition: run.c:1726

Definition at line 1754 of file run.c.

◆ allow_ui

◆ caller_sp

IServiceProvider caller_sp = { &ServiceProviderVtbl }
static

Definition at line 281 of file run.c.

Referenced by test_callbacks(), and test_procedures().

◆ CLSID_VBScript

const CLSID CLSID_VBScript
extern

Referenced by create_script().

◆ CLSID_VBScriptRegExp

const CLSID CLSID_VBScriptRegExp
extern

◆ collectionObj

IDispatchEx collectionObj = { &collectionObjVtbl }
static

Definition at line 1035 of file run.c.

Referenced by Global_InvokeEx().

◆ collectionObjVtbl

IDispatchExVtbl collectionObjVtbl
static
Initial value:
= {
}
static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
Definition: run.c:405
static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
Definition: run.c:347
static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: run.c:364
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: run.c:399
static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
Definition: run.c:423
static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: run.c:372
static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
Definition: run.c:411
static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
Definition: run.c:417
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: run.c:328
static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
Definition: run.c:342
static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: run.c:358
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
Definition: run.c:393
static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
Definition: run.c:352
static HRESULT WINAPI collectionObj_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: run.c:977
static HRESULT WINAPI collectionObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: run.c:988

Definition at line 1017 of file run.c.

◆ emptyW

const WCHAR emptyW[] = {0}
static

Definition at line 153 of file run.c.

◆ enumDisp

static IDispatchEx enumDisp = { &enumDispVtbl }
static

Definition at line 598 of file run.c.

Referenced by EnumVARIANT_QueryInterface().

◆ enumDispVtbl

IDispatchExVtbl enumDispVtbl
static
Initial value:
= {
}
static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *res, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: run.c:386
static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: run.c:380
static HRESULT WINAPI enumDisp_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: run.c:952

Definition at line 957 of file run.c.

◆ enumObj

IEnumVARIANT enumObj = { &EnumVARIANTVtbl }
static

Definition at line 674 of file run.c.

Referenced by collectionObj_InvokeEx(), and enumDisp_QueryInterface().

◆ EnumVARIANTVtbl

const IEnumVARIANTVtbl EnumVARIANTVtbl
static
Initial value:
= {
}
static HRESULT WINAPI EnumVARIANT_Skip(IEnumVARIANT *This, ULONG celt)
Definition: run.c:293
static ULONG WINAPI EnumVARIANT_Release(IEnumVARIANT *iface)
Definition: run.c:250
static HRESULT WINAPI EnumVARIANT_Clone(IEnumVARIANT *This, IEnumVARIANT **ppEnum)
Definition: run.c:308
static HRESULT WINAPI EnumVARIANT_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
Definition: run.c:233
static HRESULT WINAPI EnumVARIANT_Reset(IEnumVARIANT *This)
Definition: run.c:300
static HRESULT WINAPI EnumVARIANT_Next(IEnumVARIANT *This, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
Definition: run.c:257
static ULONG WINAPI EnumVARIANT_AddRef(IEnumVARIANT *iface)
Definition: run.c:245

Definition at line 664 of file run.c.

◆ first_day_of_week

int first_day_of_week
static

Definition at line 156 of file run.c.

Referenced by detect_locale(), and Global_InvokeEx().

◆ Global

IDispatchEx Global = { &GlobalVtbl }
static

Definition at line 1718 of file run.c.

◆ global_ref

ULONG global_ref
static

Definition at line 1069 of file run.c.

Referenced by Global_AddRef(), Global_Release(), and test_parse_context().

◆ GlobalVtbl

IDispatchExVtbl GlobalVtbl
static
Initial value:
= {
}
static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: run.c:1014
static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: run.c:801
static ULONG WINAPI Global_Release(IDispatchEx *iface)
Definition: run.c:1076
static ULONG WINAPI Global_AddRef(IDispatchEx *iface)
Definition: run.c:1071

Definition at line 1700 of file run.c.

◆ is_english

BOOL is_english
static

Definition at line 155 of file run.c.

Referenced by detect_locale(), Global_InvokeEx(), START_TEST(), test_callbacks(), and tt_face_get_name().

◆ next_cnt

unsigned next_cnt
static

Definition at line 626 of file run.c.

Referenced by collectionObj_InvokeEx(), EnumVARIANT_Next(), and run_tests().

◆ onerror_hres

HRESULT onerror_hres = E_NOTIMPL
static

Definition at line 161 of file run.c.

Referenced by ActiveScriptSite_OnScriptError(), and run_tests().

◆ RefObj

IDispatchEx RefObj = { &RefObjVtbl }
static

Definition at line 1067 of file run.c.

Referenced by Global_InvokeEx().

◆ refobj_ref

ULONG refobj_ref
static

Definition at line 1037 of file run.c.

Referenced by RefObj_AddRef(), RefObj_Release(), and test_global_vars_ref().

◆ RefObjVtbl

◆ ServiceProviderVtbl

const IServiceProviderVtbl ServiceProviderVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: run.c:267
static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface)
Definition: run.c:262
static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: run.c:251
static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface)
Definition: run.c:257

Definition at line 274 of file run.c.

◆ store_script_error

IActiveScriptError** store_script_error
static

Definition at line 1865 of file run.c.

Referenced by ActiveScriptSite_OnScriptError(), and test_callbacks().

◆ strict_dispid_check

BOOL strict_dispid_check
static

Definition at line 155 of file run.c.

◆ strict_enter_script

BOOL strict_enter_script
static

◆ test_counter

int test_counter
static

Definition at line 158 of file run.c.

Referenced by Global_InvokeEx(), and parse_script().

◆ test_name

const char* test_name = "(null)"
static

Definition at line 157 of file run.c.

◆ testObj

static IDispatchEx testObj = { &testObjVtbl }
static

Definition at line 160 of file run.c.

◆ testObjVtbl

IDispatchExVtbl testObjVtbl
static
Initial value:
= {
}
static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: run.c:487
static HRESULT WINAPI testObj_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: run.c:451

Definition at line 932 of file run.c.

◆ testW

const WCHAR testW[] = {'t','e','s','t',0}
static

Definition at line 152 of file run.c.

◆ uic_handling