ReactOS  0.4.14-dev-293-g2b39b42
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 CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_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_TESTOBJ_PROPGET   2000
 
#define DISPID_TESTOBJ_PROPPUT   2001
 
#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 (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 (collectionobj_newenum_i)
 
 DEFINE_EXPECT (Next)
 
 DEFINE_EXPECT (GetWindow)
 
 DEFINE_EXPECT (GetUIBehavior)
 
 DEFINE_EXPECT (EnableModeless)
 
 DEFINE_EXPECT (OnScriptError)
 
static BSTR a2bstr (const char *str)
 
static int strcmp_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)
 
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)
 
static void test_procedures (void)
 
static void test_gc (void)
 
static void test_msgbox (void)
 
static HRESULT test_global_vars_ref (BOOL use_close)
 
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 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 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 73 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 67 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 61 of file run.c.

◆ CLEAR_CALLED

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

Definition at line 79 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 131 of file run.c.

◆ DISPID_GLOBAL_COLLOBJ

#define DISPID_GLOBAL_COLLOBJ   1013

Definition at line 118 of file run.c.

◆ DISPID_GLOBAL_COUNTER

#define DISPID_GLOBAL_COUNTER   1010

Definition at line 115 of file run.c.

◆ DISPID_GLOBAL_DOUBLEASSTRING

#define DISPID_GLOBAL_DOUBLEASSTRING   1014

Definition at line 119 of file run.c.

◆ DISPID_GLOBAL_GETVT

#define DISPID_GLOBAL_GETVT   1003

Definition at line 108 of file run.c.

◆ DISPID_GLOBAL_ISENGLANG

#define DISPID_GLOBAL_ISENGLANG   1004

Definition at line 109 of file run.c.

◆ DISPID_GLOBAL_ISNULLDISP

#define DISPID_GLOBAL_ISNULLDISP   1007

Definition at line 112 of file run.c.

◆ DISPID_GLOBAL_LETOBJ

#define DISPID_GLOBAL_LETOBJ   1018

Definition at line 123 of file run.c.

◆ DISPID_GLOBAL_OK

#define DISPID_GLOBAL_OK   1002

Definition at line 107 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT

#define DISPID_GLOBAL_PROPARGPUT   1011

Definition at line 116 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT1

#define DISPID_GLOBAL_PROPARGPUT1   1012

Definition at line 117 of file run.c.

◆ DISPID_GLOBAL_REFOBJ

#define DISPID_GLOBAL_REFOBJ   1009

Definition at line 114 of file run.c.

◆ DISPID_GLOBAL_REPORTSUCCESS

#define DISPID_GLOBAL_REPORTSUCCESS   1000

Definition at line 105 of file run.c.

◆ DISPID_GLOBAL_SETOBJ

#define DISPID_GLOBAL_SETOBJ   1019

Definition at line 124 of file run.c.

◆ DISPID_GLOBAL_TESTARRAY

#define DISPID_GLOBAL_TESTARRAY   1015

Definition at line 120 of file run.c.

◆ DISPID_GLOBAL_TESTDISP

#define DISPID_GLOBAL_TESTDISP   1008

Definition at line 113 of file run.c.

◆ DISPID_GLOBAL_TESTOBJ

#define DISPID_GLOBAL_TESTOBJ   1006

Definition at line 111 of file run.c.

◆ DISPID_GLOBAL_TESTOPTIONALARG

#define DISPID_GLOBAL_TESTOPTIONALARG   1017

Definition at line 122 of file run.c.

◆ DISPID_GLOBAL_THROWINT

#define DISPID_GLOBAL_THROWINT   1016

Definition at line 121 of file run.c.

◆ DISPID_GLOBAL_TODO_WINE_OK

#define DISPID_GLOBAL_TODO_WINE_OK   1020

Definition at line 125 of file run.c.

◆ DISPID_GLOBAL_TRACE

#define DISPID_GLOBAL_TRACE   1001

Definition at line 106 of file run.c.

◆ DISPID_GLOBAL_VBVAR

#define DISPID_GLOBAL_VBVAR   1005

Definition at line 110 of file run.c.

◆ DISPID_GLOBAL_WEEKSTARTDAY

#define DISPID_GLOBAL_WEEKSTARTDAY   1021

Definition at line 126 of file run.c.

◆ DISPID_TESTOBJ_PROPGET

#define DISPID_TESTOBJ_PROPGET   2000

Definition at line 128 of file run.c.

◆ DISPID_TESTOBJ_PROPPUT

#define DISPID_TESTOBJ_PROPPUT   2001

Definition at line 129 of file run.c.

◆ FACILITY_VBS

#define FACILITY_VBS   0xa

Definition at line 133 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 134 of file run.c.

◆ parse_htmlscript_a

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

Definition at line 1880 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 568 of file run.c.

Function Documentation

◆ _parse_htmlscript_a()

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

Definition at line 1881 of file run.c.

1882 {
1883  BSTR tmp;
1884  HRESULT hres;
1885 
1886  static const WCHAR script_delimW[] = {'<','/','S','C','R','I','P','T','>',0};
1887 
1888  tmp = a2bstr(src);
1889  hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp, script_delimW);
1890  SysFreeString(tmp);
1891  ok_(__FILE__,line)(hres == S_OK, "parse_script failed: %08x\n", hres);
1892 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1759
OLECHAR * BSTR
Definition: compat.h:1934
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:147
#define ok_(x1, x2)
Definition: atltest.h:61

◆ _test_grfdex()

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

Definition at line 569 of file run.c.

570 {
571  ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
572 }
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 147 of file run.c.

