ReactOS  0.4.14-dev-1233-gf5658fd
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 IDispatchEx * parse_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)
GLenum func
Definition: glext.h:6028

Definition at line 76 of file run.c.

◆ CHECK_EXPECT

#define CHECK_EXPECT (   func)
Value:
do { \
CHECK_EXPECT2(func); \
expect_ ## func = FALSE; \
}while(0)
GLenum func
Definition: glext.h:6028

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)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

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)
GLenum func
Definition: glext.h:6028

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 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1988
OLECHAR * BSTR
Definition: compat.h:1942
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static BSTR a2bstr(const char *str)
Definition: run.c:164
#define ok_(x1, x2)
Definition: atltest.h:61

◆ _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 }
Definition: parser.c:48
#define expect(expected, got)
Definition: combo.c:36
#define ok_(x1, x2)
Definition: atltest.h:61

◆ 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);
171  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
172 
173  return ret;
174 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1942
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100

Referenced by _parse_htmlscript_a(), Global_InvokeEx(), parse_procedure(), parse_script_af(), parse_script_ar(), test_disp(), test_gc(), test_global_vars_ref(), test_isexpression(), and test_parse_context().

◆ 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 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
static IDispatchEx Global
Definition: run.c:1718
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:176
#define ok(value,...)
Definition: atltest.h:57

◆ 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: lang.c:768
#define S_OK
Definition: intsafe.h:59

◆ 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 }
static BOOL strict_enter_script
Definition: run.c:162
#define CHECK_EXPECT(func)
Definition: run.c:70
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static BOOL strict_enter_script
Definition: run.c:162
#define CHECK_EXPECT(func)
Definition: run.c:70
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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) {
1872  EXCEPINFO info;
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 E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
struct _test_info info[]
Definition: SetCursorPos.c:19
static HRESULT onerror_hres
Definition: run.c:161
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:78
char line[200]
Definition: main.c:97
#define CHECK_EXPECT(func)
Definition: run.c:70
static IActiveScriptError ** store_script_error
Definition: run.c:1865
struct stdole::EXCEPINFO EXCEPINFO
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static IActiveScriptSiteWindow ActiveScriptSiteWindow
Definition: run.c:1762
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IActiveScriptSiteUIControl ActiveScriptSiteUIControl
Definition: run.c:1798

◆ 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 }
static BOOL allow_ui
Definition: run.c:155
#define CHECK_EXPECT(func)
Definition: run.c:70
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ 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 EnableModeless(type)
Definition: ordinal.c:3446
#define E_FAIL
Definition: ddrawi.h:102
static BOOL allow_ui
Definition: run.c:155
#define CHECK_EXPECT(func)
Definition: run.c:70
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ 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 }
smooth NULL
Definition: ftsmooth.c:416
static BOOL allow_ui
Definition: run.c:155
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define CHECK_EXPECT(func)
Definition: run.c:70
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ 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);
3061  if(hres == REGDB_E_CLASSNOTREG)
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 }
smooth NULL
Definition: ftsmooth.c:416
const CLSID CLSID_VBScriptRegExp
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
const GUID IID_IUnknown
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define ok(value,...)
Definition: atltest.h:57
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
script
Definition: msipriv.h:374
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

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 DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_COLLOBJ_RESET
Definition: run.c:147
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:176
#define ok(value,...)
Definition: atltest.h:57

