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

Go to the source code of this file.

Macros

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

Functions

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

Variables

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

Macro Definition Documentation

◆ CHECK_CALLED

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

Definition at line 76 of file run.c.

◆ CHECK_EXPECT

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

Definition at line 70 of file run.c.

◆ CHECK_EXPECT2

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

Definition at line 64 of file run.c.

◆ CHECK_NOT_CALLED

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

Definition at line 82 of file run.c.

◆ CLEAR_CALLED

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

Definition at line 88 of file run.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file run.c.

◆ CONST_VTABLE

#define CONST_VTABLE

Definition at line 22 of file run.c.

◆ DEFINE_EXPECT

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

Definition at line 55 of file run.c.

◆ DISPID_COLLOBJ_RESET

#define DISPID_COLLOBJ_RESET   3000

Definition at line 147 of file run.c.

◆ DISPID_GLOBAL_COLLOBJ

#define DISPID_GLOBAL_COLLOBJ   1013

Definition at line 131 of file run.c.

◆ DISPID_GLOBAL_COUNTER

#define DISPID_GLOBAL_COUNTER   1010

Definition at line 128 of file run.c.

◆ DISPID_GLOBAL_DOUBLEASSTRING

#define DISPID_GLOBAL_DOUBLEASSTRING   1014

Definition at line 132 of file run.c.

◆ DISPID_GLOBAL_GETVT

#define DISPID_GLOBAL_GETVT   1003

Definition at line 121 of file run.c.

◆ DISPID_GLOBAL_GLOBALCALLBACK

#define DISPID_GLOBAL_GLOBALCALLBACK   1022

Definition at line 140 of file run.c.

◆ DISPID_GLOBAL_ISENGLANG

#define DISPID_GLOBAL_ISENGLANG   1004

Definition at line 122 of file run.c.

◆ DISPID_GLOBAL_ISNULLDISP

#define DISPID_GLOBAL_ISNULLDISP   1007

Definition at line 125 of file run.c.

◆ DISPID_GLOBAL_LETOBJ

#define DISPID_GLOBAL_LETOBJ   1018

Definition at line 136 of file run.c.

◆ DISPID_GLOBAL_OK

#define DISPID_GLOBAL_OK   1002

Definition at line 120 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT

#define DISPID_GLOBAL_PROPARGPUT   1011

Definition at line 129 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT1

#define DISPID_GLOBAL_PROPARGPUT1   1012

Definition at line 130 of file run.c.

◆ DISPID_GLOBAL_REFOBJ

#define DISPID_GLOBAL_REFOBJ   1009

Definition at line 127 of file run.c.

◆ DISPID_GLOBAL_REPORTSUCCESS

#define DISPID_GLOBAL_REPORTSUCCESS   1000

Definition at line 118 of file run.c.

◆ DISPID_GLOBAL_SETOBJ

#define DISPID_GLOBAL_SETOBJ   1019

Definition at line 137 of file run.c.

◆ DISPID_GLOBAL_TESTARRAY

#define DISPID_GLOBAL_TESTARRAY   1015

Definition at line 133 of file run.c.

◆ DISPID_GLOBAL_TESTDISP

#define DISPID_GLOBAL_TESTDISP   1008

Definition at line 126 of file run.c.

◆ DISPID_GLOBAL_TESTERROROBJECT

#define DISPID_GLOBAL_TESTERROROBJECT   1023

Definition at line 141 of file run.c.

◆ DISPID_GLOBAL_TESTOBJ

#define DISPID_GLOBAL_TESTOBJ   1006

Definition at line 124 of file run.c.

◆ DISPID_GLOBAL_TESTOPTIONALARG

#define DISPID_GLOBAL_TESTOPTIONALARG   1017

Definition at line 135 of file run.c.

◆ DISPID_GLOBAL_THROWINT

#define DISPID_GLOBAL_THROWINT   1016

Definition at line 134 of file run.c.