148 {
149  BSTR ret;
150  int len;
151 
152  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
154  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
155 
156  return ret;
157 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
OLECHAR * BSTR
Definition: compat.h:1934
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(), and test_parse_context().

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 1608 of file run.c.

1609 {
1610  return 2;
1611 }

◆ ActiveScriptSite_GetDocVersionString()

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

Definition at line 1638 of file run.c.

1639 {
1640  return E_NOTIMPL;
1641 }
#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 1624 of file run.c.

1626 {
1627  ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
1628  ok(!ppti, "ppti != NULL\n");
1629 
1630  if(strcmp_wa(pstrName, "test"))
1631  ok(0, "unexpected pstrName %s\n", wine_dbgstr_w(pstrName));
1632 
1633  *ppiunkItem = (IUnknown*)&Global;
1634  IUnknown_AddRef(*ppiunkItem);
1635  return S_OK;
1636 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
static IDispatchEx Global
Definition: run.c:1507
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:159
#define ok(value,...)
Definition: atltest.h:57

◆ ActiveScriptSite_GetLCID()

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

Definition at line 1618 of file run.c.

1619 {
1620  *plcid = GetUserDefaultLCID();
1621  return S_OK;
1622 }
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 1676 of file run.c.

1677 {
1678  return E_NOTIMPL;
1679 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 1681 of file run.c.

1682 {
1683  return E_NOTIMPL;
1684 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnScriptError()

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

Definition at line 1654 of file run.c.

1655 {
1657 
1658  if(!expect_OnScriptError) {
1659  EXCEPINFO info;
1660  ULONG line;
1661  HRESULT hres;
1662 
1663  hres = IActiveScriptError_GetSourcePosition(pscripterror, NULL, &line, NULL);
1664  if(SUCCEEDED(hres))
1665  hres = IActiveScriptError_GetExceptionInfo(pscripterror, &info);
1666  if(SUCCEEDED(hres))
1667  trace("Error in line %u: %s\n", line+1, wine_dbgstr_w(info.bstrDescription));
1668  }
1669 
1670  CHECK_EXPECT(OnScriptError);
1672 
1673  return hr;
1674 }
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:145
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:77
char line[200]
Definition: main.c:97
#define CHECK_EXPECT(func)
Definition: run.c:67
struct stdole::EXCEPINFO EXCEPINFO
#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 1643 of file run.c.

1645 {
1646  return E_NOTIMPL;
1647 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnStateChange()

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

Definition at line 1649 of file run.c.

1650 {
1651  return E_NOTIMPL;
1652 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_QueryInterface()

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

Definition at line 1589 of file run.c.

1590 {
1591  *ppv = NULL;
1592 
1594  *ppv = iface;
1595  else if(IsEqualGUID(&IID_IActiveScriptSite, riid))
1596  *ppv = iface;
1597  else if(IsEqualGUID(&IID_IActiveScriptSiteWindow, riid))
1599  else if(IsEqualGUID(&IID_IActiveScriptSiteUIControl, riid))
1601  else
1602  return E_NOINTERFACE;
1603 
1604  IUnknown_AddRef((IUnknown*)*ppv);
1605  return S_OK;
1606 }
static IActiveScriptSiteWindow ActiveScriptSiteWindow
Definition: run.c:1551
#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:1587

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 1613 of file run.c.

1614 {
1615  return 1;
1616 }

◆ ActiveScriptSiteUIControl_AddRef()

static ULONG WINAPI ActiveScriptSiteUIControl_AddRef ( IActiveScriptSiteUIControl iface)
static

Definition at line 1559 of file run.c.

1560 {
1561  return 2;
1562 }

◆ ActiveScriptSiteUIControl_GetUIBehavior()

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

Definition at line 1569 of file run.c.

1571 {
1572  if(!allow_ui) {
1573  CHECK_EXPECT(GetUIBehavior);
1574  ok(UicItem == SCRIPTUICITEM_MSGBOX, "UidItem = %d\n", UicItem);
1575  }
1576  *pUicHandling = uic_handling;
1577  return S_OK;
1578 }
static BOOL allow_ui
Definition: run.c:139
#define CHECK_EXPECT(func)
Definition: run.c:67
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static SCRIPTUICHANDLING uic_handling
Definition: run.c:143

◆ ActiveScriptSiteUIControl_QueryInterface()

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

Definition at line 1553 of file run.c.

1554 {
1555  ok(0, "unexpected call\n");
1556  return E_NOINTERFACE;
1557 }
#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 1564 of file run.c.

1565 {
1566  return 1;
1567 }

◆ ActiveScriptSiteWindow_AddRef()

static ULONG WINAPI ActiveScriptSiteWindow_AddRef ( IActiveScriptSiteWindow iface)
static

Definition at line 1515 of file run.c.

1516 {
1517  return 2;
1518 }

◆ ActiveScriptSiteWindow_EnableModeless()

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

Definition at line 1533 of file run.c.

1534 {
1535  if(allow_ui)
1536  return S_OK;
1537 
1539  ok(!fEnable, "fEnable = %x\n", fEnable);
1540  return E_FAIL;
1541 }
#define EnableModeless(type)
Definition: ordinal.c:3400
#define E_FAIL
Definition: ddrawi.h:102
static BOOL allow_ui
Definition: run.c:139
#define CHECK_EXPECT(func)
Definition: run.c:67
#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 1525 of file run.c.

1526 {
1527  if(!allow_ui)
1529  *phwnd = NULL;
1530  return S_OK;
1531 }
smooth NULL
Definition: ftsmooth.c:416
static BOOL allow_ui
Definition: run.c:139
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
#define CHECK_EXPECT(func)
Definition: run.c:67
#define S_OK
Definition: intsafe.h:59

◆ ActiveScriptSiteWindow_QueryInterface()

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

Definition at line 1509 of file run.c.

1510 {
1511  ok(0, "unexpected call\n");
1512  return E_NOINTERFACE;
1513 }
#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 1520 of file run.c.

1521 {
1522  return 1;
1523 }

◆ check_vbscript()

static BOOL check_vbscript ( void  )
static

Definition at line 2420 of file run.c.

2421 {
2422  IRegExp2 *regexp;
2423  IUnknown *unk;
2424  HRESULT hres;
2425 
2427  CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
2428  &IID_IUnknown, (void**)&unk);
2429  if(hres == REGDB_E_CLASSNOTREG)
2430  return FALSE;
2431  ok(hres == S_OK, "CoCreateInstance(CLSID_VBScriptRegExp) failed: %x\n", hres);
2432 
2433  hres = IUnknown_QueryInterface(unk, &IID_IRegExp2, (void**)&regexp);
2434  if(SUCCEEDED(hres))
2435  IRegExp2_Release(regexp);
2436  IUnknown_Release(unk);
2437 
2438  return hres == S_OK;
2439 }
smooth NULL
Definition: ftsmooth.c:416
const CLSID CLSID_VBScriptRegExp
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
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 1747 of file run.c.

1748 {
1749  ULONG ref;
1750  HRESULT hres;
1751 
1752  hres = IActiveScript_Close(script);
1753  ok(hres == S_OK, "Close failed: %08x\n", hres);
1754 
1755  ref = IActiveScript_Release(script);
1756  ok(!ref, "ref=%u\n", ref);
1757 }
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:77
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
unsigned int ULONG
Definition: retypes.h:1

Referenced by 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 885 of file run.c.

886 {
887  if(!strcmp_wa(bstrName, "reset")) {
889  return S_OK;
890  }
891 
892  ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName));
893  return DISP_E_UNKNOWNNAME;
894 }
#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:131
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:159
#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 896 of file run.c.

898 {
899  switch(id) {
900  case DISPID_NEWENUM:
902  CHECK_EXPECT(collectionobj_newenum_i);
903 
904  ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
905  ok(pdp != NULL, "pdp == NULL\n");
906  ok(!pdp->rgvarg, "rgvarg == NULL\n");
907  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
908  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
909  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
910  ok(pvarRes != NULL, "pvarRes == NULL\n");
911  ok(pei != NULL, "pei == NULL\n");
912 
913  V_VT(pvarRes) = VT_UNKNOWN;
914  V_UNKNOWN(pvarRes) = (IUnknown*)&enumObj;
915  return S_OK;
917  next_cnt = 0;
918  return S_OK;
919  }
920 
921  ok(0, "unexpected call %d\n", id);
922  return E_NOTIMPL;
923 }
static BOOL strict_dispid_check
Definition: run.c:139
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define DISPID_COLLOBJ_RESET
Definition: run.c:131
smooth NULL
Definition: ftsmooth.c:416
static IEnumVARIANT enumObj
Definition: run.c:650
#define V_VT(A)
Definition: oleauto.h:211
#define CHECK_EXPECT(func)
Definition: run.c:67
#define V_UNKNOWN(A)
Definition: oleauto.h:281
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:602
#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)
static

Definition at line 1716 of file run.c.

1717 {
1718  IActiveScriptParse *parser;
1719  IActiveScript *engine;
1720  HRESULT hres;
1721 
1722  engine = create_script();
1723  if(!engine)
1724  return NULL;
1725 
1726  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1727  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1728 
1730  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1731 
1733 
1734  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1735  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1736 
1737  hres = IActiveScript_AddNamedItem(engine, testW,
1738  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
1739  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1740 
1741  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1742  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1743 
1744  return engine;
1745 }
static IActiveScript * create_script(void)
Definition: run.c:1704
static const WCHAR testW[]
Definition: run.c:136
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:77
GLbitfield flags
Definition: glext.h:7161
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1702
Definition: import.c:86

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

◆ create_script()

static IActiveScript* create_script ( void  )
static

Definition at line 1704 of file run.c.

1705 {
1707  HRESULT hres;
1708 
1709  hres = CoCreateInstance(&CLSID_VBScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1710  &IID_IActiveScript, (void**)&script);
1711  ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
1712 
1713  return script;
1714 }
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:77
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/22]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [2/22]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [3/22]

DEFINE_EXPECT ( global_vbvar_d  )

◆ DEFINE_EXPECT() [4/22]

DEFINE_EXPECT ( global_vbvar_i  )

◆ DEFINE_EXPECT() [5/22]

DEFINE_EXPECT ( global_letobj_i  )

◆ DEFINE_EXPECT() [6/22]

DEFINE_EXPECT ( global_setobj_i  )

◆ DEFINE_EXPECT() [7/22]

DEFINE_EXPECT ( testobj_propget_d  )

◆ DEFINE_EXPECT() [8/22]

DEFINE_EXPECT ( testobj_propget_i  )

◆ DEFINE_EXPECT() [9/22]

DEFINE_EXPECT ( testobj_propput_d  )

◆ DEFINE_EXPECT() [10/22]

DEFINE_EXPECT ( testobj_propput_i  )

◆ DEFINE_EXPECT() [11/22]

DEFINE_EXPECT ( testobj_value_i  )

◆ DEFINE_EXPECT() [12/22]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [13/22]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [14/22]

DEFINE_EXPECT ( global_propargput1_d  )

◆ DEFINE_EXPECT() [15/22]

DEFINE_EXPECT ( global_propargput1_i  )

◆ DEFINE_EXPECT() [16/22]

DEFINE_EXPECT ( global_testoptionalarg_i  )

◆ DEFINE_EXPECT() [17/22]

DEFINE_EXPECT ( collectionobj_newenum_i  )

◆ DEFINE_EXPECT() [18/22]

DEFINE_EXPECT ( Next  )

◆ DEFINE_EXPECT() [19/22]

DEFINE_EXPECT ( GetWindow  )

◆ DEFINE_EXPECT() [20/22]

DEFINE_EXPECT ( GetUIBehavior  )

◆ DEFINE_EXPECT() [21/22]

DEFINE_EXPECT ( EnableModeless  )

◆ DEFINE_EXPECT() [22/22]

DEFINE_EXPECT ( OnScriptError  )

◆ detect_locale()

static void detect_locale ( void  )
static

Definition at line 213 of file run.c.

214 {
215  HMODULE kernel32 = GetModuleHandleA("kernel32.dll");
216  LANGID (WINAPI *pGetThreadUILanguage)(void) = (void*)GetProcAddress(kernel32, "GetThreadUILanguage");
217 
218  is_english = ((!pGetThreadUILanguage || PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH) &&
221 
223  (void*)&first_day_of_week, sizeof(first_day_of_week));
224  first_day_of_week = 1 + (first_day_of_week + 1) % 7;
225 }
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:139
INT WINAPI GetLocaleInfoA(LCID lcid, LCTYPE lctype, LPSTR buffer, INT len)
Definition: lang.c:1018
#define LOCALE_USER_DEFAULT
WORD LANGID
Definition: typedefs.h:79
#define WINAPI
Definition: msvc.h:8
#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:140
#define GetProcAddress(x, y)
Definition: compat.h:410
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 669 of file run.c.

670 {
671  return 2;
672 }

◆ DispatchEx_DeleteMemberByDispID()

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

Definition at line 714 of file run.c.

715 {
716  ok(0, "unexpected call\n");
717  return E_NOTIMPL;
718 }
#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 708 of file run.c.

709 {
710  ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
711  return E_NOTIMPL;
712 }
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 744 of file run.c.

745 {
746  ok(0, "unexpected call\n");
747  return E_NOTIMPL;
748 }
#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 692 of file run.c.

695 {
696  ok(0, "unexpected call\n");
697  return E_NOTIMPL;
698 }
#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 726 of file run.c.

727 {
728  ok(0, "unexpected call\n");
729  return E_NOTIMPL;
730 }
#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 720 of file run.c.

721 {
722  ok(0, "unexpected call\n");
723  return E_NOTIMPL;
724 }
#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 738 of file run.c.

739 {
740  ok(0, "unexpected call\n");
741  return E_NOTIMPL;
742 }
#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 732 of file run.c.

733 {
734  ok(0, "unexpected call\n");
735  return E_NOTIMPL;
736 }
#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 685 of file run.c.

687 {
688  ok(0, "unexpected call\n");
689  return E_NOTIMPL;
690 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetTypeInfoCount()

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

Definition at line 679 of file run.c.

680 {
681  ok(0, "unexpected call\n");
682  return E_NOTIMPL;
683 }
#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 700 of file run.c.

703 {
704  ok(0, "unexpected call\n");
705  return E_NOTIMPL;
706 }
#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 750 of file run.c.

752 {
753  ok(0, "unexpected call %d\n", id);
754  return E_NOTIMPL;
755 }
#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 652 of file run.c.

653 {
654  *ppv = NULL;
655 
658  || IsEqualGUID(riid, &IID_IDispatchEx))
659  *ppv = iface;
660  else {
661  trace("QI %s\n", wine_dbgstr_guid(riid));
662  return E_NOINTERFACE;
663  }
664 
665  IUnknown_AddRef((IUnknown*)*ppv);
666  return S_OK;
667 }
#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 674 of file run.c.

675 {
676  return 1;
677 }

◆ enumDisp_QueryInterface()

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

Definition at line 860 of file run.c.

861 {
862  return IEnumVARIANT_QueryInterface(&enumObj, riid, ppv);
863 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IEnumVARIANT enumObj
Definition: run.c:650

◆ EnumVARIANT_AddRef()

static ULONG WINAPI EnumVARIANT_AddRef ( IEnumVARIANT iface)
static

Definition at line 592 of file run.c.

593 {
594  return 2;
595 }

◆ EnumVARIANT_Clone()

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

Definition at line 634 of file run.c.

635 {
636  ok(0, "unexpected call\n");
637  return E_NOTIMPL;
638 }
#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 604 of file run.c.

605 {
607  CHECK_EXPECT2(Next);
608 
609  ok(celt == 1, "celt = %d\n", celt);
610  ok(V_VT(rgVar) == VT_EMPTY, "V_VT(rgVar) = %d\n", V_VT(rgVar));
611  ok(!pCeltFetched, "pCeltFetched = %p\n", pCeltFetched);
612 
613  if(next_cnt++ < 3) {
614  V_VT(rgVar) = VT_I2;
615  V_I2(rgVar) = next_cnt;
616  return S_OK;
617  }
618 
619  return S_FALSE;
620 }
static BOOL strict_dispid_check
Definition: run.c:139
#define V_I2(A)
Definition: oleauto.h:245
#define S_FALSE
Definition: winerror.h:2357
#define CHECK_EXPECT2(func)
Definition: run.c:61
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:602
#define ok(value,...)
Definition: atltest.h:57
Definition: compat.h:1938

◆ EnumVARIANT_QueryInterface()

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

Definition at line 576 of file run.c.

577 {
578  if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumVARIANT)) {
579  *ppv = iface;
580  return S_OK;
581  }
582 
584  *ppv = &enumDisp;
585  return S_OK;
586  }
587 
588  ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
589  return E_NOINTERFACE;
590 }
#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:574
#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 597 of file run.c.

598 {
599  return 1;
600 }

◆ EnumVARIANT_Reset()

static HRESULT WINAPI EnumVARIANT_Reset ( IEnumVARIANT iface)
static

Definition at line 628 of file run.c.

629 {
630  ok(0, "unexpected call\n");
631  return E_NOTIMPL;
632 }
#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 622 of file run.c.

623 {
624  ok(0, "unexpected call\n");
625  return E_NOTIMPL;
626 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ get_script_from_file()

static BSTR get_script_from_file ( const char filename)
static

Definition at line 2107 of file run.c.

2108 {
2109  DWORD size, len;
2110  HANDLE file, map;
2111  const char *file_map;
2112  BSTR ret;
2113 
2115  if(file == INVALID_HANDLE_VALUE) {
2116  trace("Could not open file: %u\n", GetLastError());
2117  return NULL;
2118  }
2119 
2120  size = GetFileSize(file, NULL);
2121 
2123  CloseHandle(file);
2124  if(map == INVALID_HANDLE_VALUE) {
2125  trace("Could not create file mapping: %u\n", GetLastError());
2126  return NULL;
2127  }
2128 
2129  file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
2130  CloseHandle(map);
2131  if(!file_map) {
2132  trace("MapViewOfFile failed: %u\n", GetLastError());
2133  return NULL;
2134  }
2135 
2136  len = MultiByteToWideChar(CP_ACP, 0, file_map, size, NULL, 0);
2138  MultiByteToWideChar(CP_ACP, 0, file_map, size, ret, len);
2139 
2140  UnmapViewOfFile(file_map);
2141 
2142  return ret;
2143 }
#define CloseHandle
Definition: compat.h:398
#define MapViewOfFile
Definition: compat.h:402
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
OLECHAR * BSTR
Definition: compat.h:1934
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:427
#define OPEN_EXISTING
Definition: compat.h:426
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:401
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:399
#define UnmapViewOfFile
Definition: compat.h:403
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 979 of file run.c.

980 {
981  return ++global_ref;
982 }
static ULONG global_ref
Definition: run.c:977

◆ Global_GetDispID()

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

Definition at line 989 of file run.c.

990 {
991  if(!strcmp_wa(bstrName, "ok")) {
992  test_grfdex(grfdex, fdexNameCaseInsensitive);
994  return S_OK;
995  }
996  if(!strcmp_wa(bstrName, "todo_wine_ok")) {
997  test_grfdex(grfdex, fdexNameCaseInsensitive);
999  return S_OK;
1000  }
1001  if(!strcmp_wa(bstrName, "trace")) {
1002  test_grfdex(grfdex, fdexNameCaseInsensitive);
1004  return S_OK;
1005  }
1006  if(!strcmp_wa(bstrName, "reportSuccess")) {
1007  CHECK_EXPECT(global_success_d);
1008  test_grfdex(grfdex, fdexNameCaseInsensitive);
1010  return S_OK;
1011  }
1012  if(!strcmp_wa(bstrName, "getVT")) {
1013  test_grfdex(grfdex, fdexNameCaseInsensitive);
1015  return S_OK;
1016  }
1017  if(!strcmp_wa(bstrName, "isEnglishLang")) {
1018  test_grfdex(grfdex, fdexNameCaseInsensitive);
1020  return S_OK;
1021  }
1022  if(!strcmp_wa(bstrName, "firstDayOfWeek")) {
1023  test_grfdex(grfdex, fdexNameCaseInsensitive);
1025  return S_OK;
1026  }
1027  if(!strcmp_wa(bstrName, "testObj")) {
1028  test_grfdex(grfdex, fdexNameCaseInsensitive);
1030  return S_OK;
1031  }
1032  if(!strcmp_wa(bstrName, "collectionObj")) {
1033  test_grfdex(grfdex, fdexNameCaseInsensitive);
1035  return S_OK;
1036  }
1037  if(!strcmp_wa(bstrName, "vbvar")) {
1038  CHECK_EXPECT(global_vbvar_d);
1039  test_grfdex(grfdex, fdexNameCaseInsensitive);
1041  return S_OK;
1042  }
1043  if(!strcmp_wa(bstrName, "letobj")) {
1044  test_grfdex(grfdex, fdexNameCaseInsensitive);
1046  return S_OK;
1047  }
1048  if(!strcmp_wa(bstrName, "setobj")) {
1049  test_grfdex(grfdex, fdexNameCaseInsensitive);
1051  return S_OK;
1052  }
1053  if(!strcmp_wa(bstrName, "isNullDisp")) {
1054  test_grfdex(grfdex, fdexNameCaseInsensitive);
1056  return S_OK;
1057  }
1058  if(!strcmp_wa(bstrName, "testDisp")) {
1059  test_grfdex(grfdex, fdexNameCaseInsensitive);
1061  return S_OK;
1062  }
1063  if(!strcmp_wa(bstrName, "RefObj")) {
1064  test_grfdex(grfdex, fdexNameCaseInsensitive);
1066  return S_OK;
1067  }
1068  if(!strcmp_wa(bstrName, "propargput")) {
1069  CHECK_EXPECT(global_propargput_d);
1070  test_grfdex(grfdex, fdexNameCaseInsensitive);
1072  return S_OK;
1073  }
1074  if(!strcmp_wa(bstrName, "propargput1")) {
1075  CHECK_EXPECT(global_propargput1_d);
1076  test_grfdex(grfdex, fdexNameCaseInsensitive);
1078  return S_OK;
1079  }
1080  if(!strcmp_wa(bstrName, "counter")) {
1081  test_grfdex(grfdex, fdexNameCaseInsensitive);
1083  return S_OK;
1084  }
1085  if(!strcmp_wa(bstrName, "doubleAsString")) {
1086  test_grfdex(grfdex, fdexNameCaseInsensitive);
1088  return S_OK;
1089  }
1090  if(!strcmp_wa(bstrName, "testArray")) {
1091  test_grfdex(grfdex, fdexNameCaseInsensitive);
1093  return S_OK;
1094  }
1095  if(!strcmp_wa(bstrName, "throwInt")) {
1096  test_grfdex(grfdex, fdexNameCaseInsensitive);
1098  return S_OK;
1099  }
1100  if(!strcmp_wa(bstrName, "testOptionalArg")) {
1101  test_grfdex(grfdex, fdexNameCaseInsensitive);
1103  return S_OK;
1104  }
1105 
1106  if(strict_dispid_check && strcmp_wa(bstrName, "x"))
1107  ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
1108  return DISP_E_UNKNOWNNAME;
1109 }
#define DISPID_GLOBAL_PROPARGPUT1
Definition: run.c:117
#define DISPID_GLOBAL_THROWINT
Definition: run.c:121
#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:139
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:116
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:105
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_REFOBJ
Definition: run.c:114
#define DISPID_GLOBAL_OK
Definition: run.c:107
#define DISPID_GLOBAL_ISENGLANG
Definition: run.c:109
#define DISPID_GLOBAL_LETOBJ
Definition: run.c:123
#define DISPID_GLOBAL_GETVT
Definition: run.c:108
#define DISPID_GLOBAL_TESTDISP
Definition: run.c:113
#define DISPID_GLOBAL_TODO_WINE_OK
Definition: run.c:125
#define DISPID_GLOBAL_TRACE
Definition: run.c:106
#define DISPID_GLOBAL_TESTOPTIONALARG
Definition: run.c:122
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:111
#define DISPID_GLOBAL_TESTARRAY
Definition: run.c:120
#define CHECK_EXPECT(func)
Definition: run.c:67
#define DISPID_GLOBAL_COLLOBJ
Definition: run.c:118
#define DISPID_GLOBAL_WEEKSTARTDAY
Definition: run.c:126
#define S_OK
Definition: intsafe.h:59
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:159
#define DISPID_GLOBAL_DOUBLEASSTRING
Definition: run.c:119
#define ok(value,...)
Definition: atltest.h:57
#define DISPID_GLOBAL_COUNTER
Definition: run.c:115
#define DISPID_GLOBAL_VBVAR
Definition: run.c:110
#define DISPID_GLOBAL_SETOBJ
Definition: run.c:124
#define test_grfdex(a, b)
Definition: run.c:568
#define DISPID_GLOBAL_ISNULLDISP
Definition: run.c:112

◆ 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 1111 of file run.c.

1113 {
1114  switch(id) {
1116  case DISPID_GLOBAL_OK: {
1117  VARIANT *b;
1118 
1119  ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1120  ok(pdp != NULL, "pdp == NULL\n");
1121  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1122  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1123  ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1124  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1125  if(wFlags & INVOKE_PROPERTYGET)
1126  ok(pvarRes != NULL, "pvarRes == NULL\n");
1127  else
1128  ok(!pvarRes, "pvarRes != NULL\n");
1129  ok(pei != NULL, "pei == NULL\n");
1130 
1131  ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1132 
1133  b = pdp->rgvarg+1;
1134  if(V_VT(b) == (VT_BYREF|VT_VARIANT))
1135  b = V_BYREF(b);
1136 
1137  ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b));
1138 
1140  ok(V_BOOL(b), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1141  return S_OK;
1142  }
1143 
1144  case DISPID_GLOBAL_TRACE:
1145  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1146  ok(pdp != NULL, "pdp == NULL\n");
1147  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1148  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1149  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1150  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1151  ok(!pvarRes, "pvarRes != NULL\n");
1152  ok(pei != NULL, "pei == NULL\n");
1153 
1154  ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1155  if(V_VT(pdp->rgvarg) == VT_BSTR)
1156  trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1157 
1158  return S_OK;
1159 
1161  CHECK_EXPECT(global_success_i);
1162 
1163  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1164  ok(pdp != NULL, "pdp == NULL\n");
1165  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1166  ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1167  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1168  ok(!pvarRes, "pvarRes != NULL\n");
1169  ok(pei != NULL, "pei == NULL\n");
1170 
1171  return S_OK;
1172 
1173  case DISPID_GLOBAL_GETVT:
1174  ok(pdp != NULL, "pdp == NULL\n");
1175  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1176  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1177  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1178  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1179  ok(pvarRes != NULL, "pvarRes == NULL\n");
1180  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1181  ok(pei != NULL, "pei == NULL\n");
1182 
1183  V_VT(pvarRes) = VT_BSTR;
1184  V_BSTR(pvarRes) = a2bstr(vt2a(pdp->rgvarg));
1185  return S_OK;
1186 
1188  ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1189  ok(pdp != NULL, "pdp == NULL\n");
1190  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1191  ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1192  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1193  ok(pvarRes != NULL, "pvarRes == NULL\n");
1194  ok(pei != NULL, "pei == NULL\n");
1195 
1196  V_VT(pvarRes) = VT_BOOL;
1197  V_BOOL(pvarRes) = is_english ? VARIANT_TRUE : VARIANT_FALSE;
1198  return S_OK;
1199 
1201  V_VT(pvarRes) = VT_I4;
1202  V_I4(pvarRes) = first_day_of_week;
1203  return S_OK;
1204 
1205  case DISPID_GLOBAL_VBVAR:
1206  CHECK_EXPECT(global_vbvar_i);
1207 
1208  ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1209  ok(pdp != NULL, "pdp == NULL\n");
1210  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1211  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1212  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1213  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1214  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1215  ok(!pvarRes, "pvarRes != NULL\n");
1216  ok(pei != NULL, "pei == NULL\n");
1217 
1218  ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1219  ok(V_I2(pdp->rgvarg) == 3, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1220  return S_OK;
1221 
1222  case DISPID_GLOBAL_LETOBJ:
1223  CHECK_EXPECT(global_letobj_i);
1224 
1225  ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1226  ok(pdp != NULL, "pdp == NULL\n");
1227  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1228  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1229  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1230  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1231  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1232  ok(!pvarRes, "pvarRes != NULL\n");
1233  ok(pei != NULL, "pei == NULL\n");
1234 
1235  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1236  ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n");
1237  return S_OK;
1238 
1239  case DISPID_GLOBAL_SETOBJ:
1240  CHECK_EXPECT(global_setobj_i);
1241 
1242  ok(wFlags == DISPATCH_PROPERTYPUTREF, "wFlags = %x\n", wFlags);
1243  ok(pdp != NULL, "pdp == NULL\n");
1244  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1245  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1246  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1247  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1248  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1249  ok(!pvarRes, "pvarRes != NULL\n");
1250  ok(pei != NULL, "pei == NULL\n");
1251 
1252  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1253  ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)&testObj, "V_DISPATCH(psp->rgvargs) != testObj\n");
1254  return S_OK;
1255 
1256  case DISPID_GLOBAL_TESTOBJ:
1257  ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1258 
1259  ok(pdp != NULL, "pdp == NULL\n");
1260  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1261  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1262  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1263  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1264  ok(pvarRes != NULL, "pvarRes == NULL\n");
1265  ok(pei != NULL, "pei == NULL\n");
1266 
1267  V_VT(pvarRes) = VT_DISPATCH;
1268  V_DISPATCH(pvarRes) = (IDispatch*)&testObj;
1269  return S_OK;
1270 
1271  case DISPID_GLOBAL_COLLOBJ:
1272  ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1273 
1274  ok(pdp != NULL, "pdp == NULL\n");
1275  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1276  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1277  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1278  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1279  ok(pvarRes != NULL, "pvarRes == NULL\n");
1280  ok(pei != NULL, "pei == NULL\n");
1281 
1282  V_VT(pvarRes) = VT_DISPATCH;
1283  V_DISPATCH(pvarRes) = (IDispatch*)&collectionObj;
1284  return S_OK;
1285 
1286  case DISPID_GLOBAL_REFOBJ:
1287  ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
1288 
1289  ok(pdp != NULL, "pdp == NULL\n");
1290  ok(!pdp->rgvarg, "rgvarg == NULL\n");
1291  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1292  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1293  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1294  ok(pvarRes != NULL, "pvarRes == NULL\n");
1295  ok(pei != NULL, "pei == NULL\n");
1296 
1297  IDispatchEx_AddRef(&RefObj);
1298  V_VT(pvarRes) = VT_DISPATCH;
1299  V_DISPATCH(pvarRes) = (IDispatch*)&RefObj;
1300  return S_OK;
1301 
1302  case DISPID_GLOBAL_ISNULLDISP: {
1303  VARIANT *v;
1304 
1305  ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1306  ok(pdp != NULL, "pdp == NULL\n");
1307  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1308  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1309  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1310  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1311  ok(pvarRes != NULL, "pvarRes == NULL\n");
1312  ok(pei != NULL, "pei == NULL\n");
1313 
1314  v = pdp->rgvarg;
1315  if(V_VT(v) == (VT_VARIANT|VT_BYREF))
1316  v = V_VARIANTREF(v);
1317 
1318  ok(V_VT(v) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1319  V_VT(pvarRes) = VT_BOOL;
1320  V_BOOL(pvarRes) = V_DISPATCH(v) ? VARIANT_FALSE : VARIANT_TRUE;
1321  return S_OK;
1322  }
1323 
1325  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1326  ok(pdp != NULL, "pdp == NULL\n");
1327  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1328  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1329  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1330  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1331  ok(!pvarRes, "pvarRes != NULL\n");
1332  ok(pei != NULL, "pei == NULL\n");
1333 
1334  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1335  test_disp(V_DISPATCH(pdp->rgvarg));
1336  return S_OK;
1337 
1339  CHECK_EXPECT(global_propargput_i);
1340 
1341  ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1342  ok(pdp != NULL, "pdp == NULL\n");
1343  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1344  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1345  ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1346  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1347  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1348  ok(!pvarRes, "pvarRes != NULL\n");
1349  ok(pei != NULL, "pei == NULL\n");
1350 
1351  ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1352  ok(V_I2(pdp->rgvarg) == 0, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1353 
1354  ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1355  ok(V_I2(pdp->rgvarg+1) == 2, "V_I2(psp->rgvargs+1) = %d\n", V_I2(pdp->rgvarg+1));
1356 
1357  ok(V_VT(pdp->rgvarg+2) == VT_I2, "V_VT(psp->rgvargs+2) = %d\n", V_VT(pdp->rgvarg+2));
1358  ok(V_I2(pdp->rgvarg+2) == 1, "V_I2(psp->rgvargs+2) = %d\n", V_I2(pdp->rgvarg+2));
1359  return S_OK;
1360 
1362  CHECK_EXPECT(global_propargput1_i);
1363 
1364  ok(wFlags == DISPATCH_PROPERTYPUT, "wFlags = %x\n", wFlags);
1365  ok(pdp != NULL, "pdp == NULL\n");
1366  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1367  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1368  ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1369  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1370  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1371  ok(!pvarRes, "pvarRes != NULL\n");
1372  ok(pei != NULL, "pei == NULL\n");
1373 
1374  ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1375  ok(V_I2(pdp->rgvarg) == 0, "V_I2(psp->rgvargs) = %d\n", V_I2(pdp->rgvarg));
1376 
1377  ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1378  ok(V_I2(pdp->rgvarg+1) == 1, "V_I2(psp->rgvargs+1) = %d\n", V_I2(pdp->rgvarg+1));
1379 
1380  return S_OK;
1381 
1382  case DISPID_GLOBAL_COUNTER:
1383  ok(pdp != NULL, "pdp == NULL\n");
1384  todo_wine ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1385  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1386  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1387  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1388  ok(pvarRes != NULL, "pvarRes == NULL\n");
1389  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1390  ok(pei != NULL, "pei == NULL\n");
1391 
1392  V_VT(pvarRes) = VT_I2;
1393  V_I2(pvarRes) = test_counter++;
1394  return S_OK;
1395 
1397  ok(wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1398  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1399  ok(V_VT(pdp->rgvarg) == VT_R8, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1400  ok(pvarRes != NULL, "pvarRes == NULL\n");
1401 
1402  V_VT(pvarRes) = VT_BSTR;
1403  return VarBstrFromR8(V_R8(pdp->rgvarg), 0, 0, &V_BSTR(pvarRes));
1404 
1406  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1407  ok(pdp != NULL, "pdp == NULL\n");
1408  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1409  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1410  ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1411  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1412  ok(!pvarRes, "pvarRes != NULL\n");
1413  ok(pei != NULL, "pei == NULL\n");
1414 
1415  ok(V_VT(pdp->rgvarg+1) == VT_I2, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg+1));
1416  ok(V_VT(pdp->rgvarg) == (VT_BYREF|VT_VARIANT), "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
1417  ok(V_VT(V_VARIANTREF(pdp->rgvarg)) == (VT_ARRAY|VT_BYREF|VT_VARIANT),
1418  "V_VT(V_VARIANTREF(psp->rgvargs)) = %d\n", V_VT(V_VARIANTREF(pdp->rgvarg)));
1419  if(V_I2(pdp->rgvarg+1) == -1)
1420  ok(!*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)), "*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)) != NULL\n");
1421  else
1422  test_safearray(*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)), V_I2(pdp->rgvarg+1));
1423  return S_OK;
1424 
1425  case DISPID_GLOBAL_THROWINT: {
1426  VARIANT *v = pdp->rgvarg;
1427  HRESULT hres;
1428 
1429  ok((wFlags & ~INVOKE_PROPERTYGET) == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1430  ok(pdp != NULL, "pdp == NULL\n");
1431  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1432  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1433  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1434  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1435  ok(pei != NULL, "pei == NULL\n");
1436  if(pvarRes) {
1437  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1438  V_VT(pvarRes) = VT_BOOL;
1439  V_BOOL(pvarRes) = VARIANT_FALSE;
1440  }
1441 
1442  if(V_VT(v) == (VT_VARIANT|VT_BYREF))
1443  v = V_VARIANTREF(v);
1444 
1445  switch(V_VT(v)) {
1446  case VT_I2:
1447  hres = V_I2(v);
1448  break;
1449  case VT_I4:
1450  hres = V_I4(v);
1451  break;
1452  default:
1453  ok(0, "unexpected vt %d\n", V_VT(v));
1454  return E_INVALIDARG;
1455  }
1456 
1457  return hres;
1458  }
1459 
1461  VARIANT *v;
1462  int opt;
1463 
1464  CHECK_EXPECT(global_testoptionalarg_i);
1465 
1466  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1467  ok(pdp != NULL, "pdp == NULL\n");
1468  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1469  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1470  ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1471  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1472  ok(!pvarRes, "pvarRes != NULL\n");
1473  ok(pei != NULL, "pei == NULL\n");
1474 
1475  ok(V_VT(pdp->rgvarg) == VT_I2, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1476  opt = V_I2(pdp->rgvarg);
1477  ok(opt == 1 || opt == 2, "opt = %d\n", opt);
1478  v = pdp->rgvarg+pdp->cArgs-opt;
1479  ok(V_VT(v) == VT_ERROR, "V_VT(v) = %d\n", V_VT(v));
1480  ok(V_ERROR(v) == DISP_E_PARAMNOTFOUND, "V_ERROR(v) = %08x\n", V_ERROR(v));
1481  return S_OK;
1482  }
1483  }
1484 
1485  ok(0, "unexpected call %d\n", id);
1486  return DISP_E_MEMBERNOTFOUND;
1487 }
#define DISPID_GLOBAL_PROPARGPUT1
Definition: run.c:117
#define DISPID_GLOBAL_THROWINT
Definition: run.c:121
Definition: compat.h:1939
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
static const char * vt2a(VARIANT *v)
Definition: run.c:166
static BOOL is_english
Definition: run.c:139
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:116
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:105
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_REFOBJ
Definition: run.c:114
#define V_R8(A)
Definition: oleauto.h:262
#define V_I2(A)
Definition: oleauto.h:245
static const char * test_name
Definition: run.c:141
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPID_GLOBAL_OK
Definition: run.c:107
static int test_counter
Definition: run.c:142
#define DISPID_GLOBAL_ISENGLANG
Definition: run.c:109
#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
#define DISPID_GLOBAL_LETOBJ
Definition: run.c:123
static IDispatchEx collectionObj
Definition: run.c:943
#define V_ARRAYREF(A)
Definition: oleauto.h:223
#define V_BYREF(A)
Definition: oleauto.h:228
#define DISPID_GLOBAL_GETVT
Definition: run.c:108
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define DISPID_GLOBAL_TESTDISP
Definition: run.c:113
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define b
Definition: ke_i.h:79
#define DISPID_GLOBAL_TODO_WINE_OK
Definition: run.c:125
#define DISPID_GLOBAL_TRACE
Definition: run.c:106
#define todo_wine_if(is_todo)
Definition: test.h:155
#define DISPID_GLOBAL_TESTOPTIONALARG
Definition: run.c:122
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:111
LONG HRESULT
Definition: typedefs.h:77
#define V_BOOL(A)
Definition: oleauto.h:224
HRESULT WINAPI VarBstrFromR8(double dblIn, LCID lcid, ULONG dwFlags, BSTR *pbstrOut)
Definition: vartype.c:6586
#define todo_wine
Definition: test.h:154
#define DISPID_GLOBAL_TESTARRAY
Definition: run.c:120
#define V_VT(A)
Definition: oleauto.h:211
#define CHECK_EXPECT(func)
Definition: run.c:67
static void test_disp(IDispatch *disp)
Definition: run.c:259
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009
static IDispatchEx RefObj
Definition: run.c:975
static IDispatchEx testObj
Definition: run.c:144
#define DISPID_GLOBAL_COLLOBJ
Definition: run.c:118
#define DISPID_GLOBAL_WEEKSTARTDAY
Definition: run.c:126
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define DISPID_GLOBAL_DOUBLEASSTRING
Definition: run.c:119
#define ok(value,...)
Definition: atltest.h:57
#define V_ERROR(A)
Definition: oleauto.h:241
static BSTR a2bstr(const char *str)
Definition: run.c:147
#define DISPID_GLOBAL_COUNTER
Definition: run.c:115
#define DISPID_GLOBAL_VBVAR
Definition: run.c:110
static int first_day_of_week
Definition: run.c:140
#define DISPID_GLOBAL_SETOBJ
Definition: run.c:124
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define DISPID_GLOBAL_ISNULLDISP
Definition: run.c:112
Definition: compat.h:1941
Definition: compat.h:1938
static void test_safearray(SAFEARRAY *safearray, unsigned indims)
Definition: run.c:548

◆ Global_Release()

static ULONG WINAPI Global_Release ( IDispatchEx *  iface)
static

Definition at line 984 of file run.c.

985 {
986  return --global_ref;
987 }
static ULONG global_ref
Definition: run.c:977

◆ parse_procedure()

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

Definition at line 1894 of file run.c.

1895 {
1896  IDispatchEx *dispex;
1897  IDispatch *disp;
1898  BSTR str;
1899  HRESULT hres;
1900 
1901  static const WCHAR delimiterW[] = {'\"',0};
1902 
1903  str = a2bstr(src);
1904  hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, str, NULL, emptyW, NULL, NULL, delimiterW, 0, 0,
1905  SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
1906  SysFreeString(str);
1907  ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
1908  ok(disp != NULL, "disp = NULL\n");
1909 
1910  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1911  IDispatch_Release(disp);
1912  ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1913 
1914  return dispex;
1915 }
disp
Definition: i386-dis.c:3181
static const WCHAR emptyW[]
Definition: run.c:137
OLECHAR * BSTR
Definition: compat.h:1934
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:77
#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:274
static BSTR a2bstr(const char *str)
Definition: run.c:147

Referenced by test_procedures().

◆ parse_script()

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

Definition at line 1759 of file run.c.

1760 {
1761  IActiveScriptParse *parser;
1762  IActiveScript *engine;
1764  LONG ref;
1765  HRESULT hres;
1766 
1767  engine = create_and_init_script(flags);
1768  if(!engine)
1769  return S_OK;
1770 
1771  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1772  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1773  if (FAILED(hres))
1774  {
1775  IActiveScript_Release(engine);
1776  return hres;
1777  }
1778 
1779  hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
1780  ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
1781  ok(script_disp != NULL, "script_disp == NULL\n");
1782  ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
1783 
1784  test_counter = 0;
1785 
1786  hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, delim, 0, 0, 0, NULL, NULL);
1787 
1788  IActiveScript_Close(engine);
1789 
1790  IDispatch_Release(script_disp);
1791  IActiveScript_Release(engine);
1792 
1794  ok(!ref, "ref=%d\n", ref);
1795  return hres;
1796 }
static int test_counter
Definition: run.c:142
static IDispatchEx Global
Definition: run.c:1507
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static IActiveScript * create_and_init_script(DWORD flags)
Definition: run.c:1716
smooth NULL
Definition: ftsmooth.c:416
#define IActiveScriptParse_Release
Definition: run.c:44
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
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:86

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 1875 of file run.c.