◆ 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;
1008  case DISPID_COLLOBJ_RESET:
1009  next_cnt = 0;
1010  return S_OK;
1011  }
1012 
1013  ok(0, "unexpected call %d\n", id);
1014  return E_NOTIMPL;
1015 }
static BOOL strict_dispid_check
Definition: run.c:155
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define DISPID_COLLOBJ_RESET
Definition: run.c:147
smooth NULL
Definition: ftsmooth.c:416
static IEnumVARIANT enumObj
Definition: run.c:674
#define V_VT(A)
Definition: oleauto.h:211
#define CHECK_EXPECT(func)
Definition: run.c:70
#define V_UNKNOWN(A)
Definition: oleauto.h:281
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:626
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static IActiveScript * create_script(void)
Definition: run.c:1930
static const WCHAR testW[]
Definition: run.c:152
smooth NULL
Definition: ftsmooth.c:416
#define IActiveScriptParse_InitNew
Definition: run.c:45
#define IActiveScriptParse_Release
Definition: run.c:44
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
GLuint start
Definition: gl.h:1545
#define ok(value,...)
Definition: atltest.h:57
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1928
Definition: import.c:85

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 }
smooth NULL
Definition: ftsmooth.c:416
script
Definition: msipriv.h:374
const CLSID CLSID_VBScript
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

Referenced by create_and_init_script(), test_gc(), and test_global_vars_ref().

◆ DEFINE_EXPECT() [1/26]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [2/26]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [3/26]

DEFINE_EXPECT ( global_vbvar_d  )

◆ DEFINE_EXPECT() [4/26]

DEFINE_EXPECT ( global_vbvar_i  )

◆ DEFINE_EXPECT() [5/26]

DEFINE_EXPECT ( global_letobj_i  )

◆ DEFINE_EXPECT() [6/26]

DEFINE_EXPECT ( global_setobj_i  )

◆ DEFINE_EXPECT() [7/26]

DEFINE_EXPECT ( global_globalcallback_i  )

◆ DEFINE_EXPECT() [8/26]

DEFINE_EXPECT ( testobj_propget_d  )

◆ DEFINE_EXPECT() [9/26]

DEFINE_EXPECT ( testobj_propget_i  )

◆ DEFINE_EXPECT() [10/26]

DEFINE_EXPECT ( testobj_propput_d  )

◆ DEFINE_EXPECT() [11/26]

DEFINE_EXPECT ( testobj_propput_i  )

◆ DEFINE_EXPECT() [12/26]

DEFINE_EXPECT ( testobj_value_i  )

◆ DEFINE_EXPECT() [13/26]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [14/26]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [15/26]

DEFINE_EXPECT ( global_propargput1_d  )

◆ DEFINE_EXPECT() [16/26]

DEFINE_EXPECT ( global_propargput1_i  )

◆ DEFINE_EXPECT() [17/26]

DEFINE_EXPECT ( global_testoptionalarg_i  )

◆ DEFINE_EXPECT() [18/26]

DEFINE_EXPECT ( global_testerrorobject_i  )

◆ DEFINE_EXPECT() [19/26]

DEFINE_EXPECT ( collectionobj_newenum_i  )

◆ DEFINE_EXPECT() [20/26]

DEFINE_EXPECT ( Next  )

◆ DEFINE_EXPECT() [21/26]

DEFINE_EXPECT ( GetWindow  )

◆ DEFINE_EXPECT() [22/26]

DEFINE_EXPECT ( GetUIBehavior  )

◆ DEFINE_EXPECT() [23/26]

DEFINE_EXPECT ( EnableModeless  )

◆ DEFINE_EXPECT() [24/26]

DEFINE_EXPECT ( OnScriptError  )

◆ DEFINE_EXPECT() [25/26]

DEFINE_EXPECT ( OnEnterScript  )

◆ DEFINE_EXPECT() [26/26]

DEFINE_EXPECT ( OnLeaveScript  )