◆ DISPID_GLOBAL_TODO_WINE_OK

#define DISPID_GLOBAL_TODO_WINE_OK   1020

Definition at line 138 of file run.c.

◆ DISPID_GLOBAL_TRACE

#define DISPID_GLOBAL_TRACE   1001

Definition at line 119 of file run.c.

◆ DISPID_GLOBAL_VBVAR

#define DISPID_GLOBAL_VBVAR   1005

Definition at line 123 of file run.c.

◆ DISPID_GLOBAL_WEEKSTARTDAY

#define DISPID_GLOBAL_WEEKSTARTDAY   1021

Definition at line 139 of file run.c.

◆ DISPID_TESTOBJ_KEYWORD

#define DISPID_TESTOBJ_KEYWORD   2002

Definition at line 145 of file run.c.

◆ DISPID_TESTOBJ_PROPGET

#define DISPID_TESTOBJ_PROPGET   2000

Definition at line 143 of file run.c.

◆ DISPID_TESTOBJ_PROPPUT

#define DISPID_TESTOBJ_PROPPUT   2001

Definition at line 144 of file run.c.

◆ FACILITY_VBS

#define FACILITY_VBS   0xa

Definition at line 149 of file run.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 45 of file run.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 46 of file run.c.

◆ IActiveScriptParse_QueryInterface

#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface

Definition at line 43 of file run.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 44 of file run.c.

◆ IActiveScriptParseProcedure2_ParseProcedureText

#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText

Definition at line 48 of file run.c.

◆ IActiveScriptParseProcedure2_Release

#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release

Definition at line 47 of file run.c.

◆ MAKE_VBSERROR

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

Definition at line 150 of file run.c.

◆ parse_htmlscript_a

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

Definition at line 2113 of file run.c.

◆ REF_EXPECT

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

Definition at line 61 of file run.c.

◆ SET_EXPECT

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

Definition at line 58 of file run.c.

◆ test_grfdex

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

Definition at line 592 of file run.c.

Function Documentation

◆ _parse_htmlscript_a()

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

Definition at line 2114 of file run.c.

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

◆ _test_grfdex()

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

Definition at line 593 of file run.c.

594{
595 ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
596}
#define expect(expected, got)
Definition: combo.c:36

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 164 of file run.c.

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

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 1819 of file run.c.

1820{
1821 return 2;
1822}

◆ ActiveScriptSite_GetDocVersionString()

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

Definition at line 1849 of file run.c.

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

◆ ActiveScriptSite_GetItemInfo()

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

Definition at line 1835 of file run.c.

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

◆ ActiveScriptSite_GetLCID()

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

Definition at line 1829 of file run.c.

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

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 1900 of file run.c.

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

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 1907 of file run.c.

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

◆ ActiveScriptSite_OnScriptError()

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

Definition at line 1867 of file run.c.

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

◆ ActiveScriptSite_OnScriptTerminate()

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

Definition at line 1854 of file run.c.

1856{
1857 return E_NOTIMPL;
1858}

◆ ActiveScriptSite_OnStateChange()

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

Definition at line 1860 of file run.c.

1861{
1862 return E_NOTIMPL;
1863}

◆ ActiveScriptSite_QueryInterface()

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

Definition at line 1800 of file run.c.

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

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 1824 of file run.c.

1825{
1826 return 1;
1827}

◆ ActiveScriptSiteUIControl_AddRef()

static ULONG WINAPI ActiveScriptSiteUIControl_AddRef ( IActiveScriptSiteUIControl iface)
static

Definition at line 1770 of file run.c.

1771{
1772 return 2;
1773}

◆ ActiveScriptSiteUIControl_GetUIBehavior()

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

Definition at line 1780 of file run.c.

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

◆ ActiveScriptSiteUIControl_QueryInterface()

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

Definition at line 1764 of file run.c.

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

◆ ActiveScriptSiteUIControl_Release()