1876 {
1877  parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src);
1878 }
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:1798
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 1798 of file run.c.

1799 {
1800  BSTR tmp;
1801  HRESULT hres;
1802 
1803  tmp = a2bstr(src);
1804  hres = parse_script(flags, tmp, NULL);
1805  SysFreeString(tmp);
1806  ok(hres == S_OK, "parse_script failed: %08x\n", hres);
1807 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1759
OLECHAR * BSTR
Definition: compat.h:1934
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
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:274
static BSTR a2bstr(const char *str)
Definition: run.c:147

Referenced by parse_script_a(), and run_tests().

◆ parse_script_ar()

static HRESULT parse_script_ar ( const char src)
static

Definition at line 1809 of file run.c.

1810 {
1811  BSTR tmp;
1812  HRESULT hres;
1813 
1814  tmp = a2bstr(src);
1815  hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp, NULL);
1816  SysFreeString(tmp);
1817  return hres;
1818 }
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1759
OLECHAR * BSTR
Definition: compat.h:1934
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum src
Definition: glext.h:6340
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:147

Referenced by run_tests(), and test_msgbox().

◆ RefObj_AddRef()

static ULONG WINAPI RefObj_AddRef ( IDispatchEx *  iface)
static

Definition at line 947 of file run.c.

948 {
949  return ++refobj_ref;
950 }
static ULONG refobj_ref
Definition: run.c:945