◆ 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 }
LANGID WINAPI GetUserDefaultUILanguage(void)
Definition: lang.c:806
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static BOOL is_english
Definition: run.c:155
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1018
#define LOCALE_USER_DEFAULT
WORD LANGID
Definition: typedefs.h:80
#define WINAPI
Definition: msvc.h:6
#define LANG_ENGLISH
Definition: nls.h:52
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define LOCALE_IFIRSTDAYOFWEEK
Definition: winnls.h:75
static int first_day_of_week
Definition: run.c:156
#define GetProcAddress(x, y)
Definition: compat.h:418
LANGID WINAPI GetUserDefaultLangID(void)
Definition: lang.c:734
#define PRIMARYLANGID(l)
Definition: nls.h:16

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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
smooth NULL
Definition: ftsmooth.c:416
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ 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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IEnumVARIANT enumObj
Definition: run.c:674

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
static BOOL strict_dispid_check
Definition: run.c:155
#define V_I2(A)
Definition: oleauto.h:245
#define S_FALSE
Definition: winerror.h:2357
#define CHECK_EXPECT2(func)
Definition: run.c:64
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:626
#define ok(value,...)
Definition: atltest.h:57
Definition: compat.h:1946

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
const GUID IID_IUnknown
const GUID IID_IDispatch
static IDispatchEx enumDisp
Definition: run.c:598
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

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 
2738  size = GetFileSize(file, NULL);
2739 
2741  CloseHandle(file);
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);
2748  CloseHandle(map);
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 }
#define CloseHandle
Definition: compat.h:406
#define MapViewOfFile
Definition: compat.h:410
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
OLECHAR * BSTR
Definition: compat.h:1942
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:435
#define OPEN_EXISTING
Definition: compat.h:434
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:409
const char file[]
Definition: icontest.c:11
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
Definition: _map.h:44
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:124
#define PAGE_READONLY
Definition: compat.h:127
#define MultiByteToWideChar
Definition: compat.h:100
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
#define UnmapViewOfFile
Definition: compat.h:411
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262
Definition: fci.c:126

Referenced by run_from_file().

◆ 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);
1085  *pid = DISPID_GLOBAL_OK;
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 DISPID_GLOBAL_PROPARGPUT1
Definition: run.c:130
#define DISPID_GLOBAL_THROWINT
Definition: run.c:134
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
static BOOL strict_dispid_check
Definition: run.c:155
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:129
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:118
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_REFOBJ
Definition: run.c:127
#define DISPID_GLOBAL_OK
Definition: run.c:120
#define DISPID_GLOBAL_ISENGLANG
Definition: run.c:122
#define DISPID_GLOBAL_LETOBJ
Definition: run.c:136
#define DISPID_GLOBAL_GETVT
Definition: run.c:121
#define DISPID_GLOBAL_TESTDISP
Definition: run.c:126
#define DISPID_GLOBAL_TODO_WINE_OK
Definition: run.c:138
#define DISPID_GLOBAL_TRACE
Definition: run.c:119
#define DISPID_GLOBAL_TESTOPTIONALARG
Definition: run.c:135
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:124
#define DISPID_GLOBAL_GLOBALCALLBACK
Definition: run.c:140
#define DISPID_GLOBAL_TESTARRAY
Definition: run.c:133
#define CHECK_EXPECT(func)
Definition: run.c:70
#define DISPID_GLOBAL_COLLOBJ
Definition: run.c:131
#define DISPID_GLOBAL_WEEKSTARTDAY
Definition: run.c:139
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:176
#define DISPID_GLOBAL_TESTERROROBJECT
Definition: run.c:141
#define DISPID_GLOBAL_DOUBLEASSTRING
Definition: run.c:132
#define ok(value,...)
Definition: atltest.h:57
#define DISPID_GLOBAL_COUNTER
Definition: run.c:128
#define DISPID_GLOBAL_VBVAR
Definition: run.c:123
#define DISPID_GLOBAL_SETOBJ
Definition: run.c:137
#define test_grfdex(a, b)
Definition: run.c:592
#define DISPID_GLOBAL_ISNULLDISP
Definition: run.c:125