static ULONG WINAPI ActiveScriptSiteUIControl_Release ( IActiveScriptSiteUIControl iface)
static

Definition at line 1775 of file run.c.

1776{
1777 return 1;
1778}

◆ ActiveScriptSiteWindow_AddRef()

static ULONG WINAPI ActiveScriptSiteWindow_AddRef ( IActiveScriptSiteWindow iface)
static

Definition at line 1726 of file run.c.

1727{
1728 return 2;
1729}

◆ ActiveScriptSiteWindow_EnableModeless()

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

Definition at line 1744 of file run.c.

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

◆ ActiveScriptSiteWindow_GetWindow()

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

Definition at line 1736 of file run.c.

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

◆ ActiveScriptSiteWindow_QueryInterface()

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

Definition at line 1720 of file run.c.

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

◆ ActiveScriptSiteWindow_Release()

static ULONG WINAPI ActiveScriptSiteWindow_Release ( IActiveScriptSiteWindow iface)
static

Definition at line 1731 of file run.c.

1732{
1733 return 1;
1734}

◆ check_vbscript()

static BOOL check_vbscript ( void  )
static

Definition at line 3052 of file run.c.

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

Referenced by START_TEST().

◆ close_script()

static void close_script ( IActiveScript script)
static

Definition at line 1976 of file run.c.

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

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

◆ collectionObj_GetDispID()

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

Definition at line 977 of file run.c.

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

◆ collectionObj_InvokeEx()

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

Definition at line 988 of file run.c.

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

◆ create_and_init_script()

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

Definition at line 1942 of file run.c.

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

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

◆ create_script()

static IActiveScript * create_script ( void  )
static

Definition at line 1930 of file run.c.

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

◆ DEFINE_EXPECT() [1/26]

DEFINE_EXPECT ( collectionobj_newenum_i  )

◆ DEFINE_EXPECT() [2/26]

DEFINE_EXPECT ( EnableModeless  )

◆ DEFINE_EXPECT() [3/26]

DEFINE_EXPECT ( GetUIBehavior  )

◆ DEFINE_EXPECT() [4/26]

DEFINE_EXPECT ( GetWindow  )

◆ DEFINE_EXPECT() [5/26]

DEFINE_EXPECT ( global_globalcallback_i  )

◆ DEFINE_EXPECT() [6/26]

DEFINE_EXPECT ( global_letobj_i  )

◆ DEFINE_EXPECT() [7/26]

DEFINE_EXPECT ( global_propargput1_d  )

◆ DEFINE_EXPECT() [8/26]

DEFINE_EXPECT ( global_propargput1_i  )

◆ DEFINE_EXPECT() [9/26]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [10/26]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [11/26]

DEFINE_EXPECT ( global_setobj_i  )

◆ DEFINE_EXPECT() [12/26]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [13/26]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [14/26]

DEFINE_EXPECT ( global_testerrorobject_i  )

◆ DEFINE_EXPECT() [15/26]

DEFINE_EXPECT ( global_testoptionalarg_i  )

◆ DEFINE_EXPECT() [16/26]

DEFINE_EXPECT ( global_vbvar_d  )

◆ DEFINE_EXPECT() [17/26]

DEFINE_EXPECT ( global_vbvar_i  )

◆ DEFINE_EXPECT() [18/26]

DEFINE_EXPECT ( Next  )

◆ DEFINE_EXPECT() [19/26]

DEFINE_EXPECT ( OnEnterScript  )

◆ DEFINE_EXPECT() [20/26]

DEFINE_EXPECT ( OnLeaveScript  )

◆ DEFINE_EXPECT() [21/26]

DEFINE_EXPECT ( OnScriptError  )

◆ DEFINE_EXPECT() [22/26]

DEFINE_EXPECT ( testobj_propget_d  )

◆ DEFINE_EXPECT() [23/26]

DEFINE_EXPECT ( testobj_propget_i  )