◆ RefObj_Release()

static ULONG WINAPI RefObj_Release ( IDispatchEx *  iface)
static

Definition at line 952 of file run.c.

953 {
954  return --refobj_ref;
955 }
static ULONG refobj_ref
Definition: run.c:945

◆ run_from_file()

static void run_from_file ( const char filename)
static

Definition at line 2145 of file run.c.

2146 {
2147  BSTR script_str;
2148  HRESULT hres;
2149 
2150  script_str = get_script_from_file(filename);
2151  if(!script_str)
2152  return;
2153 
2155  hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str, NULL);
2156  SysFreeString(script_str);
2157  ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2158 }
static BOOL strict_dispid_check
Definition: run.c:139
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1759
OLECHAR * BSTR
Definition: compat.h:1934
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
static BSTR get_script_from_file(const char *filename)
Definition: run.c:2107
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274

Referenced by START_TEST().

◆ run_from_res()

static void run_from_res ( const char name)
static

Definition at line 2160 of file run.c.

2161 {
2162  const char *data;
2163  DWORD size, len;
2164  BSTR str;
2165  HRSRC src;
2166  HRESULT hres;
2167 
2169  test_name = name;
2170 
2171  src = FindResourceA(NULL, name, (LPCSTR)40);
2172  ok(src != NULL, "Could not find resource %s\n", name);
2173 
2175  data = LoadResource(NULL, src);
2176 
2180 
2181  SET_EXPECT(global_success_d);
2182  SET_EXPECT(global_success_i);
2183  hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, str, NULL);
2184  CHECK_CALLED(global_success_d);
2185  CHECK_CALLED(global_success_i);
2186 
2187  ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2188  SysFreeString(str);
2189 }
static BOOL strict_dispid_check
Definition: run.c:139
static HRESULT parse_script(DWORD flags, BSTR script_str, const WCHAR *delim)
Definition: run.c:1759
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#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:141
OLECHAR * BSTR
Definition: compat.h:1934
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:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CHECK_CALLED(func)
Definition: run.c:73
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:274
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by run_tests().