◆ 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 
1246  case DISPID_GLOBAL_TRACE:
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 
1275  case DISPID_GLOBAL_GETVT:
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 
1307  case DISPID_GLOBAL_VBVAR:
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 
1324  case DISPID_GLOBAL_LETOBJ:
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 
1341  case DISPID_GLOBAL_SETOBJ:
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 
1358  case DISPID_GLOBAL_TESTOBJ:
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 
1373  case DISPID_GLOBAL_COLLOBJ:
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 
1388  case DISPID_GLOBAL_REFOBJ:
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 
1404  case DISPID_GLOBAL_ISNULLDISP: {
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 
1484  case DISPID_GLOBAL_COUNTER:
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 
1527  case DISPID_GLOBAL_THROWINT: {
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);
1613  SysFreeString(str);
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 DISPID_GLOBAL_PROPARGPUT1
Definition: run.c:130
#define DISPID_GLOBAL_THROWINT
Definition: run.c:134
disp
Definition: i386-dis.c:3181
#define E_NOINTERFACE
Definition: winerror.h:2364
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
static const char * vt2a(VARIANT *v)
Definition: run.c:190
static BOOL is_english
Definition: run.c:155
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:129
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:118
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_REFOBJ
Definition: run.c:127
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define V_R8(A)
Definition: oleauto.h:262
#define V_I2(A)
Definition: oleauto.h:245
static const char * test_name
Definition: run.c:157
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_GLOBAL_OK
Definition: run.c:120
static int test_counter
Definition: run.c:158
#define DISPID_GLOBAL_ISENGLANG
Definition: run.c:122
OLECHAR * BSTR
Definition: compat.h:1942
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
GLuint GLuint * names
Definition: glext.h:11545
#define DISPID_GLOBAL_LETOBJ
Definition: run.c:136
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static IDispatchEx collectionObj
Definition: run.c:1035
#define V_ARRAYREF(A)
Definition: oleauto.h:223
#define V_BYREF(A)
Definition: oleauto.h:228
#define DISPID_GLOBAL_GETVT
Definition: run.c:121
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
#define DISPID_GLOBAL_TESTDISP
Definition: run.c:126
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define b
Definition: ke_i.h:79
#define DISPID_GLOBAL_TODO_WINE_OK
Definition: run.c:138
#define DISPID_GLOBAL_TRACE
Definition: run.c:119
#define todo_wine_if(is_todo)
Definition: test.h:163
#define DISPID_GLOBAL_TESTOPTIONALARG
Definition: run.c:135
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:124
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
#define V_BOOL(A)
Definition: oleauto.h:224
#define CHECK_CALLED(func)
Definition: run.c:76
HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6587
#define DISPID_GLOBAL_GLOBALCALLBACK
Definition: run.c:140
static const WCHAR L[]
Definition: oid.c:1250
static ITypeInfo * typeinfo[last_tid]
Definition: apps.c:109
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:162
#define DISPID_GLOBAL_TESTARRAY
Definition: run.c:133
#define V_VT(A)
Definition: oleauto.h:211
#define SET_EXPECT(func)
Definition: run.c:58
#define CHECK_EXPECT(func)
Definition: run.c:70
static void test_disp(IDispatch *disp)
Definition: run.c:283
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009
static IDispatchEx RefObj
Definition: run.c:1067
static IDispatchEx testObj
Definition: run.c:160
#define DISPID_GLOBAL_COLLOBJ
Definition: run.c:131
#define DISPID_GLOBAL_WEEKSTARTDAY
Definition: run.c:139
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define ARRAY_SIZE(a)
Definition: main.h:24
#define DISPID_GLOBAL_TESTERROROBJECT
Definition: run.c:141
#define DISPID_GLOBAL_DOUBLEASSTRING
Definition: run.c:132
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
#define V_ERROR(A)
Definition: oleauto.h:241
unsigned int UINT
Definition: ndis.h:50
static BSTR a2bstr(const char *str)
Definition: run.c:164
#define DISPID_GLOBAL_COUNTER
Definition: run.c:128
static const WCHAR props[]
Definition: wbemdisp.c:288
struct stdole::DISPPARAMS DISPPARAMS
#define DISPID_GLOBAL_VBVAR
Definition: run.c:123
static int first_day_of_week
Definition: run.c:156
GLenum GLuint id
Definition: glext.h:5579
#define DISPID_GLOBAL_SETOBJ
Definition: run.c:137
#define DISP_E_BADINDEX
Definition: winerror.h:2520
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define memset(x, y, z)
Definition: compat.h:39
#define DISPID_GLOBAL_ISNULLDISP
Definition: run.c:125
Definition: compat.h:1949
Definition: compat.h:1946
static void test_safearray(SAFEARRAY *safearray, unsigned indims)
Definition: run.c:572

◆ Global_Release()

static ULONG WINAPI Global_Release ( IDispatchEx *  iface)
static

Definition at line 1076 of file run.c.

1077 {
1078  return --global_ref;
1079 }
static ULONG global_ref
Definition: run.c:1069

◆ 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);
2139  SysFreeString(str);
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 }
disp
Definition: i386-dis.c:3181
static const WCHAR emptyW[]
Definition: run.c:153
OLECHAR * BSTR
Definition: compat.h:1942
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
#define IActiveScriptParseProcedure2_ParseProcedureText
Definition: run.c:48
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static BSTR a2bstr(const char *str)
Definition: run.c:164

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 
1996  engine = create_and_init_script(flags, TRUE);
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 }
static IActiveScript * create_and_init_script(DWORD flags, BOOL start)
Definition: run.c:1942
#define TRUE
Definition: types.h:120
static int test_counter
Definition: run.c:158
static IDispatchEx Global
Definition: run.c:1718
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
smooth NULL
Definition: ftsmooth.c:416
#define IActiveScriptParse_Release
Definition: run.c:44
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
static IDispatch * script_disp
Definition: run.c:178
#define S_OK
Definition: intsafe.h:59
#define IActiveScriptParse_ParseScriptText
Definition: run.c:46
#define ok(value,...)
Definition: atltest.h:57
Definition: import.c:85