◆ DEFINE_EXPECT() [24/26]

DEFINE_EXPECT ( testobj_propput_d  )

◆ DEFINE_EXPECT() [25/26]

DEFINE_EXPECT ( testobj_propput_i  )

◆ DEFINE_EXPECT() [26/26]

DEFINE_EXPECT ( testobj_value_i  )

◆ detect_locale()

static void detect_locale ( void  )
static

Definition at line 237 of file run.c.

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

Referenced by START_TEST().

◆ DispatchEx_AddRef()

static ULONG WINAPI DispatchEx_AddRef ( IDispatchEx iface)
static

Definition at line 693 of file run.c.

694{
695 return 2;
696}

◆ DispatchEx_DeleteMemberByDispID()

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

Definition at line 737 of file run.c.

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

◆ DispatchEx_DeleteMemberByName()

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

Definition at line 731 of file run.c.

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

◆ DispatchEx_GetDispID()

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

Definition at line 767 of file run.c.

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

◆ DispatchEx_GetIDsOfNames()

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

Definition at line 715 of file run.c.

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

◆ DispatchEx_GetMemberName()

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

Definition at line 749 of file run.c.

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

◆ DispatchEx_GetMemberProperties()

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

Definition at line 743 of file run.c.

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

◆ DispatchEx_GetNameSpaceParent()

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

Definition at line 761 of file run.c.

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

◆ DispatchEx_GetNextDispID()

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

Definition at line 755 of file run.c.

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

◆ DispatchEx_GetTypeInfo()

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

Definition at line 709 of file run.c.

711{
712 return E_NOTIMPL;
713}

◆ DispatchEx_GetTypeInfoCount()

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

Definition at line 703 of file run.c.

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

◆ DispatchEx_Invoke()

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

Definition at line 723 of file run.c.

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

◆ DispatchEx_InvokeEx()

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

Definition at line 773 of file run.c.

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

◆ DispatchEx_QueryInterface()

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

Definition at line 676 of file run.c.

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

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx iface)
static

Definition at line 698 of file run.c.

699{
700 return 1;
701}

◆ enumDisp_QueryInterface()

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

Definition at line 952 of file run.c.

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

◆ EnumVARIANT_AddRef()

static ULONG WINAPI EnumVARIANT_AddRef ( IEnumVARIANT iface)
static

Definition at line 616 of file run.c.

617{
618 return 2;
619}

◆ EnumVARIANT_Clone()

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

Definition at line 658 of file run.c.

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

◆ EnumVARIANT_Next()

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

Definition at line 628 of file run.c.

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

◆ EnumVARIANT_QueryInterface()

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

Definition at line 600 of file run.c.

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

◆ EnumVARIANT_Release()

static ULONG WINAPI EnumVARIANT_Release ( IEnumVARIANT iface)
static

Definition at line 621 of file run.c.

622{
623 return 1;
624}

◆ EnumVARIANT_Reset()

static HRESULT WINAPI EnumVARIANT_Reset ( IEnumVARIANT iface)
static

Definition at line 652 of file run.c.

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

◆ EnumVARIANT_Skip()

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

Definition at line 646 of file run.c.

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

◆ free_ei()

static void free_ei ( EXCEPINFO *  ei)
static

Definition at line 2203 of file run.c.

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

Referenced by test_callbacks().

◆ get_script_from_file()

static BSTR get_script_from_file ( const char filename)
static

Definition at line 2725 of file run.c.

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

◆ Global_AddRef()

static ULONG WINAPI Global_AddRef ( IDispatchEx iface)
static

Definition at line 1071 of file run.c.

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

◆ Global_GetDispID()

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

Definition at line 1081 of file run.c.

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

◆ Global_InvokeEx()

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

Definition at line 1213 of file run.c.

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

◆ Global_Release()

static ULONG WINAPI Global_Release ( IDispatchEx iface)
static