◆ run_tests()

static void run_tests ( void  )
static

Definition at line 2191 of file run.c.

2192 {
2193  HRESULT hres;
2194 
2196 
2197  parse_script_a("");
2198  parse_script_a("' empty ;");
2199 
2200  SET_EXPECT(global_success_d);
2201  SET_EXPECT(global_success_i);
2202  parse_script_a("reportSuccess");
2203  CHECK_CALLED(global_success_d);
2204  CHECK_CALLED(global_success_i);
2205 
2206  SET_EXPECT(global_success_d);
2207  SET_EXPECT(global_success_i);
2208  parse_script_a("reportSuccess()");
2209  CHECK_CALLED(global_success_d);
2210  CHECK_CALLED(global_success_i);
2211 
2212  SET_EXPECT(global_success_d);
2213  SET_EXPECT(global_success_i);
2214  parse_script_a("Call reportSuccess");
2215  CHECK_CALLED(global_success_d);
2216  CHECK_CALLED(global_success_i);
2217 
2218  SET_EXPECT(global_success_d);
2219  SET_EXPECT(global_success_i);
2220  parse_script_a("test.reportSuccess()");
2221  CHECK_CALLED(global_success_d);
2222  CHECK_CALLED(global_success_i);
2223 
2224  SET_EXPECT(global_success_d);
2225  SET_EXPECT(global_success_i);
2226  parse_script_af(0, "TEST.reportSuccess()");
2227  CHECK_CALLED(global_success_d);
2228  CHECK_CALLED(global_success_i);
2229 
2230  SET_EXPECT(global_vbvar_d);
2231  SET_EXPECT(global_vbvar_i);
2232  parse_script_a("Option Explicit\nvbvar = 3");
2233  CHECK_CALLED(global_vbvar_d);
2234  CHECK_CALLED(global_vbvar_i);
2235 
2236  SET_EXPECT(global_vbvar_d);
2237  SET_EXPECT(global_vbvar_i);
2238  parse_script_a("Option Explicit\nvbvar() = 3");
2239  CHECK_CALLED(global_vbvar_d);
2240  CHECK_CALLED(global_vbvar_i);
2241 
2242  SET_EXPECT(global_letobj_i);
2243  parse_script_a("Option Explicit\nletobj = testObj");
2244  CHECK_CALLED(global_letobj_i);
2245 
2246  SET_EXPECT(global_letobj_i);
2247  parse_script_a("Option Explicit\ntest.letobj = testObj");
2248  CHECK_CALLED(global_letobj_i);
2249 
2250  SET_EXPECT(global_setobj_i);
2251  parse_script_a("Option Explicit\nset setobj = testObj");
2252  CHECK_CALLED(global_setobj_i);
2253 
2254  SET_EXPECT(global_setobj_i);
2255  parse_script_a("Option Explicit\nset test.setobj = testObj");
2256  CHECK_CALLED(global_setobj_i);
2257 
2258  SET_EXPECT(testobj_propget_d);
2259  SET_EXPECT(testobj_propget_i);
2260  parse_script_a("dim x\nx = testObj.propget");
2261  CHECK_CALLED(testobj_propget_d);
2262  CHECK_CALLED(testobj_propget_i);
2263 
2264  SET_EXPECT(testobj_propput_d);
2265  SET_EXPECT(testobj_propput_i);
2266  parse_script_a("testObj.propput = 1");
2267  CHECK_CALLED(testobj_propput_d);
2268  CHECK_CALLED(testobj_propput_i);
2269 
2270  SET_EXPECT(global_propargput_d);
2271  SET_EXPECT(global_propargput_i);
2272  parse_script_a("propargput(counter(), counter()) = counter()");
2273  CHECK_CALLED(global_propargput_d);
2274  CHECK_CALLED(global_propargput_i);
2275 
2276  SET_EXPECT(global_propargput_d);
2277  SET_EXPECT(global_propargput_i);
2278  parse_script_a("test.propargput(counter(), counter()) = counter()");
2279  CHECK_CALLED(global_propargput_d);
2280  CHECK_CALLED(global_propargput_i);
2281 
2282  SET_EXPECT(global_propargput1_d);
2283  SET_EXPECT(global_propargput1_i);
2284  parse_script_a("propargput1 (counter()) = counter()");
2285  CHECK_CALLED(global_propargput1_d);
2286  CHECK_CALLED(global_propargput1_i);
2287 
2288  SET_EXPECT(global_propargput1_d);
2289  SET_EXPECT(global_propargput1_i);
2290  parse_script_a("test.propargput1(counter()) = counter()");
2291  CHECK_CALLED(global_propargput1_d);
2292  CHECK_CALLED(global_propargput1_i);
2293 
2294  parse_htmlscript_a("<!--");
2295  parse_htmlscript_a(" -->");
2296  parse_htmlscript_a("<!--\ndim x\nx=1\n-->\n");
2297  parse_htmlscript_a("<!--\ndim x\n-->\n<!--\nx=1\n-->\n");
2298 
2299  SET_EXPECT(OnScriptError);
2300  hres = parse_script_ar("<!--");
2301  ok(FAILED(hres), "script didn't fail\n");
2302  todo_wine CHECK_CALLED(OnScriptError);
2303 
2304  SET_EXPECT(global_success_d);
2305  SET_EXPECT(global_success_i);
2306  parse_htmlscript_a("<!--\n<!-- ignore this <> <>\n--> <>\nCall reportSuccess()\n-->\n");
2307  CHECK_CALLED(global_success_d);
2308  CHECK_CALLED(global_success_i);
2309 
2310  next_cnt = 0;
2311  SET_EXPECT(collectionobj_newenum_i);
2312  SET_EXPECT(Next);
2313  parse_script_a("for each x in collectionObj\nnext");
2314  CHECK_CALLED(collectionobj_newenum_i);
2315  CHECK_CALLED(Next);
2316  ok(next_cnt == 4, "next_cnt = %d\n", next_cnt);
2317 
2318  parse_script_a("x = 1\n Call ok(x = 1, \"x = \" & x)");
2319 
2320  parse_script_a("x = _ \n3");
2321 
2324 
2325  SET_EXPECT(OnScriptError);
2326  hres = parse_script_ar("throwInt(&h80080008&)");
2327  ok(hres == 0x80080008, "hres = %08x\n", hres);
2328  todo_wine CHECK_CALLED(OnScriptError);
2329 
2330  /* DISP_E_BADINDEX */
2331  SET_EXPECT(OnScriptError);
2332  hres = parse_script_ar("throwInt(&h8002000b&)");
2333  ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres);
2334  todo_wine CHECK_CALLED(OnScriptError);
2335 
2336  SET_EXPECT(OnScriptError);
2337  hres = parse_script_ar("throwInt(&h800a0009&)");
2338  ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres);
2339  todo_wine CHECK_CALLED(OnScriptError);
2340 
2341  onerror_hres = S_OK;
2342  SET_EXPECT(OnScriptError);
2343  hres = parse_script_ar("throwInt(&h800a0009&)");
2344  todo_wine ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres);
2345  todo_wine CHECK_CALLED(OnScriptError);
2346 
2347  /* E_NOTIMPL */
2348  SET_EXPECT(OnScriptError);
2349  hres = parse_script_ar("throwInt(&h80004001&)");
2350  ok(hres == MAKE_VBSERROR(445), "hres = %08x\n", hres);
2351  todo_wine CHECK_CALLED(OnScriptError);
2352 
2353  onerror_hres = S_OK;
2354  SET_EXPECT(OnScriptError);
2355  hres = parse_script_ar("throwInt(&h80004001&)");
2356  todo_wine ok(hres == SCRIPT_E_REPORTED, "hres = %08x\n", hres);
2357  todo_wine CHECK_CALLED(OnScriptError);
2358 
2359  SET_EXPECT(global_testoptionalarg_i);
2360  parse_script_a("call testOptionalArg(1,,2)");
2361  CHECK_CALLED(global_testoptionalarg_i);
2362 
2363  SET_EXPECT(global_testoptionalarg_i);
2364  parse_script_a("call testOptionalArg(,1,1)");
2365  CHECK_CALLED(global_testoptionalarg_i);
2366 
2367  SET_EXPECT(global_testoptionalarg_i);
2368  parse_script_a("testOptionalArg 1,,2");
2369  CHECK_CALLED(global_testoptionalarg_i);
2370 
2372 
2373  SET_EXPECT(testobj_value_i);
2374  parse_script_a("dim n,o\n set o = testObj\n n = o(1,2)\n call ok(n=2, \"n = \" & n)\n");
2375  CHECK_CALLED(testobj_value_i);
2376 
2377  SET_EXPECT(testobj_value_i);
2378  parse_script_a("dim n,o\n set o = testObj\n n = o\n call ok(n=0, \"n = \" & n)\n");
2379  CHECK_CALLED(testobj_value_i);
2380 
2381  parse_script_a("Sub testsub\n"
2382  "x = 1\n"
2383  "Call ok(x = 1, \"x = \" & x)\n"
2384  "End Sub\n"
2385  "Call testsub()");
2386 
2387  parse_script_a("Call ok(getVT(x) = \"VT_EMPTY*\", \"getVT(x) = \" & getVT(x))\n");
2388  parse_script_a("Call ok(x = \"\", \"x = \" & x)\n");
2389  parse_script_a("x = y\n"
2390  "Call ok(getVT(x) = \"VT_EMPTY*\", \"getVT(x) = \" & getVT(x))\n"
2391  "Call ok(getVT(y) = \"VT_EMPTY*\", \"getVT(y) = \" & getVT(y))");
2392  SET_EXPECT(OnScriptError);
2393  hres = parse_script_ar("x = y(\"a\")");
2394  ok(FAILED(hres), "script didn't fail\n");
2395  todo_wine CHECK_CALLED(OnScriptError);
2396 
2397  SET_EXPECT(global_success_d);
2398  SET_EXPECT(global_success_i);
2399  parse_script_a("' comment\r"
2400  "Sub testsub(arg)\r"
2401  "If arg = 1 Then\r\r"
2402  "Call reportSuccess()\n\n"
2403  "End If\r\n"
2404  "End Sub\n\r"
2405  "Call testsub(1)");
2406  CHECK_CALLED(global_success_d);
2407  CHECK_CALLED(global_success_i);
2408 
2409  run_from_res("lang.vbs");
2410  run_from_res("api.vbs");
2411  run_from_res("regexp.vbs");
2412  run_from_res("error.vbs");
2413 
2414  test_procedures();
2415  test_gc();
2416  test_msgbox();
2418 }
static BOOL strict_dispid_check
Definition: run.c:139
#define TRUE
Definition: types.h:120
static void test_msgbox(void)
Definition: run.c:2001
static HRESULT parse_script_ar(const char *src)
Definition: run.c:1809
static HRESULT onerror_hres
Definition: run.c:145
#define MAKE_VBSERROR(code)
Definition: run.c:134
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:1798
static HRESULT test_global_vars_ref(BOOL use_close)
Definition: run.c:2050
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static void parse_script_a(const char *src)
Definition: run.c:1875
#define CHECK_CALLED(func)
Definition: run.c:73
static void test_procedures(void)
Definition: run.c:1918
#define todo_wine
Definition: test.h:154
#define SET_EXPECT(func)
Definition: run.c:58
static void test_gc(void)
Definition: run.c:1946
static void run_from_res(const char *name)
Definition: run.c:2160
#define S_OK
Definition: intsafe.h:59
static unsigned next_cnt
Definition: run.c:602
#define ok(value,...)
Definition: atltest.h:57
#define parse_htmlscript_a(a)
Definition: run.c:1880
static void test_parse_context(void)
Definition: run.c:1820