Referenced by _parse_htmlscript_a(), parse_script_af(), parse_script_ar(), run_from_file(), and run_from_res().

◆ 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:2027
GLenum src
Definition: glext.h:6340

Referenced by run_tests(), and test_msgbox().

◆ 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 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1988
OLECHAR * BSTR
Definition: compat.h:1942
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
GLbitfield flags
Definition: glext.h:7161
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static BSTR a2bstr(const char *str)
Definition: run.c:164

Referenced by parse_script_a(), and run_tests().

◆ 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 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1988
OLECHAR * BSTR
Definition: compat.h:1942
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
GLenum src
Definition: glext.h:6340
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static BSTR a2bstr(const char *str)
Definition: run.c:164

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 }
static ULONG refobj_ref
Definition: run.c:1037

◆ 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 BOOL strict_dispid_check
Definition: run.c:155
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1988
OLECHAR * BSTR
Definition: compat.h:1942
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
#define S_OK
Definition: intsafe.h:59
static BSTR get_script_from_file(const char *filename)
Definition: run.c:2725
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by START_TEST().

◆ 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 
2793  data = LoadResource(NULL, src);
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);
2806  SysFreeString(str);
2807  test_name = "";
2808 }
static BOOL strict_dispid_check
Definition: run.c:155
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1988
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define CP_ACP
Definition: compat.h:99
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
static const char * test_name
Definition: run.c:157
OLECHAR * BSTR
Definition: compat.h:1942
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CHECK_CALLED(func)
Definition: run.c:76
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLsizei len
Definition: glext.h:6722
#define SET_EXPECT(func)
Definition: run.c:58
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:38
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by run_tests().