Definition at line 1076 of file run.c.

1077{
1078 return --global_ref;
1079}

◆ parse_procedure()

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

Definition at line 2127 of file run.c.

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

Referenced by test_procedures().

◆ parse_script()

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

Definition at line 1988 of file run.c.

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

◆ parse_script_a()

static void parse_script_a ( const char src)
static

Definition at line 2108 of file run.c.

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

◆ parse_script_af()

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

Definition at line 2027 of file run.c.

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

◆ parse_script_ar()

static HRESULT parse_script_ar ( const char src)
static

Definition at line 2038 of file run.c.

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

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

◆ RefObj_AddRef()

static ULONG WINAPI RefObj_AddRef ( IDispatchEx iface)
static

Definition at line 1039 of file run.c.

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

◆ RefObj_Release()

static ULONG WINAPI RefObj_Release ( IDispatchEx iface)
static

Definition at line 1044 of file run.c.

1045{
1046 return --refobj_ref;
1047}

◆ run_from_file()

static void run_from_file ( const char filename)
static

Definition at line 2763 of file run.c.

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

◆ run_from_res()

static void run_from_res ( const char name)
static

Definition at line 2778 of file run.c.

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

◆ run_tests()

static void run_tests ( void  )
static

Definition at line 2810 of file run.c.

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

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 257 of file run.c.

258{
259 return 2;
260}

◆ ServiceProvider_QueryInterface()

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

Definition at line 251 of file run.c.

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

◆ ServiceProvider_QueryService()

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

Definition at line 267 of file run.c.

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

◆ ServiceProvider_Release()

static ULONG WINAPI ServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 262 of file run.c.

263{
264 return 1;
265}

◆ START_TEST()

START_TEST ( run  )

Definition at line 3073 of file run.c.

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

◆ strcmp_wa()

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

Definition at line 176 of file run.c.

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

◆ stricmp_wa()

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

Definition at line 183 of file run.c.

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

Referenced by testObj_GetDispID().

◆ test_callbacks()

static void test_callbacks ( void  )
static

Definition at line 2210 of file run.c.

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

Referenced by run_tests().

◆ test_disp()

static void test_disp ( IDispatch disp)
static

Definition at line 283 of file run.c.

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

◆ test_gc()

static void test_gc ( void  )
static

Definition at line 2373 of file run.c.

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

Referenced by run_tests().

◆ test_global_vars_ref()

static HRESULT test_global_vars_ref ( BOOL  use_close)
static

Definition at line 2533 of file run.c.

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

Referenced by run_tests().

◆ test_isexpression()

static void test_isexpression ( void  )
static

Definition at line 2590 of file run.c.

2591{
2592 IActiveScriptParse *parser;
2593 IActiveScript *engine;
2595 HRESULT hres;
2596 VARIANT var;
2597 BSTR str;
2598
2599 if (!(engine = create_and_init_script(0, FALSE)))
2600 return;
2601
2602 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2603 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2604 if (FAILED(hres))
2605 {
2606 close_script(engine);
2607 return;
2608 }
2609
2610 /* Expression when script is not started is still executed */
2611 hres = IActiveScript_GetScriptState(engine, &ss);
2612 ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
2613 ok(ss == SCRIPTSTATE_INITIALIZED, "Wrong script state %u\n", ss);
2614
2615 str = a2bstr("13");
2616 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2617 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2618 ok(V_VT(&var) == VT_I2, "Expected VT_I2, got %s\n", vt2a(&var));
2619 ok(V_I2(&var) == 13, "Expected 13, got %d\n", V_I2(&var));
2620 VariantClear(&var);
2622
2623 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2624 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2625
2626 /* Empty expressions */
2627 V_VT(&var) = VT_I2;
2628 str = a2bstr("");
2629 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
2630 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2631 ok(V_VT(&var) == VT_EMPTY, "Expected VT_EMPTY, got %s\n", vt2a(&