Referenced by START_TEST().

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 233 of file run.c.

234 {
235  return 2;
236 }

◆ ServiceProvider_QueryInterface()

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

Definition at line 227 of file run.c.

228 {
229  ok(0, "unexpected call\n");
230  return E_NOINTERFACE;
231 }
#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 243 of file run.c.

245 {
246  ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
247  return E_NOINTERFACE;
248 }
#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 238 of file run.c.

239 {
240  return 1;
241 }

◆ START_TEST()

START_TEST ( run  )

Definition at line 2441 of file run.c.

2442 {
2443  int argc;
2444  char **argv;
2445 
2446  detect_locale();
2447  if(!is_english)
2448  skip("Skipping some tests in non-English locale\n");
2449 
2451 
2452  CoInitialize(NULL);
2453 
2454  if(!check_vbscript()) {
2455  win_skip("Broken engine, probably too old\n");
2456  }else if(argc > 2) {
2457  allow_ui = TRUE;
2459  run_from_file(argv[2]);
2460  }else {
2461  run_tests();
2462  }
2463 
2464  CoUninitialize();
2465 }
static int argc
Definition: ServiceArgs.c:12
#define TRUE
Definition: types.h:120
static BOOL is_english
Definition: run.c:139
#define argv
Definition: mplay32.c:18
static void detect_locale(void)
Definition: run.c:213
smooth NULL
Definition: ftsmooth.c:416
static BOOL allow_ui
Definition: run.c:139
static void run_from_file(const char *filename)
Definition: run.c:2145
int winetest_get_mainargs(char ***pargv)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static void run_tests(void)
Definition: run.c:2191
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
static SCRIPTUICHANDLING uic_handling
Definition: run.c:143
static BOOL check_vbscript(void)
Definition: run.c:2420
#define win_skip
Definition: test.h:141