◆ 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 
2967  onerror_hres = S_OK;
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 
2979  onerror_hres = S_OK;
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 
3043  test_procedures();
3044  test_gc();
3045  test_msgbox();
3049  test_callbacks();
3050 }
static BOOL strict_dispid_check
Definition: run.c:155
#define TRUE
Definition: types.h:120
static void test_msgbox(void)
Definition: run.c:2484
static HRESULT parse_script_ar(const char *src)
Definition: run.c:2038
#define CHECK_NOT_CALLED(func)
Definition: run.c:82
static HRESULT onerror_hres
Definition: run.c:161
#define MAKE_VBSERROR(code)
Definition: run.c:150
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:2027
static HRESULT test_global_vars_ref(BOOL use_close)
Definition: run.c:2533
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
static void parse_script_a(const char *src)
Definition: run.c:2108
static void test_callbacks(void)
Definition: run.c:2210
#define CHECK_CALLED(func)
Definition: run.c:76
static void test_parse_errors(void)
Definition: run.c:2428
static void test_procedures(void)
Definition: run.c:2151
#define todo_wine
Definition: test.h:162
#define SET_EXPECT(func)
Definition: run.c:58
static void test_gc(void)
Definition: run.c:2373
static void test_isexpression(void)
Definition: run.c:2590
static void run_from_res(const char *name)
Definition: run.c:2778
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:626
#define ok(value,...)
Definition: atltest.h:57
#define parse_htmlscript_a(a)
Definition: run.c:2113
static void test_parse_context(void)
Definition: run.c:2049

Referenced by START_TEST().

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define ok(value,...)
Definition: atltest.h:57

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
Definition: atltest.h:57

◆ 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 
3084  CoInitialize(NULL);
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 
3096  CoUninitialize();
3097 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
static BOOL is_english
Definition: run.c:155
#define argv
Definition: mplay32.c:18
static void detect_locale(void)
Definition: run.c:237
smooth NULL
Definition: ftsmooth.c:416
static BOOL allow_ui
Definition: run.c:155
static void run_from_file(const char *filename)
Definition: run.c:2763
int winetest_get_mainargs(char ***pargv)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void run_tests(void)
Definition: run.c:2810
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static SCRIPTUICHANDLING uic_handling
Definition: run.c:159
static BOOL check_vbscript(void)
Definition: run.c:3052
#define win_skip
Definition: test.h:149

◆ 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:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
int WINAPI lstrcmpA(LPCSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:18
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by ActiveScriptSite_GetItemInfo(), collectionObj_GetDispID(), Global_GetDispID(), test_isexpression(), and test_procedures().

◆ 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 lpString1, LPCSTR lpString2)
Definition: lstring.c:42
#define WideCharToMultiByte
Definition: compat.h:101
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define CP_ACP
Definition: compat.h:99
char CHAR
Definition: xmlstorage.h:175
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

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);
2260  SysFreeString(str);
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);
2276  hres = IActiveScriptParse_ParseScriptText(parser, L"err.raise 2\n",
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 IActiveScript * create_and_init_script(DWORD flags, BOOL start)
Definition: run.c:1942
disp
Definition: i386-dis.c:3181
static void free_ei(EXCEPINFO *ei)
Definition: run.c:2203
#define TRUE
Definition: types.h:120
static BOOL is_english
Definition: run.c:155
#define error1(s, a)
Definition: debug.h:109
static BOOL strict_enter_script
Definition: run.c:162
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
OLECHAR * BSTR
Definition: compat.h:1942
#define DISPATCH_METHOD
Definition: oleauto.h:1006
const WCHAR * str
#define MAKE_VBSERROR(code)
Definition: run.c:150
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
script
Definition: msipriv.h:374
#define error2(s, a, b)
Definition: debug.h:110
#define IActiveScriptParse_Release
Definition: run.c:44
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
#define CHECK_CALLED(func)
Definition: run.c:76
static const WCHAR L[]
Definition: oid.c:1250
#define SET_EXPECT(func)
Definition: run.c:58
static IActiveScriptError ** store_script_error
Definition: run.c:1865
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
const GLdouble * v
Definition: gl.h:2040
#define IActiveScriptParse_ParseScriptText
Definition: run.c:46
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
static void close_script(IActiveScript *script)
Definition: run.c:1976
Definition: import.c:85
struct stdole::DISPPARAMS DISPPARAMS
GLenum GLuint id
Definition: glext.h:5579
#define memset(x, y, z)
Definition: compat.h:39
static IServiceProvider caller_sp
Definition: run.c:281

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;
292  HRESULT hres;
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: %08