◆ strcmp_wa()

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

Definition at line 159 of file run.c.

160 {
161  CHAR buf[512];
162  WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), 0, 0);
163  return lstrcmpA(buf, stra);
164 }
#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(), and testObj_GetDispID().

◆ test_disp()

static void test_disp ( IDispatch disp)
static

Definition at line 259 of file run.c.

260 {
261  DISPID id, public_prop_id, public_prop2_id, public_func_id, public_sub_id, defvalget_id, gs_getter_id;
262  DISPID named_args[5] = {DISPID_PROPERTYPUT};
263  VARIANT v, args[5];
264  DISPPARAMS dp = {args, named_args};
265  IDispatchEx *dispex;
266  EXCEPINFO ei = {0};
267  BSTR str;
268  HRESULT hres;
269 
270  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
271  ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
272 
273  str = a2bstr("publicProp");
274  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_prop_id);
276  ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
277 
278  str = a2bstr("PUBLICPROP");
279  hres = IDispatchEx_GetDispID(dispex, str, 0, &id);
281  ok(hres == S_OK, "GetDispID(PUBLICPROP) failed: %08x\n", hres);
282  ok(public_prop_id == id, "id = %d\n", public_prop_id);
283 
284  str = a2bstr("publicPROP2");
285  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_prop2_id);
287  ok(hres == S_OK, "GetDispID(publicProp2) failed: %08x\n", hres);
288 
289  str = a2bstr("defValGet");
290  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &defvalget_id);
292  ok(hres == S_OK, "GetDispID(defValGet) failed: %08x\n", hres);
293  ok(defvalget_id == DISPID_VALUE, "id = %d\n", defvalget_id);
294 
295  str = a2bstr("privateProp");
296  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
298  ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
299  ok(id == -1, "id = %d\n", id);
300 
301  str = a2bstr("class_initialize");
302  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
304  ok(hres == S_OK, "GetDispID(publicProp2) failed: %08x\n", hres);
305 
306  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
307  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
308  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
309 
310  V_VT(args) = VT_BOOL;
311  V_BOOL(args) = VARIANT_TRUE;
312  dp.cArgs = dp.cNamedArgs = 1;
313  V_VT(&v) = VT_BOOL;
314  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, &v, &ei, NULL);
315  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
316  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
317 
318  dp.cArgs = dp.cNamedArgs = 0;
319  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
320  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
321  ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
322  ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
323 
324  dp.cArgs = dp.cNamedArgs = 0;
325  hres = IDispatchEx_Invoke(dispex, public_prop_id, &IID_NULL, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
326  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
327  ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
328  ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
329 
330  dp.cArgs = dp.cNamedArgs = 0;
331  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
332  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
333  ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
334  ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v));
335 
336  dp.cArgs = 1;
337  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
338  ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
339  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
340 
341  SET_EXPECT(testobj_value_i);
342  V_VT(args) = VT_DISPATCH;
344  dp.cArgs = dp.cNamedArgs = 1;
345  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
346  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
347  CHECK_CALLED(testobj_value_i);
348 
349  dp.cArgs = dp.cNamedArgs = 0;
350  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
351  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
352  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
353  ok(V_I2(&v) == 0, "V_I2(v) = %d\n", V_I2(&v));
354 
355  V_VT(args) = VT_DISPATCH;
357  dp.cArgs = dp.cNamedArgs = 1;
358  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
359  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
360 
361  V_VT(args) = VT_DISPATCH;
363  dp.cArgs = dp.cNamedArgs = 1;
364  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
365  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
366 
367  dp.cArgs = dp.cNamedArgs = 0;
368  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
369  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
370  ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
371  ok(V_DISPATCH(&v) == (IDispatch*)&testObj, "V_DISPATCH(v) != testObj\n");
372 
373  V_VT(args) = VT_BOOL;
374  V_BOOL(args) = VARIANT_TRUE;
375  dp.cArgs = dp.cNamedArgs = 1;
376  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
377  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
378 
379  dp.cArgs = dp.cNamedArgs = 0;
380  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
381  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
382  ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
383  ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
384 
385  V_VT(args) = VT_BOOL;
386  V_BOOL(args) = VARIANT_FALSE;
387  dp.cArgs = dp.cNamedArgs = 1;
388  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUTREF, &dp, NULL, &ei, NULL);
389  ok(hres == DISP_E_EXCEPTION, "InvokeEx failed: %08x, expected DISP_E_EXCEPTION\n", hres);
390 
391  V_VT(args) = VT_BOOL;
392  V_BOOL(args) = VARIANT_FALSE;
393  dp.cArgs = 1;
394  dp.cNamedArgs = 0;
395  V_VT(&v) = VT_BOOL;
396  hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
397  ok(hres == DISP_E_PARAMNOTOPTIONAL, "InvokeEx failed: %08x, expected DISP_E_PARAMNOTOPTIONAL\n", hres);
398 
399  str = a2bstr("publicFunction");
400  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_func_id);
402  ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres);
403  ok(public_func_id != -1, "public_func_id = -1\n");
404 
405  str = a2bstr("publicSub");
406  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &public_sub_id);
408  ok(hres == S_OK, "GetDispID(publicSub) failed: %08x\n", hres);
409  ok(public_sub_id != -1, "public_func_id = -1\n");
410 
411  dp.cArgs = dp.cNamedArgs = 0;
412  hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
413  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
414  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
415  ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
416 
417  dp.cArgs = dp.cNamedArgs = 0;
418  hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
419  ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
420  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
421 
422  dp.cArgs = dp.cNamedArgs = 0;
423  hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
424  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
425  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
426  ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
427 
428  dp.cArgs = dp.cNamedArgs = 0;
429  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
430  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
431  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
432 
433  dp.cArgs = dp.cNamedArgs = 0;
434  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
435  ok(hres == DISP_E_MEMBERNOTFOUND, "InvokeEx failed: %08x, expected DISP_E_MEMBERNOTFOUND\n", hres);
436  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
437 
438  dp.cArgs = dp.cNamedArgs = 0;
439  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
440  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
441  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
442 
443  V_VT(args) = VT_BOOL;
444  V_BOOL(args) = VARIANT_TRUE;
445  dp.cArgs = dp.cNamedArgs = 1;
446  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYPUT, &dp, NULL, &ei, NULL);
447  ok(FAILED(hres), "InvokeEx succeeded: %08x\n", hres);
448 
449  dp.cArgs = dp.cNamedArgs = 0;
450  hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
451  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
452  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
453  ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
454 
455  dp.cArgs = dp.cNamedArgs = 0;
456  hres = IDispatchEx_InvokeEx(dispex, public_func_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
457  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
458  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
459  ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
460 
461  dp.cArgs = dp.cNamedArgs = 0;
462  hres = IDispatchEx_Invoke(dispex, public_func_id, &IID_NULL, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
463  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
464  ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v));
465  ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v));
466 
467  dp.cArgs = dp.cNamedArgs = 0;
468  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
469  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
470  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
471 
472  dp.cArgs = dp.cNamedArgs = 0;
473  hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
474  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
475  ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
476 
477  str = a2bstr("privateSub");
478  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &id);
480  ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateSub) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
481  ok(id == -1, "id = %d\n", id);
482 
483  str = a2bstr("dynprop");
484  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive|fdexNameEnsure, &id);
485  ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
486  ok(id == -1, "id = %d\n", id);
487  hres = IDispatchEx_GetDispID(dispex, str, fdexNameEnsure, &id);
488  ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(privateProp) failed: %08x, expected DISP_E_UNKNOWNNAME\n", hres);
489  ok(id == -1, "id = %d\n", id);
491 
492  str = a2bstr("publicProp");
493  hres = IDispatchEx_GetDispID(dispex, str, 0x80000000|fdexNameCaseInsensitive, &public_prop_id);
495  ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
496 
497  id = 0xdeadbeef;
498  str = a2bstr("publicProp");
499  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
501  ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
502  ok(id == public_prop_id, "id = %d, expected %d\n", id, public_prop_id);
503 
504  id = 0xdeadbeef;
505  str = a2bstr("publicprop");
506  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
508  ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres);
509  ok(id == public_prop_id, "id = %d, expected %d\n", id, public_prop_id);
510 
511  str = a2bstr("gsGetProp");
512  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &gs_getter_id);
514  ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres);
515  ok(gs_getter_id != -1, "gs_getter_id = -1\n");
516 
517  V_VT(args) = VT_BOOL;
518  V_BOOL(args) = VARIANT_TRUE;
519  dp.cNamedArgs = 0;
520  dp.cArgs = 1;
521  V_VT(&v) = VT_I8;
522  hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
523  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
524  ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
525 
526  hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, NULL, &ei, NULL);
527  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
528 
529  V_VT(args) = VT_BOOL;
530  V_BOOL(args) = VARIANT_FALSE;
531  dp.cArgs = 1;
532  V_VT(&v) = VT_I8;
533  hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL);
534  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
535  ok(V_VT(&v) == VT_BOOL && !V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
536 
537  V_VT(args) = VT_BOOL;
538  V_BOOL(args) = VARIANT_TRUE;
539  V_VT(&v) = VT_I8;
540  dp.cArgs = 1;
541  hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL);
542  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
543  ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v));
544 
545  IDispatchEx_Release(dispex);
546 }
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
disp
Definition: i386-dis.c:3181
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
Definition: compat.h:1955
#define V_I2(A)
Definition: oleauto.h:245
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
OLECHAR * BSTR
Definition: compat.h:1934
Definition: match.c:390
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define V_BOOL(A)
Definition: oleauto.h:224
#define CHECK_CALLED(func)
Definition: run.c:73
#define IID_NULL
Definition: guiddef.h:98
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:2524
#define V_VT(A)
Definition: oleauto.h:211
#define SET_EXPECT(func)
Definition: run.c:58
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009
static IDispatchEx testObj
Definition: run.c:144
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 ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:147
struct stdole::DISPPARAMS DISPPARAMS
GLenum GLuint id
Definition: glext.h:5579
#define args
Definition: format.c:66
Definition: compat.h:1938

Referenced by Global_InvokeEx().

◆ test_gc()

static void test_gc ( void  )
static

Definition at line 1946 of file run.c.

1947 {
1948  IActiveScriptParse *parser;
1949  IActiveScript *engine;
1950  BSTR src;
1951  HRESULT hres;
1952 
1954 
1955  engine = create_script();
1956  if(!engine)
1957  return;
1958 
1959  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1960  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1961 
1963  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1964 
1965  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1966  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1967 
1968  hres = IActiveScript_AddNamedItem(engine, testW,
1969  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
1970  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1971 
1972  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1973  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1974 
1975  src = a2bstr(
1976  "class C\n"
1977  " Public ref\n"
1978  " Public Sub Class_Terminate\n"
1979  " Call reportSuccess()\n"
1980  " End Sub\n"
1981  "End Class\n"
1982  "Dim x\n"
1983  "set x = new C\n"
1984  "set x.ref = x\n"
1985  "set x = nothing\n");
1986 
1988  ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
1989  SysFreeString(src);
1990 
1991  SET_EXPECT(global_success_d);
1992  SET_EXPECT(global_success_i);
1993  IActiveScript_Close(engine);
1994  CHECK_CALLED(global_success_d);
1995  CHECK_CALLED(global_success_i);
1996 
1997  IActiveScript_Release(engine);
1999 }
static BOOL strict_dispid_check
Definition: run.c:139
static IActiveScript * create_script(void)
Definition: run.c:1704
static const WCHAR testW[]
Definition: run.c:136
OLECHAR * BSTR
Definition: compat.h:1934
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:77
#define CHECK_CALLED(func)
Definition: run.c:73
#define SET_EXPECT(func)
Definition: run.c:58
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define IActiveScriptParse_ParseScriptText
Definition: run.c:46
#define ok(value,...)
Definition: atltest.h:57
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1702
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:147
Definition: import.c:86

Referenced by run_tests().

◆ test_global_vars_ref()

static HRESULT test_global_vars_ref ( BOOL  use_close)
static

Definition at line 2050 of file run.c.

2051 {
2052  IActiveScriptParse *parser;
2053  IActiveScript *engine;
2054  BSTR script_str;
2055  LONG ref;
2056  HRESULT hres;
2057 
2058  engine = create_script();
2059  if(!engine)
2060  return S_OK;
2061 
2062  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2063  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2064  if (FAILED(hres))
2065  {
2066  IActiveScript_Release(engine);
2067  return hres;
2068  }
2069 
2071  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2072 
2073  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2074  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2075 
2076  hres = IActiveScript_AddNamedItem(engine, testW, SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2077  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2078 
2079  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2080  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2081 
2082  refobj_ref = 0;
2083 
2084  script_str = a2bstr("Dim x\nset x = RefObj\n");
2085  hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2086  SysFreeString(script_str);
2087 
2088  ok(refobj_ref, "refobj_ref = 0\n");
2089 
2090  if(use_close) {
2091  hres = IActiveScript_Close(engine);
2092  ok(hres == S_OK, "Close failed: %08x\n", hres);
2093  }else {
2094  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_UNINITIALIZED);
2095  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2096  }
2097 
2098  ok(!refobj_ref, "refobj_ref = %d\n", refobj_ref);
2099 
2100  IActiveScript_Release(engine);
2101 
2103  ok(!ref, "ref=%d\n", ref);
2104  return hres;
2105 }
static IActiveScript * create_script(void)
Definition: run.c:1704
static const WCHAR testW[]
Definition: run.c:136
OLECHAR * BSTR
Definition: compat.h:1934
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_InitNew
Definition: run.c:45
#define IActiveScriptParse_Release
Definition: run.c:44
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define IActiveScriptParse_ParseScriptText
Definition: run.c:46
#define ok(value,...)
Definition: atltest.h:57
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1702
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: