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

Go to the source code of this file.

Classes

struct  bom_test
 

Macros

#define COBJMACROS
 
#define CONST_VTABLE
 
#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface
 
#define IActiveScriptParse_Release   IActiveScriptParse32_Release
 
#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew
 
#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText
 
#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release
 
#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText
 
#define DEFINE_EXPECT(func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)    expect_ ## func = TRUE
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define DISPID_GLOBAL_TESTPROPGET   0x1000
 
#define DISPID_GLOBAL_TESTPROPPUT   0x1001
 
#define DISPID_GLOBAL_REPORTSUCCESS   0x1002
 
#define DISPID_GLOBAL_TRACE   0x1003
 
#define DISPID_GLOBAL_OK   0x1004
 
#define DISPID_GLOBAL_GETVT   0x1005
 
#define DISPID_GLOBAL_TESTOBJ   0x1006
 
#define DISPID_GLOBAL_GETNULLBSTR   0x1007
 
#define DISPID_GLOBAL_NULL_DISP   0x1008
 
#define DISPID_GLOBAL_TESTTHIS   0x1009
 
#define DISPID_GLOBAL_TESTTHIS2   0x100a
 
#define DISPID_GLOBAL_INVOKEVERSION   0x100b
 
#define DISPID_GLOBAL_CREATEARRAY   0x100c
 
#define DISPID_GLOBAL_PROPGETFUNC   0x100d
 
#define DISPID_GLOBAL_OBJECT_FLAG   0x100e
 
#define DISPID_GLOBAL_ISWIN64   0x100f
 
#define DISPID_GLOBAL_PUREDISP   0x1010
 
#define DISPID_GLOBAL_ISNULLBSTR   0x1011
 
#define DISPID_GLOBAL_PROPARGPUT   0x1012
 
#define DISPID_GLOBAL_SHORTPROP   0x1013
 
#define DISPID_GLOBAL_GETSHORT   0x1014
 
#define DISPID_GLOBAL_TESTARGTYPES   0x1015
 
#define DISPID_GLOBAL_INTPROP   0x1016
 
#define DISPID_GLOBAL_DISPUNK   0x1017
 
#define DISPID_GLOBAL_TESTRES   0x1018
 
#define DISPID_GLOBAL_TESTNORES   0x1019
 
#define DISPID_GLOBAL_DISPEXFUNC   0x101a
 
#define DISPID_GLOBAL_TESTPROPPUTREF   0x101b
 
#define DISPID_GLOBAL_GETSCRIPTSTATE   0x101c
 
#define DISPID_GLOBAL_BINDEVENTHANDLER   0x101d
 
#define DISPID_GLOBAL_TESTENUMOBJ   0x101e
 
#define DISPID_GLOBAL_CALLEVAL   0x101f
 
#define DISPID_GLOBAL_PROPARGPUTOP   0x1020
 
#define DISPID_GLOBAL_TESTPROPDELETE   0x2000
 
#define DISPID_GLOBAL_TESTNOPROPDELETE   0x2001
 
#define DISPID_GLOBAL_TESTPROPDELETEERROR   0x2002
 
#define DISPID_TESTOBJ_PROP   0x2000
 
#define DISPID_TESTOBJ_ONLYDISPID   0x2001
 
#define DISPID_TESTOBJ_WITHPROP   0x2002
 
#define JS_E_OUT_OF_MEMORY   0x800a03ec
 
#define JS_E_INVALID_CHAR   0x800a03f6
 
#define test_grfdex(a, b)   _test_grfdex(__LINE__,a,b)
 

Functions

 DEFINE_EXPECT (global_propget_d)
 
 DEFINE_EXPECT (global_propget_i)
 
 DEFINE_EXPECT (global_propput_d)
 
 DEFINE_EXPECT (global_propput_i)
 
 DEFINE_EXPECT (global_propputref_d)
 
 DEFINE_EXPECT (global_propputref_i)
 
 DEFINE_EXPECT (global_propdelete_d)
 
 DEFINE_EXPECT (global_nopropdelete_d)
 
 DEFINE_EXPECT (global_propdeleteerror_d)
 
 DEFINE_EXPECT (global_success_d)
 
 DEFINE_EXPECT (global_success_i)
 
 DEFINE_EXPECT (global_notexists_d)
 
 DEFINE_EXPECT (global_propargput_d)
 
 DEFINE_EXPECT (global_propargput_i)
 
 DEFINE_EXPECT (global_propargputop_d)
 
 DEFINE_EXPECT (global_propargputop_get_i)
 
 DEFINE_EXPECT (global_propargputop_put_i)
 
 DEFINE_EXPECT (global_testargtypes_i)
 
 DEFINE_EXPECT (global_calleval_i)
 
 DEFINE_EXPECT (puredisp_prop_d)
 
 DEFINE_EXPECT (puredisp_noprop_d)
 
 DEFINE_EXPECT (puredisp_value)
 
 DEFINE_EXPECT (dispexfunc_value)
 
 DEFINE_EXPECT (testobj_delete_test)
 
 DEFINE_EXPECT (testobj_delete_nodelete)
 
 DEFINE_EXPECT (testobj_value)
 
 DEFINE_EXPECT (testobj_construct)
 
 DEFINE_EXPECT (testobj_prop_d)
 
 DEFINE_EXPECT (testobj_withprop_d)
 
 DEFINE_EXPECT (testobj_withprop_i)
 
 DEFINE_EXPECT (testobj_noprop_d)
 
 DEFINE_EXPECT (testobj_onlydispid_d)
 
 DEFINE_EXPECT (testobj_onlydispid_i)
 
 DEFINE_EXPECT (testobj_notexists_d)
 
 DEFINE_EXPECT (testobj_newenum)
 
 DEFINE_EXPECT (enumvariant_next_0)
 
 DEFINE_EXPECT (enumvariant_next_1)
 
 DEFINE_EXPECT (enumvariant_reset)
 
 DEFINE_EXPECT (GetItemInfo_testVal)
 
 DEFINE_EXPECT (ActiveScriptSite_OnScriptError)
 
 DEFINE_EXPECT (invoke_func)
 
 DEFINE_EXPECT (DeleteMemberByDispID)
 
 DEFINE_EXPECT (DeleteMemberByDispID_false)
 
 DEFINE_EXPECT (DeleteMemberByDispID_error)
 
 DEFINE_EXPECT (BindHandler)
 
static BOOL is_lang_english (void)
 
static BSTR a2bstr (const char *str)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
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 *This, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched)
 
static HRESULT WINAPI EnumVARIANT_Skip (IEnumVARIANT *This, ULONG celt)
 
static HRESULT WINAPI EnumVARIANT_Reset (IEnumVARIANT *This)
 
static HRESULT WINAPI EnumVARIANT_Clone (IEnumVARIANT *This, 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_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 *res, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
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 testObj_Invoke (IDispatchEx *iface, DISPID id, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, UINT *puArgErr)
 
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 testObj_DeleteMemberByName (IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
 
static HRESULT WINAPI dispexFunc_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *res, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI pureDisp_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI pureDisp_GetIDsOfNames (IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI pureDisp_Invoke (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *res, EXCEPINFO *ei, UINT *puArgErr)
 
static HRESULT WINAPI BindEventHandler_QueryInterface (IBindEventHandler *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI BindEventHandler_AddRef (IBindEventHandler *iface)
 
static ULONG WINAPI BindEventHandler_Release (IBindEventHandler *iface)
 
static HRESULT WINAPI BindEventHandler_BindHandler (IBindEventHandler *iface, const WCHAR *event, IDispatch *disp)
 
static HRESULT WINAPI bindEventHandlerDisp_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
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 Global_DeleteMemberByDispID (IDispatchEx *iface, DISPID id)
 
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 HRESULT WINAPI ActiveScriptSite_OnScriptError_CheckError (IActiveScriptSite *iface, IActiveScriptError *pscripterror)
 
static HRESULT set_script_prop (IActiveScript *engine, DWORD property, VARIANT *val)
 
static IActiveScriptcreate_script (void)
 
static HRESULT parse_script (DWORD flags, BSTR script_str)
 
static HRESULT invoke_procedure (const char *argsa, const char *sourcea, DISPPARAMS *dp)
 
static HRESULT parse_htmlscript (BSTR script_str)
 
static void test_IActiveScriptError (IActiveScriptError *error, SCODE errorcode, ULONG line, LONG pos, BSTR script_source, BSTR description, BSTR line_text)
 
static void parse_script_with_error (DWORD flags, BSTR script_str, SCODE errorcode, ULONG line, LONG pos, BSTR script_source, BSTR description, BSTR line_text)
 
static void parse_script_af (DWORD flags, const char *src)
 
static void parse_script_a (const char *src)
 
static void parse_script_ae (const char *src, HRESULT exhres)
 
static void parse_script_with_error_a (const char *src, SCODE errorcode, ULONG line, LONG pos, LPCSTR source, LPCSTR desc, LPCSTR linetext)
 
static HRESULT parse_htmlscript_a (const char *src)
 
static BSTR get_script_from_file (const char *filename)
 
static void run_from_file (const char *filename)
 
static BSTR load_res (const char *name)
 
static void run_from_res (const char *name)
 
static void test_isvisible (BOOL global_members)
 
static void test_start (void)
 
static void test_automagic (void)
 
static HRESULT parse_script_expr (const char *expr, VARIANT *res, IActiveScript **engine_ret)
 
static void test_retval (void)
 
static void test_default_value (void)
 
static void test_script_exprs (void)
 
static void test_invokeex (void)
 
static void test_eval (void)
 
static void run_bom_tests (void)
 
static BOOL run_tests (void)
 
static void test_parse_proc (void)
 
static void run_encoded_tests (void)
 
static void run_benchmark (const char *script_name)
 
static void run_benchmarks (void)
 
static BOOL check_jscript (void)
 
 START_TEST (run)
 

Variables

static const CLSID CLSID_JScript
 
static const CLSID CLSID_JScriptEncode
 
static const WCHAR testW [] = {'t','e','s','t',0}
 
static const CHAR testA [] = "test"
 
static const WCHAR test_valW [] = {'t','e','s','t','V','a','l',0}
 
static const CHAR test_valA [] = "testVal"
 
static const WCHAR emptyW [] = {0}
 
static BOOL strict_dispid_check
 
static BOOL testing_expr
 
static const chartest_name = "(null)"
 
static IDispatchscript_disp
 
static int invoke_version
 
static IActiveScriptErrorscript_error
 
static IActiveScriptscript_engine
 
static const CLSIDengine_clsid = &CLSID_JScript
 
static int EnumVARIANT_index = 0
 
static int EnumVARIANT_next_0_count = 0
 
static IEnumVARIANTVtbl testEnumVARIANTVtbl
 
static IEnumVARIANT testEnumVARIANT = { &testEnumVARIANTVtbl }
 
static IDispatchExVtbl testObjVtbl
 
static IDispatchEx testObj = { &testObjVtbl }
 
static IDispatchExVtbl dispexFuncVtbl
 
static IDispatchEx dispexFunc = { &dispexFuncVtbl }
 
static IDispatchExVtbl pureDispVtbl
 
static IDispatchEx pureDisp = { &pureDispVtbl }
 
static const IBindEventHandlerVtbl BindEventHandlerVtbl
 
static IBindEventHandler BindEventHandler = { &BindEventHandlerVtbl }
 
static IDispatchExVtbl bindEventHandlerDispVtbl
 
static IDispatchEx bindEventHandlerDisp = { &bindEventHandlerDispVtbl }
 
static IDispatchExVtbl GlobalVtbl
 
static IDispatchEx Global = { &GlobalVtbl }
 
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
 
static IActiveScriptSite ActiveScriptSite = { &ActiveScriptSiteVtbl }
 
static const IActiveScriptSiteVtbl ActiveScriptSite_CheckErrorVtbl
 
static IActiveScriptSite ActiveScriptSite_CheckError = { &ActiveScriptSite_CheckErrorVtbl }
 

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

◆ CHECK_EXPECT

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

Definition at line 67 of file run.c.

◆ CHECK_EXPECT2

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

Definition at line 61 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_GLOBAL_BINDEVENTHANDLER

#define DISPID_GLOBAL_BINDEVENTHANDLER   0x101d

Definition at line 154 of file run.c.

◆ DISPID_GLOBAL_CALLEVAL

#define DISPID_GLOBAL_CALLEVAL   0x101f

Definition at line 156 of file run.c.

◆ DISPID_GLOBAL_CREATEARRAY

#define DISPID_GLOBAL_CREATEARRAY   0x100c

Definition at line 137 of file run.c.

◆ DISPID_GLOBAL_DISPEXFUNC

#define DISPID_GLOBAL_DISPEXFUNC   0x101a

Definition at line 151 of file run.c.

◆ DISPID_GLOBAL_DISPUNK

#define DISPID_GLOBAL_DISPUNK   0x1017

Definition at line 148 of file run.c.

◆ DISPID_GLOBAL_GETNULLBSTR

#define DISPID_GLOBAL_GETNULLBSTR   0x1007

Definition at line 132 of file run.c.

◆ DISPID_GLOBAL_GETSCRIPTSTATE

#define DISPID_GLOBAL_GETSCRIPTSTATE   0x101c

Definition at line 153 of file run.c.

◆ DISPID_GLOBAL_GETSHORT

#define DISPID_GLOBAL_GETSHORT   0x1014

Definition at line 145 of file run.c.

◆ DISPID_GLOBAL_GETVT

#define DISPID_GLOBAL_GETVT   0x1005

Definition at line 130 of file run.c.

◆ DISPID_GLOBAL_INTPROP

#define DISPID_GLOBAL_INTPROP   0x1016

Definition at line 147 of file run.c.

◆ DISPID_GLOBAL_INVOKEVERSION

#define DISPID_GLOBAL_INVOKEVERSION   0x100b

Definition at line 136 of file run.c.

◆ DISPID_GLOBAL_ISNULLBSTR

#define DISPID_GLOBAL_ISNULLBSTR   0x1011

Definition at line 142 of file run.c.

◆ DISPID_GLOBAL_ISWIN64

#define DISPID_GLOBAL_ISWIN64   0x100f

Definition at line 140 of file run.c.

◆ DISPID_GLOBAL_NULL_DISP

#define DISPID_GLOBAL_NULL_DISP   0x1008

Definition at line 133 of file run.c.

◆ DISPID_GLOBAL_OBJECT_FLAG

#define DISPID_GLOBAL_OBJECT_FLAG   0x100e

Definition at line 139 of file run.c.

◆ DISPID_GLOBAL_OK

#define DISPID_GLOBAL_OK   0x1004

Definition at line 129 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUT

#define DISPID_GLOBAL_PROPARGPUT   0x1012

Definition at line 143 of file run.c.

◆ DISPID_GLOBAL_PROPARGPUTOP

#define DISPID_GLOBAL_PROPARGPUTOP   0x1020

Definition at line 157 of file run.c.

◆ DISPID_GLOBAL_PROPGETFUNC

#define DISPID_GLOBAL_PROPGETFUNC   0x100d

Definition at line 138 of file run.c.

◆ DISPID_GLOBAL_PUREDISP

#define DISPID_GLOBAL_PUREDISP   0x1010

Definition at line 141 of file run.c.

◆ DISPID_GLOBAL_REPORTSUCCESS

#define DISPID_GLOBAL_REPORTSUCCESS   0x1002

Definition at line 127 of file run.c.

◆ DISPID_GLOBAL_SHORTPROP

#define DISPID_GLOBAL_SHORTPROP   0x1013

Definition at line 144 of file run.c.

◆ DISPID_GLOBAL_TESTARGTYPES

#define DISPID_GLOBAL_TESTARGTYPES   0x1015

Definition at line 146 of file run.c.

◆ DISPID_GLOBAL_TESTENUMOBJ

#define DISPID_GLOBAL_TESTENUMOBJ   0x101e

Definition at line 155 of file run.c.

◆ DISPID_GLOBAL_TESTNOPROPDELETE

#define DISPID_GLOBAL_TESTNOPROPDELETE   0x2001

Definition at line 160 of file run.c.

◆ DISPID_GLOBAL_TESTNORES

#define DISPID_GLOBAL_TESTNORES   0x1019

Definition at line 150 of file run.c.

◆ DISPID_GLOBAL_TESTOBJ

#define DISPID_GLOBAL_TESTOBJ   0x1006

Definition at line 131 of file run.c.

◆ DISPID_GLOBAL_TESTPROPDELETE

#define DISPID_GLOBAL_TESTPROPDELETE   0x2000

Definition at line 159 of file run.c.

◆ DISPID_GLOBAL_TESTPROPDELETEERROR

#define DISPID_GLOBAL_TESTPROPDELETEERROR   0x2002

Definition at line 161 of file run.c.

◆ DISPID_GLOBAL_TESTPROPGET

#define DISPID_GLOBAL_TESTPROPGET   0x1000

Definition at line 125 of file run.c.

◆ DISPID_GLOBAL_TESTPROPPUT

#define DISPID_GLOBAL_TESTPROPPUT   0x1001

Definition at line 126 of file run.c.

◆ DISPID_GLOBAL_TESTPROPPUTREF

#define DISPID_GLOBAL_TESTPROPPUTREF   0x101b

Definition at line 152 of file run.c.

◆ DISPID_GLOBAL_TESTRES

#define DISPID_GLOBAL_TESTRES   0x1018

Definition at line 149 of file run.c.

◆ DISPID_GLOBAL_TESTTHIS

#define DISPID_GLOBAL_TESTTHIS   0x1009

Definition at line 134 of file run.c.

◆ DISPID_GLOBAL_TESTTHIS2

#define DISPID_GLOBAL_TESTTHIS2   0x100a

Definition at line 135 of file run.c.

◆ DISPID_GLOBAL_TRACE

#define DISPID_GLOBAL_TRACE   0x1003

Definition at line 128 of file run.c.

◆ DISPID_TESTOBJ_ONLYDISPID

#define DISPID_TESTOBJ_ONLYDISPID   0x2001

Definition at line 164 of file run.c.

◆ DISPID_TESTOBJ_PROP

#define DISPID_TESTOBJ_PROP   0x2000

Definition at line 163 of file run.c.

◆ DISPID_TESTOBJ_WITHPROP

#define DISPID_TESTOBJ_WITHPROP   0x2002

Definition at line 165 of file run.c.

◆ IActiveScriptParse_InitNew

#define IActiveScriptParse_InitNew   IActiveScriptParse32_InitNew

Definition at line 43 of file run.c.

◆ IActiveScriptParse_ParseScriptText

#define IActiveScriptParse_ParseScriptText   IActiveScriptParse32_ParseScriptText

Definition at line 44 of file run.c.

◆ IActiveScriptParse_QueryInterface

#define IActiveScriptParse_QueryInterface   IActiveScriptParse32_QueryInterface

Definition at line 41 of file run.c.

◆ IActiveScriptParse_Release

#define IActiveScriptParse_Release   IActiveScriptParse32_Release

Definition at line 42 of file run.c.

◆ IActiveScriptParseProcedure2_ParseProcedureText

#define IActiveScriptParseProcedure2_ParseProcedureText   IActiveScriptParseProcedure2_32_ParseProcedureText

Definition at line 46 of file run.c.

◆ IActiveScriptParseProcedure2_Release

#define IActiveScriptParseProcedure2_Release   IActiveScriptParseProcedure2_32_Release

Definition at line 45 of file run.c.

◆ JS_E_INVALID_CHAR

#define JS_E_INVALID_CHAR   0x800a03f6

Definition at line 168 of file run.c.

◆ JS_E_OUT_OF_MEMORY

#define JS_E_OUT_OF_MEMORY   0x800a03ec

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

Function Documentation

◆ _test_grfdex()

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

Definition at line 227 of file run.c.

228{
229 expect |= invoke_version << 28;
230 ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
231}
#define expect(EXPECTED, GOT)
Definition: SystemMenu.c:483
#define ok_(x1, x2)
Definition: atltest.h:61
static int invoke_version
Definition: run.c:179
Definition: parser.c:49

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 207 of file run.c.

208{
209 BSTR ret;
210 int len;
211
212 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
215
216 return ret;
217}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
OLECHAR * BSTR
Definition: compat.h:2293
#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

Referenced by _parse_htmlscript_a(), check_jscript(), Dispatch_Invoke(), Global_InvokeEx(), invoke_procedure(), parse_htmlscript(), parse_htmlscript_a(), parse_procedure(), parse_script_ae(), parse_script_af(), parse_script_ar(), parse_script_expr(), parse_script_with_error_a(), run_encoded_tests(), test_automagic(), test_disp(), test_eval(), test_gc(), test_global_vars_ref(), test_invokeex(), test_isexpression(), test_parse_context(), test_retval(), and test_start().

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 1665 of file run.c.

1666{
1667 return 2;
1668}

◆ ActiveScriptSite_GetDocVersionString()

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

Definition at line 1696 of file run.c.

1697{
1698 return E_NOTIMPL;
1699}
#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 1681 of file run.c.

1683{
1684 ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
1685 ok(!ppti, "ppti != NULL\n");
1686
1687 if(!strcmp_wa(pstrName, test_valA))
1688 CHECK_EXPECT(GetItemInfo_testVal);
1689 else if(strcmp_wa(pstrName, testA))
1690 ok(0, "unexpected pstrName %s\n", wine_dbgstr_w(pstrName));
1691
1692 *ppiunkItem = (IUnknown*)&Global;
1693 return S_OK;
1694}
#define ok(value,...)
Definition: atltest.h:57
#define S_OK
Definition: intsafe.h:52
#define wine_dbgstr_w
Definition: kernel32.h:34
static const CHAR testA[]
Definition: run.c:171
#define CHECK_EXPECT(func)
Definition: run.c:67
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
static const CHAR test_valA[]
Definition: run.c:173
static IDispatchEx Global
Definition: run.c:1648

◆ ActiveScriptSite_GetLCID()

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

Definition at line 1675 of file run.c.

1676{
1677 *plcid = GetUserDefaultLCID();
1678 return S_OK;
1679}
LCID WINAPI GetUserDefaultLCID(void)
Definition: locale.c:1211

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 1717 of file run.c.

1718{
1719 return E_NOTIMPL;
1720}

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 1722 of file run.c.

1723{
1724 return E_NOTIMPL;
1725}

◆ ActiveScriptSite_OnScriptError()

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

Definition at line 1712 of file run.c.

1713{
1714 return E_NOTIMPL;
1715}

Referenced by ActiveScriptSite_OnScriptError_CheckError(), and parse_script_with_error().

◆ ActiveScriptSite_OnScriptError_CheckError()

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

Definition at line 1745 of file run.c.

1746{
1747 ok(pscripterror != NULL, "ActiveScriptSite_OnScriptError -- expected pscripterror to be set, got NULL\n");
1748
1749 script_error = pscripterror;
1750 IActiveScriptError_AddRef(script_error);
1751
1753
1754 return S_OK;
1755}
static IActiveScriptError * script_error
Definition: run.c:180
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: run.c:1712

◆ ActiveScriptSite_OnScriptTerminate()

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

Definition at line 1701 of file run.c.

1703{
1704 return E_NOTIMPL;
1705}

◆ ActiveScriptSite_OnStateChange()

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

Definition at line 1707 of file run.c.

1708{
1709 return E_NOTIMPL;
1710}

◆ ActiveScriptSite_QueryInterface()

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

Definition at line 1650 of file run.c.

1651{
1652 *ppv = NULL;
1653
1655 *ppv = iface;
1656 else if(IsEqualGUID(&IID_IActiveScriptSite, riid))
1657 *ppv = iface;
1658 else
1659 return E_NOINTERFACE;
1660
1661 IUnknown_AddRef((IUnknown*)*ppv);
1662 return S_OK;
1663}
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 1670 of file run.c.

1671{
1672 return 1;
1673}

◆ BindEventHandler_AddRef()

static ULONG WINAPI BindEventHandler_AddRef ( IBindEventHandler iface)
static

Definition at line 738 of file run.c.

739{
740 return 2;
741}

◆ BindEventHandler_BindHandler()

static HRESULT WINAPI BindEventHandler_BindHandler ( IBindEventHandler iface,
const WCHAR event,
IDispatch disp 
)
static

Definition at line 748 of file run.c.

749{
750 CHECK_EXPECT(BindHandler);
751 ok(!strcmp_wa(event, "eventName"), "event = %s\n", wine_dbgstr_w(event));
752 ok(disp != NULL, "disp = NULL\n");
753 return S_OK;
754}
struct _cl_event * event
Definition: glext.h:7739

◆ BindEventHandler_QueryInterface()

static HRESULT WINAPI BindEventHandler_QueryInterface ( IBindEventHandler iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 732 of file run.c.

733{
734 ok(0, "unexpected call\n");
735 return E_NOINTERFACE;
736}

◆ BindEventHandler_Release()

static ULONG WINAPI BindEventHandler_Release ( IBindEventHandler iface)
static

Definition at line 743 of file run.c.

744{
745 return 1;
746}

◆ bindEventHandlerDisp_QueryInterface()

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

Definition at line 765 of file run.c.

766{
767 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDispatch) || IsEqualGUID(riid, &IID_IDispatchEx)) {
768 *ppv = iface;
769 return S_OK;
770 }
771
772 if(IsEqualGUID(riid, &IID_IBindEventHandler)) {
774 return S_OK;
775 }
776
777 *ppv = NULL;
778 return E_NOINTERFACE;
779}
static IBindEventHandler BindEventHandler
Definition: run.c:763
const GUID IID_IDispatch

◆ check_jscript()

static BOOL check_jscript ( void  )
static

Definition at line 3304 of file run.c.

3305{
3306 IActiveScriptProperty *script_prop;
3307 BSTR str;
3308 HRESULT hres;
3309
3310 hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
3311 &IID_IActiveScriptProperty, (void**)&script_prop);
3312 if(FAILED(hres))
3313 return FALSE;
3314 IActiveScriptProperty_Release(script_prop);
3315
3316 str = a2bstr("if(!('localeCompare' in String.prototype)) throw 1;");
3317 hres = parse_script(0, str);
3319
3320 return hres == S_OK;
3321}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hres
Definition: protocol.c:465
static const CLSID CLSID_JScript
Definition: run.c:50
static BSTR a2bstr(const char *str)
Definition: run.c:207
static HRESULT parse_script(DWORD flags, BSTR script_str)
Definition: run.c:1810
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

Referenced by START_TEST().

◆ create_script()

static IActiveScript * create_script ( void  )
static

Definition at line 1788 of file run.c.

1789{
1791 VARIANT v;
1792 HRESULT hres;
1793
1794 hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1795 &IID_IActiveScript, (void**)&script);
1796 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
1797
1798 V_VT(&v) = VT_I4;
1799 V_I4(&v) = invoke_version;
1800 hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
1801 ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
1802 if(invoke_version && FAILED(hres)) {
1803 IActiveScript_Release(script);
1804 return NULL;
1805 }
1806
1807 return script;
1808}
#define broken(x)
Definition: atltest.h:178
@ VT_I4
Definition: compat.h:2298
const GLdouble * v
Definition: gl.h:2040
static const CLSID * engine_clsid
Definition: run.c:182
static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *val)
Definition: run.c:1773
script
Definition: msipriv.h:383
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247

Referenced by create_and_init_script(), invoke_procedure(), parse_htmlscript(), parse_script(), parse_script_expr(), parse_script_with_error(), run_benchmark(), run_tests(), test_automagic(), test_eval(), test_gc(), test_global_vars_ref(), test_isvisible(), test_retval(), and test_start().

◆ DEFINE_EXPECT() [1/45]

DEFINE_EXPECT ( ActiveScriptSite_OnScriptError  )

◆ DEFINE_EXPECT() [2/45]

DEFINE_EXPECT ( BindHandler  )

◆ DEFINE_EXPECT() [3/45]

DEFINE_EXPECT ( DeleteMemberByDispID  )

◆ DEFINE_EXPECT() [4/45]

DEFINE_EXPECT ( DeleteMemberByDispID_error  )

◆ DEFINE_EXPECT() [5/45]

DEFINE_EXPECT ( DeleteMemberByDispID_false  )

◆ DEFINE_EXPECT() [6/45]

DEFINE_EXPECT ( dispexfunc_value  )

◆ DEFINE_EXPECT() [7/45]

DEFINE_EXPECT ( enumvariant_next_0  )

◆ DEFINE_EXPECT() [8/45]

DEFINE_EXPECT ( enumvariant_next_1  )

◆ DEFINE_EXPECT() [9/45]

DEFINE_EXPECT ( enumvariant_reset  )

◆ DEFINE_EXPECT() [10/45]

DEFINE_EXPECT ( GetItemInfo_testVal  )

◆ DEFINE_EXPECT() [11/45]

DEFINE_EXPECT ( global_calleval_i  )

◆ DEFINE_EXPECT() [12/45]

DEFINE_EXPECT ( global_nopropdelete_d  )

◆ DEFINE_EXPECT() [13/45]

DEFINE_EXPECT ( global_notexists_d  )

◆ DEFINE_EXPECT() [14/45]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [15/45]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [16/45]

DEFINE_EXPECT ( global_propargputop_d  )

◆ DEFINE_EXPECT() [17/45]

DEFINE_EXPECT ( global_propargputop_get_i  )

◆ DEFINE_EXPECT() [18/45]

DEFINE_EXPECT ( global_propargputop_put_i  )

◆ DEFINE_EXPECT() [19/45]

DEFINE_EXPECT ( global_propdelete_d  )

◆ DEFINE_EXPECT() [20/45]

DEFINE_EXPECT ( global_propdeleteerror_d  )

◆ DEFINE_EXPECT() [21/45]

DEFINE_EXPECT ( global_propget_d  )

◆ DEFINE_EXPECT() [22/45]

DEFINE_EXPECT ( global_propget_i  )

◆ DEFINE_EXPECT() [23/45]

DEFINE_EXPECT ( global_propput_d  )

◆ DEFINE_EXPECT() [24/45]

DEFINE_EXPECT ( global_propput_i  )

◆ DEFINE_EXPECT() [25/45]

DEFINE_EXPECT ( global_propputref_d  )

◆ DEFINE_EXPECT() [26/45]

DEFINE_EXPECT ( global_propputref_i  )

◆ DEFINE_EXPECT() [27/45]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [28/45]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [29/45]

DEFINE_EXPECT ( global_testargtypes_i  )

◆ DEFINE_EXPECT() [30/45]

DEFINE_EXPECT ( invoke_func  )

◆ DEFINE_EXPECT() [31/45]

DEFINE_EXPECT ( puredisp_noprop_d  )

◆ DEFINE_EXPECT() [32/45]

DEFINE_EXPECT ( puredisp_prop_d  )

◆ DEFINE_EXPECT() [33/45]

DEFINE_EXPECT ( puredisp_value  )

◆ DEFINE_EXPECT() [34/45]

DEFINE_EXPECT ( testobj_construct  )

◆ DEFINE_EXPECT() [35/45]

DEFINE_EXPECT ( testobj_delete_nodelete  )

◆ DEFINE_EXPECT() [36/45]

DEFINE_EXPECT ( testobj_delete_test  )

◆ DEFINE_EXPECT() [37/45]

DEFINE_EXPECT ( testobj_newenum  )

◆ DEFINE_EXPECT() [38/45]

DEFINE_EXPECT ( testobj_noprop_d  )

◆ DEFINE_EXPECT() [39/45]

DEFINE_EXPECT ( testobj_notexists_d  )

◆ DEFINE_EXPECT() [40/45]

DEFINE_EXPECT ( testobj_onlydispid_d  )

◆ DEFINE_EXPECT() [41/45]

DEFINE_EXPECT ( testobj_onlydispid_i  )

◆ DEFINE_EXPECT() [42/45]

DEFINE_EXPECT ( testobj_prop_d  )

◆ DEFINE_EXPECT() [43/45]

DEFINE_EXPECT ( testobj_value  )

◆ DEFINE_EXPECT() [44/45]

DEFINE_EXPECT ( testobj_withprop_d  )

◆ DEFINE_EXPECT() [45/45]

DEFINE_EXPECT ( testobj_withprop_i  )

◆ DispatchEx_AddRef()

static ULONG WINAPI DispatchEx_AddRef ( IDispatchEx iface)
static

Definition at line 342 of file run.c.

343{
344 return 2;
345}

◆ DispatchEx_DeleteMemberByDispID()

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

Definition at line 399 of file run.c.

400{
401 ok(0, "unexpected call\n");
402 return E_NOTIMPL;
403}

◆ DispatchEx_DeleteMemberByName()

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

Definition at line 393 of file run.c.

394{
395 ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
396 return E_NOTIMPL;
397}

◆ DispatchEx_GetDispID()

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

Definition at line 380 of file run.c.

381{
382 ok(0, "unexpected call\n");
383 return E_NOTIMPL;
384}

◆ DispatchEx_GetIDsOfNames()

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

Definition at line 364 of file run.c.

367{
368 ok(0, "unexpected call\n");
369 return E_NOTIMPL;
370}

◆ DispatchEx_GetMemberName()

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

Definition at line 411 of file run.c.

412{
413 ok(0, "unexpected call\n");
414 return E_NOTIMPL;
415}

◆ DispatchEx_GetMemberProperties()

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

Definition at line 405 of file run.c.

406{
407 ok(0, "unexpected call\n");
408 return E_NOTIMPL;
409}

◆ DispatchEx_GetNameSpaceParent()

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

Definition at line 423 of file run.c.

424{
425 ok(0, "unexpected call\n");
426 return E_NOTIMPL;
427}

◆ DispatchEx_GetNextDispID()

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

Definition at line 417 of file run.c.

418{
419 ok(0, "unexpected call\n");
420 return E_NOTIMPL;
421}

◆ DispatchEx_GetTypeInfo()

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

Definition at line 358 of file run.c.

360{
361 return E_NOTIMPL;
362}

◆ DispatchEx_GetTypeInfoCount()

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

Definition at line 352 of file run.c.

353{
354 ok(0, "unexpected call\n");
355 return E_NOTIMPL;
356}

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

375{
376 ok(0, "unexpected call\n");
377 return E_NOTIMPL;
378}

◆ DispatchEx_InvokeEx()

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

Definition at line 386 of file run.c.

388{
389 ok(0, "unexpected call\n");
390 return E_NOTIMPL;
391}

◆ DispatchEx_QueryInterface()

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

Definition at line 328 of file run.c.

329{
330 *ppv = NULL;
331
334 || IsEqualGUID(riid, &IID_IDispatchEx))
335 *ppv = iface;
336 else
337 return E_NOINTERFACE;
338
339 return S_OK;
340}

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx iface)
static

Definition at line 347 of file run.c.

348{
349 return 1;
350}

◆ dispexFunc_InvokeEx()

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

Definition at line 597 of file run.c.

599{
600 ok(pspCaller != NULL, "pspCaller = NULL\n");
601
602 switch(id) {
603 case DISPID_VALUE:
604 CHECK_EXPECT(dispexfunc_value);
605
606 ok(pdp != NULL, "pdp == NULL\n");
607 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
608 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs != NULL\n");
609 ok(*pdp->rgdispidNamedArgs == DISPID_THIS, "*rgdispidNamedArgs = %d\n", *pdp->rgdispidNamedArgs);
610 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
611 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
612 ok(res != NULL, "res == NULL\n");
613 ok(pei != NULL, "pei == NULL\n");
614
615 ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
616
617 if(V_BOOL(pdp->rgvarg+1))
618 /* NOTE: If called by Function.apply(), native doesn't set DISPATCH_PROPERTYGET flag. */
619 todo_wine ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
620 else
621 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
622
623 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
624 ok(V_DISPATCH(pdp->rgvarg) != NULL, "V_DISPATCH(pdp->rgvarg) == NULL\n");
625
626 if(res)
627 V_VT(res) = VT_NULL;
628 return S_OK;
629 default:
630 ok(0, "unexpected call %x\n", id);
632 }
633}
@ VT_NULL
Definition: compat.h:2296
@ VT_BOOL
Definition: compat.h:2306
@ VT_DISPATCH
Definition: compat.h:2304
GLuint res
Definition: glext.h:9613
#define todo_wine
Definition: custom.c:89
#define V_BOOL(A)
Definition: oleauto.h:224
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISPID_THIS
Definition: olectl.h:395
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512

◆ EnumVARIANT_AddRef()

static ULONG WINAPI EnumVARIANT_AddRef ( IEnumVARIANT iface)
static

Definition at line 245 of file run.c.

246{
247 return 2;
248}

◆ EnumVARIANT_Clone()

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

Definition at line 308 of file run.c.

311{
312 ok(0, "EnumVariant_Clone: unexpected call\n");
313 return E_NOTIMPL;
314}

◆ EnumVARIANT_Next()

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

Definition at line 257 of file run.c.

262{
263 ok(rgVar != NULL, "rgVar is NULL\n");
264 ok(celt == 1, "celt = %d\n", celt);
265 ok(pCeltFetched == NULL, "pCeltFetched is not NULL\n");
266
267 if (!rgVar)
268 return S_FALSE;
269
270 if (EnumVARIANT_index == 0)
271 {
274 CHECK_EXPECT(enumvariant_next_0);
275
276 V_VT(rgVar) = VT_I4;
277 V_I4(rgVar) = 123;
278
279 if (pCeltFetched)
280 *pCeltFetched = 1;
282 return S_OK;
283 }
284
285 CHECK_EXPECT(enumvariant_next_1);
286
287 if (pCeltFetched)
288 *pCeltFetched = 0;
289 return S_FALSE;
290
291}
static int EnumVARIANT_next_0_count
Definition: run.c:256
static int EnumVARIANT_index
Definition: run.c:255
#define S_FALSE
Definition: winerror.h:2357

◆ EnumVARIANT_QueryInterface()

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

Definition at line 233 of file run.c.

234{
235 *ppv = NULL;
236
237 if (IsEqualGUID(riid, &IID_IEnumVARIANT))
238 *ppv = iface;
239 else
240 return E_NOINTERFACE;
241
242 return S_OK;
243}

◆ EnumVARIANT_Release()

static ULONG WINAPI EnumVARIANT_Release ( IEnumVARIANT iface)
static

Definition at line 250 of file run.c.

251{
252 return 1;
253}

◆ EnumVARIANT_Reset()

static HRESULT WINAPI EnumVARIANT_Reset ( IEnumVARIANT This)
static

Definition at line 300 of file run.c.

302{
303 CHECK_EXPECT(enumvariant_reset);
305 return S_OK;
306}

◆ EnumVARIANT_Skip()

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

Definition at line 293 of file run.c.

296{
297 ok(0, "EnumVariant_Skip: unexpected call\n");
298 return E_NOTIMPL;
299}

◆ get_script_from_file()

static BSTR get_script_from_file ( const char filename)
static

Definition at line 2148 of file run.c.

2149{
2150 DWORD size, len;
2151 HANDLE file, map;
2152 const char *file_map;
2153 BSTR ret;
2154
2156 if(file == INVALID_HANDLE_VALUE) {
2157 trace("Could not open file: %u\n", GetLastError());
2158 return NULL;
2159 }
2160
2162
2165 if(map == INVALID_HANDLE_VALUE) {
2166 trace("Could not create file mapping: %u\n", GetLastError());
2167 return NULL;
2168 }
2169
2170 file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
2172 if(!file_map) {
2173 trace("MapViewOfFile failed: %u\n", GetLastError());
2174 return NULL;
2175 }
2176
2177 len = MultiByteToWideChar(CP_ACP, 0, file_map, size, NULL, 0);
2179 MultiByteToWideChar(CP_ACP, 0, file_map, size, ret, len);
2180
2181 UnmapViewOfFile(file_map);
2182
2183 return ret;
2184}
#define trace
Definition: atltest.h:70
Definition: _map.h:48
#define CloseHandle
Definition: compat.h:739
#define PAGE_READONLY
Definition: compat.h:138
#define UnmapViewOfFile
Definition: compat.h:746
#define OPEN_EXISTING
Definition: compat.h:775
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:744
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
#define GENERIC_READ
Definition: compat.h:135
#define FILE_MAP_READ
Definition: compat.h:776
#define MapViewOfFile
Definition: compat.h:745
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:331
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
const char * filename
Definition: ioapi.h:137
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
Definition: fci.c:127
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by run_from_file().

◆ Global_DeleteMemberByDispID()

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

Definition at line 1611 of file run.c.

1612{
1613 switch(id) {
1615 CHECK_EXPECT(DeleteMemberByDispID);
1616 return S_OK;
1618 CHECK_EXPECT(DeleteMemberByDispID_false);
1619 return S_FALSE;
1621 CHECK_EXPECT(DeleteMemberByDispID_error);
1622 return E_FAIL;
1623 default:
1624 ok(0, "id = %d\n", id);
1625 }
1626
1627 return E_FAIL;
1628}
#define E_FAIL
Definition: ddrawi.h:102
#define DISPID_GLOBAL_TESTNOPROPDELETE
Definition: run.c:160
#define DISPID_GLOBAL_TESTPROPDELETE
Definition: run.c:159
#define DISPID_GLOBAL_TESTPROPDELETEERROR
Definition: run.c:161

◆ Global_GetDispID()

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

Definition at line 801 of file run.c.

802{
803 if(!strcmp_wa(bstrName, "ok")) {
804 test_grfdex(grfdex, fdexNameCaseSensitive);
806 return S_OK;
807 }
808 if(!strcmp_wa(bstrName, "trace")) {
809 test_grfdex(grfdex, fdexNameCaseSensitive);
811 return S_OK;
812 }
813 if(!strcmp_wa(bstrName, "reportSuccess")) {
814 CHECK_EXPECT(global_success_d);
815 test_grfdex(grfdex, fdexNameCaseSensitive);
817 return S_OK;
818 }
819 if(!strcmp_wa(bstrName, "testPropGet")) {
820 CHECK_EXPECT(global_propget_d);
821 test_grfdex(grfdex, fdexNameCaseSensitive);
823 return S_OK;
824 }
825 if(!strcmp_wa(bstrName, "testPropPut")) {
826 CHECK_EXPECT(global_propput_d);
827 test_grfdex(grfdex, fdexNameCaseSensitive);
829 return S_OK;
830 }
831 if(!strcmp_wa(bstrName, "testPropPutRef")) {
832 CHECK_EXPECT(global_propputref_d);
833 test_grfdex(grfdex, fdexNameCaseSensitive);
835 return S_OK;
836 }
837 if(!strcmp_wa(bstrName, "testPropDelete")) {
838 CHECK_EXPECT(global_propdelete_d);
839 test_grfdex(grfdex, fdexNameCaseSensitive);
841 return S_OK;
842 }
843 if(!strcmp_wa(bstrName, "testNoPropDelete")) {
844 CHECK_EXPECT(global_nopropdelete_d);
845 test_grfdex(grfdex, fdexNameCaseSensitive);
847 return S_OK;
848 }
849 if(!strcmp_wa(bstrName, "testPropDeleteError")) {
850 CHECK_EXPECT(global_propdeleteerror_d);
851 test_grfdex(grfdex, fdexNameCaseSensitive);
853 return S_OK;
854 }
855 if(!strcmp_wa(bstrName, "getVT")) {
856 test_grfdex(grfdex, fdexNameCaseSensitive);
858 return S_OK;
859 }
860 if(!strcmp_wa(bstrName, "testObj")) {
861 test_grfdex(grfdex, fdexNameCaseSensitive);
863 return S_OK;
864 }
865 if(!strcmp_wa(bstrName, "getNullBSTR")) {
867 return S_OK;
868 }
869 if(!strcmp_wa(bstrName, "isNullBSTR")) {
871 return S_OK;
872 }
873 if(!strcmp_wa(bstrName, "nullDisp")) {
875 return S_OK;
876 }
877 if(!strcmp_wa(bstrName, "notExists")) {
878 CHECK_EXPECT(global_notexists_d);
879 test_grfdex(grfdex, fdexNameCaseSensitive);
880 return DISP_E_UNKNOWNNAME;
881 }
882
883 if(!strcmp_wa(bstrName, "testThis")) {
884 test_grfdex(grfdex, fdexNameCaseSensitive);
886 return S_OK;
887 }
888
889 if(!strcmp_wa(bstrName, "testThis2")) {
890 test_grfdex(grfdex, fdexNameCaseSensitive);
892 return S_OK;
893 }
894
895 if(!strcmp_wa(bstrName, "invokeVersion")) {
896 test_grfdex(grfdex, fdexNameCaseSensitive);
898 return S_OK;
899 }
900 if(!strcmp_wa(bstrName, "createArray")) {
901 test_grfdex(grfdex, fdexNameCaseSensitive);
903 return S_OK;
904 }
905 if(!strcmp_wa(bstrName, "propGetFunc")) {
906 test_grfdex(grfdex, fdexNameCaseSensitive);
908 return S_OK;
909 }
910 if(!strcmp_wa(bstrName, "objectFlag")) {
911 test_grfdex(grfdex, fdexNameCaseSensitive);
913 return S_OK;
914 }
915
916 if(!strcmp_wa(bstrName, "isWin64")) {
917 test_grfdex(grfdex, fdexNameCaseSensitive);
919 return S_OK;
920 }
921
922 if(!strcmp_wa(bstrName, "pureDisp")) {
923 test_grfdex(grfdex, fdexNameCaseSensitive);
925 return S_OK;
926 }
927
928 if(!strcmp_wa(bstrName, "propArgPutG")) {
929 CHECK_EXPECT(global_propargput_d);
930 test_grfdex(grfdex, fdexNameCaseSensitive);
932 return S_OK;
933 }
934
935 if(!strcmp_wa(bstrName, "propArgPutOp")) {
936 CHECK_EXPECT(global_propargputop_d);
937 test_grfdex(grfdex, fdexNameCaseSensitive);
939 return S_OK;
940 }
941
942 if(!strcmp_wa(bstrName, "propArgPutO")) {
943 CHECK_EXPECT(global_propargput_d);
944 test_grfdex(grfdex, fdexNameEnsure|fdexNameCaseSensitive);
946 return S_OK;
947 }
948
949 if(!strcmp_wa(bstrName, "shortProp")) {
951 return S_OK;
952 }
953
954 if(!strcmp_wa(bstrName, "getShort")) {
956 return S_OK;
957 }
958
959 if(!strcmp_wa(bstrName, "testArgTypes")) {
961 return S_OK;
962 }
963
964 if(!strcmp_wa(bstrName, "intProp")) {
966 return S_OK;
967 }
968
969 if(!strcmp_wa(bstrName, "dispUnk")) {
971 return S_OK;
972 }
973
974 if(!strcmp_wa(bstrName, "testRes")) {
976 return S_OK;
977 }
978
979 if(!strcmp_wa(bstrName, "testNoRes")) {
981 return S_OK;
982 }
983
984 if(!strcmp_wa(bstrName, "dispexFunc")) {
986 return S_OK;
987 }
988
989 if(!strcmp_wa(bstrName, "getScriptState")) {
991 return S_OK;
992 }
993
994 if(!strcmp_wa(bstrName, "bindEventHandler")) {
996 return S_OK;
997 }
998
999 if(!strcmp_wa(bstrName, "testEnumObj")) {
1001 return S_OK;
1002 }
1003
1004 if(!strcmp_wa(bstrName, "callEval")) {
1006 return S_OK;
1007 }
1008
1009 if(strict_dispid_check && strcmp_wa(bstrName, "t"))
1010 ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName));
1011 return DISP_E_UNKNOWNNAME;
1012}
#define test_grfdex(a, b)
Definition: run.c:226
#define DISPID_GLOBAL_NULL_DISP
Definition: run.c:133
#define DISPID_GLOBAL_INTPROP
Definition: run.c:147
#define DISPID_GLOBAL_PROPARGPUTOP
Definition: run.c:157
#define DISPID_GLOBAL_OBJECT_FLAG
Definition: run.c:139
#define DISPID_GLOBAL_TESTTHIS2
Definition: run.c:135
#define DISPID_GLOBAL_ISWIN64
Definition: run.c:140
#define DISPID_GLOBAL_TESTPROPPUTREF
Definition: run.c:152
#define DISPID_GLOBAL_DISPEXFUNC
Definition: run.c:151
#define DISPID_GLOBAL_TESTRES
Definition: run.c:149
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:127
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:131
#define DISPID_GLOBAL_TESTARGTYPES
Definition: run.c:146
#define DISPID_GLOBAL_TRACE
Definition: run.c:128
#define DISPID_GLOBAL_OK
Definition: run.c:129
#define DISPID_GLOBAL_CREATEARRAY
Definition: run.c:137
#define DISPID_GLOBAL_PUREDISP
Definition: run.c:141
#define DISPID_GLOBAL_TESTPROPGET
Definition: run.c:125
#define DISPID_GLOBAL_SHORTPROP
Definition: run.c:144
#define DISPID_GLOBAL_TESTTHIS
Definition: run.c:134
#define DISPID_GLOBAL_TESTPROPPUT
Definition: run.c:126
#define DISPID_GLOBAL_TESTNORES
Definition: run.c:150
#define DISPID_GLOBAL_GETVT
Definition: run.c:130
#define DISPID_GLOBAL_PROPGETFUNC
Definition: run.c:138
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:143
#define DISPID_GLOBAL_BINDEVENTHANDLER
Definition: run.c:154
#define DISPID_GLOBAL_TESTENUMOBJ
Definition: run.c:155
#define DISPID_GLOBAL_GETSHORT
Definition: run.c:145
#define DISPID_GLOBAL_DISPUNK
Definition: run.c:148
#define DISPID_GLOBAL_CALLEVAL
Definition: run.c:156
#define DISPID_GLOBAL_GETSCRIPTSTATE
Definition: run.c:153
#define DISPID_GLOBAL_INVOKEVERSION
Definition: run.c:136
#define DISPID_GLOBAL_GETNULLBSTR
Definition: run.c:132
#define DISPID_GLOBAL_ISNULLBSTR
Definition: run.c:142
static BOOL strict_dispid_check
Definition: run.c:176
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515

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

1016{
1017 ok(pspCaller != NULL, "pspCaller = NULL\n");
1018
1019 switch(id) {
1020 case DISPID_GLOBAL_OK:
1021 ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
1022 ok(pdp != NULL, "pdp == NULL\n");
1023 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1024 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1025 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1026 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1027 if(wFlags & INVOKE_PROPERTYGET)
1028 ok(pvarRes != NULL, "pvarRes == NULL\n");
1029 else
1030 ok(!pvarRes, "pvarRes != NULL\n");
1031 ok(pei != NULL, "pei == NULL\n");
1032
1033 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1034 ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1035#ifndef __REACTOS__ // Fails on Windows 2003
1036 ok(V_BOOL(pdp->rgvarg+1), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1037#endif
1038
1039 return S_OK;
1040
1042 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1043 ok(pdp != NULL, "pdp == NULL\n");
1044 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1045 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1046 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1047 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1048 ok(!pvarRes, "pvarRes != NULL\n");
1049 ok(pei != NULL, "pei == NULL\n");
1050
1051 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1052 if(V_VT(pdp->rgvarg) == VT_BSTR)
1053 trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1054
1055 return S_OK;
1056
1058 CHECK_EXPECT(global_success_i);
1059
1060 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1061 ok(pdp != NULL, "pdp == NULL\n");
1062 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1063 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1064 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1065 if(!testing_expr)
1066 ok(!pvarRes, "pvarRes != NULL\n");
1067 ok(pei != NULL, "pei == NULL\n");
1068
1069 return S_OK;
1070
1072 CHECK_EXPECT(global_propget_i);
1073
1074 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1075 ok(pdp != NULL, "pdp == NULL\n");
1076 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1077 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1078 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1079 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1080 ok(pvarRes != NULL, "pvarRes == NULL\n");
1081 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1082 ok(pei != NULL, "pei == NULL\n");
1083
1084 V_VT(pvarRes) = VT_I4;
1085 V_I4(pvarRes) = 1;
1086
1087 return S_OK;
1088
1090 CHECK_EXPECT(global_propput_i);
1091
1092 ok(wFlags == INVOKE_PROPERTYPUT, "wFlags = %x\n", wFlags);
1093 ok(pdp != NULL, "pdp == NULL\n");
1094 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1095 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1096 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1097 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1098 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1099 ok(!pvarRes, "pvarRes != NULL\n");
1100
1101 ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
1102 ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%d\n", V_I4(pdp->rgvarg));
1103 return S_OK;
1104
1106 CHECK_EXPECT(global_propputref_i);
1107
1108 ok(wFlags == (INVOKE_PROPERTYPUT|INVOKE_PROPERTYPUTREF), "wFlags = %x\n", wFlags);
1109 ok(pdp != NULL, "pdp == NULL\n");
1110 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1111 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1112 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1113 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1114 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1115 ok(!pvarRes, "pvarRes != NULL\n");
1116
1117 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
1118 return S_OK;
1119
1121 ok(pdp != NULL, "pdp == NULL\n");
1122 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1123 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1124 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1125 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1126 ok(pvarRes != NULL, "pvarRes == NULL\n");
1127 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1128 ok(pei != NULL, "pei == NULL\n");
1129
1130 V_VT(pvarRes) = VT_BSTR;
1131 switch(V_VT(pdp->rgvarg)) {
1132 case VT_EMPTY:
1133 V_BSTR(pvarRes) = a2bstr("VT_EMPTY");
1134 break;
1135 case VT_NULL:
1136 V_BSTR(pvarRes) = a2bstr("VT_NULL");
1137 break;
1138 case VT_I4:
1139 V_BSTR(pvarRes) = a2bstr("VT_I4");
1140 break;
1141 case VT_R8:
1142 V_BSTR(pvarRes) = a2bstr("VT_R8");
1143 break;
1144 case VT_BSTR:
1145 V_BSTR(pvarRes) = a2bstr("VT_BSTR");
1146 break;
1147 case VT_DISPATCH:
1148 V_BSTR(pvarRes) = a2bstr("VT_DISPATCH");
1149 break;
1150 case VT_BOOL:
1151 V_BSTR(pvarRes) = a2bstr("VT_BOOL");
1152 break;
1153 case VT_ARRAY|VT_VARIANT:
1154 V_BSTR(pvarRes) = a2bstr("VT_ARRAY|VT_VARIANT");
1155 break;
1156 default:
1157 ok(0, "unknown vt %d\n", V_VT(pdp->rgvarg));
1158 return E_FAIL;
1159 }
1160
1161 return S_OK;
1162
1164 ok(pvarRes != NULL, "pvarRes = NULL\n");
1165 if(pvarRes) {
1166 V_VT(pvarRes) = VT_BOOL;
1167 V_BOOL(pvarRes) = VARIANT_TRUE;
1168 }
1169 return S_OK;
1170
1172 ok(!pvarRes, "pvarRes != NULL\n");
1173 if(pvarRes)
1174 V_VT(pvarRes) = VT_NULL;
1175 return S_OK;
1176
1178 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1179 ok(pdp != NULL, "pdp == NULL\n");
1180 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1181 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1182 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1183 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1184 ok(pvarRes != NULL, "pvarRes == NULL\n");
1185 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1186 ok(pei != NULL, "pei == NULL\n");
1187
1188 V_VT(pvarRes) = VT_DISPATCH;
1189 V_DISPATCH(pvarRes) = (IDispatch*)&testObj;
1190 return S_OK;
1191
1193 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1194 ok(pdp != NULL, "pdp == NULL\n");
1195 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1196 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1197 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1198 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1199 ok(pvarRes != NULL, "pvarRes == NULL\n");
1200 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1201 ok(pei != NULL, "pei == NULL\n");
1202
1203 V_VT(pvarRes) = VT_DISPATCH;
1204 V_DISPATCH(pvarRes) = (IDispatch*)&pureDisp;
1205 return S_OK;
1206
1208 V_VT(pvarRes) = VT_DISPATCH;
1209 V_DISPATCH(pvarRes) = (IDispatch*)&dispexFunc;
1210 return S_OK;
1211
1213 if(pvarRes) {
1214 V_VT(pvarRes) = VT_BSTR;
1215 V_BSTR(pvarRes) = NULL;
1216 }
1217 return S_OK;
1218
1220 ok(pdp != NULL, "pdp == NULL\n");
1221 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1222 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1223 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1224 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1225 ok(pvarRes != NULL, "pvarRes == NULL\n");
1226 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1227 ok(pei != NULL, "pei == NULL\n");
1228 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1229
1230 V_VT(pvarRes) = VT_BOOL;
1231 V_BOOL(pvarRes) = V_BSTR(pdp->rgvarg) ? VARIANT_FALSE : VARIANT_TRUE;
1232 return S_OK;
1233
1235 if(pvarRes) {
1236 V_VT(pvarRes) = VT_BOOL;
1237 V_BOOL(pvarRes) = sizeof(void*) == 8 ? VARIANT_TRUE : VARIANT_FALSE;
1238 }
1239 return S_OK;
1240
1242 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1243 ok(pdp != NULL, "pdp == NULL\n");
1244 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1245 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1246 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1247 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1248 ok(pvarRes != NULL, "pvarRes == NULL\n");
1249 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1250 ok(pei != NULL, "pei == NULL\n");
1251
1252 V_VT(pvarRes) = VT_DISPATCH;
1253 V_DISPATCH(pvarRes) = NULL;
1254 return S_OK;
1255
1257 ok(pdp != NULL, "pdp == NULL\n");
1258 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1259 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1260 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1261 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1262 ok(pvarRes == NULL, "pvarRes != NULL\n");
1263 ok(pei != NULL, "pei == NULL\n");
1264
1265 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1266 ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)iface, "disp != iface\n");
1267
1268 return S_OK;
1269
1271 ok(pdp != NULL, "pdp == NULL\n");
1272 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1273 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1274 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1275 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1276 ok(pvarRes == NULL, "pvarRes != NULL\n");
1277 ok(pei != NULL, "pei == NULL\n");
1278
1279 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg));
1280 ok(V_DISPATCH(pdp->rgvarg) != (IDispatch*)iface, "disp == iface\n");
1281 ok(V_DISPATCH(pdp->rgvarg) == script_disp, "disp != script_disp\n");
1282
1283 return S_OK;
1284
1286 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1287 ok(pdp != NULL, "pdp == NULL\n");
1288 ok(!pdp->rgvarg, "rgvarg != NULL\n");
1289 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1290 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1291 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1292 ok(pvarRes != NULL, "pvarRes == NULL\n");
1293 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1294 ok(pei != NULL, "pei == NULL\n");
1295
1296 V_VT(pvarRes) = VT_I4;
1297 V_I4(pvarRes) = invoke_version;
1298
1299 return S_OK;
1300
1302 SAFEARRAYBOUND bound[2];
1303 VARIANT *data;
1304 int i,j;
1305
1306 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1307 ok(pdp != NULL, "pdp == NULL\n");
1308 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1309 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1310 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1311 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1312 ok(pvarRes != NULL, "pvarRes == NULL\n");
1313 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1314 ok(pei != NULL, "pei == NULL\n");
1315
1316 bound[0].lLbound = 0;
1317 bound[0].cElements = 5;
1318 bound[1].lLbound = 2;
1319 bound[1].cElements = 2;
1320
1321 V_VT(pvarRes) = VT_ARRAY|VT_VARIANT;
1322 V_ARRAY(pvarRes) = SafeArrayCreate(VT_VARIANT, 2, bound);
1323
1324 SafeArrayAccessData(V_ARRAY(pvarRes), (void**)&data);
1325 for(i=0; i<5; i++) {
1326 for(j=2; j<4; j++) {
1327 V_VT(data) = VT_I4;
1328 V_I4(data) = i*10+j;
1329 data++;
1330 }
1331 }
1333
1334 return S_OK;
1335 }
1336
1338 switch(wFlags) {
1339 case INVOKE_FUNC:
1340 CHECK_EXPECT(invoke_func);
1341 break;
1342 case INVOKE_FUNC|INVOKE_PROPERTYGET:
1343 ok(pdp->cArgs != 0, "pdp->cArgs = %d\n", pdp->cArgs);
1344 ok(pvarRes != NULL, "pdp->pvarRes == NULL\n");
1345 break;
1346 default:
1347 ok(0, "invalid flag (%x)\n", wFlags);
1348 }
1349
1350 ok(pdp != NULL, "pdp == NULL\n");
1351 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1352 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1353 ok(pei != NULL, "pei == NULL\n");
1354
1355 if(pvarRes) {
1356 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1357 V_VT(pvarRes) = VT_I4;
1358 V_I4(pvarRes) = pdp->cArgs;
1359 }
1360
1361 return S_OK;
1362
1365 HRESULT hres;
1366
1367 hres = IActiveScript_GetScriptState(script_engine, &state);
1368 ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
1369
1370 V_VT(pvarRes) = VT_I4;
1371 V_I4(pvarRes) = state;
1372 return S_OK;
1373 }
1374
1376 V_VT(pvarRes) = VT_DISPATCH;
1378 return S_OK;
1379
1381 CHECK_EXPECT(global_propargput_i);
1382 ok(wFlags == INVOKE_PROPERTYPUT, "wFlags = %x\n", wFlags);
1383 ok(pdp != NULL, "pdp == NULL\n");
1384 ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1385 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1386 ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1387 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1388 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1389 ok(!pvarRes, "pvarRes != NULL\n");
1390 ok(pei != NULL, "pei == NULL\n");
1391
1392 ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1393 ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1394
1395 ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1396 ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1397
1398 ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1399 ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1400 return S_OK;
1401
1403 ok(pdp != NULL, "pdp == NULL\n");
1404 ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1405 ok(pei != NULL, "pei == NULL\n");
1406
1407 switch(wFlags) {
1408 case INVOKE_PROPERTYGET | INVOKE_FUNC:
1409 CHECK_EXPECT(global_propargputop_get_i);
1410
1411 ok(pdp->cNamedArgs == 0, "cNamedArgs = %d\n", pdp->cNamedArgs);
1412 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1413 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1414 ok(pdp->cNamedArgs == 0, "cNamedArgs = %d\n", pdp->cNamedArgs);
1415 ok(pvarRes != NULL, "pvarRes = NULL\n");
1416
1417 ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1418 ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1419
1420 ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1421 ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1422
1423 V_VT(pvarRes) = VT_I4;
1424 V_I4(pvarRes) = 6;
1425 break;
1426 case INVOKE_PROPERTYPUT:
1427 CHECK_EXPECT(global_propargputop_put_i);
1428
1429 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1430 ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1431 ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1432 ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1433 ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1434 ok(!pvarRes, "pvarRes != NULL\n");
1435
1436 ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1437 ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1438
1439 ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1440 ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1441
1442 ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1443 ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1444 break;
1445 default:
1446 ok(0, "wFlags = %x\n", wFlags);
1447 }
1448
1449 return S_OK;
1450
1452 IDispatchEx *dispex;
1453 BSTR str;
1454 HRESULT hres;
1455
1456 hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&dispex);
1457 ok(hres == S_OK, "hres = %x\n", hres);
1458
1459 str = a2bstr("Object");
1460 hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
1462 ok(hres == S_OK, "hres = %x\n", hres);
1463
1464 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, NULL, pei, pspCaller);
1465 ok(hres == S_OK, "hres = %x\n", hres);
1466
1467 V_VT(pvarRes) = VT_EMPTY;
1468 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, pvarRes, pei, pspCaller);
1469 ok(hres == S_OK, "hres = %x\n", hres);
1470 ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1471 VariantClear(pvarRes);
1472
1473 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, pdp, NULL, pei, pspCaller);
1474 ok(hres == S_OK, "hres = %x\n", hres);
1475
1476 V_VT(pvarRes) = VT_EMPTY;
1477 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, pvarRes, pei, pspCaller);
1478 ok(hres == S_OK, "hres = %x\n", hres);
1479 ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1480 VariantClear(pvarRes);
1481
1482 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, NULL, pei, pspCaller);
1483 ok(hres == S_OK, "hres = %x\n", hres);
1484
1485 V_VT(pvarRes) = VT_EMPTY;
1486 hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT|DISPATCH_PROPERTYGET, pdp, pvarRes, pei, pspCaller);
1487 ok(hres == E_INVALIDARG, "hres = %x\n", hres);
1488
1489 V_VT(pvarRes) = VT_EMPTY;
1490 hres = IDispatchEx_InvokeEx(dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1491 ok(hres == S_OK, "hres = %x\n", hres);
1492 ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1493 IDispatchEx_Release(dispex);
1494 return S_OK;
1495 }
1498 V_VT(pvarRes) = VT_I2;
1499 V_I2(pvarRes) = 10;
1500 return S_OK;
1501
1503 V_VT(pvarRes) = VT_INT;
1504 V_INT(pvarRes) = 22;
1505 return S_OK;
1506
1508 V_VT(pvarRes) = VT_UNKNOWN;
1509 V_UNKNOWN(pvarRes) = (IUnknown*)&testObj;
1510 return S_OK;
1511
1513 VARIANT args[10], v;
1514 DISPPARAMS dp = {args, NULL, ARRAY_SIZE(args), 0};
1515 HRESULT hres;
1516
1517 CHECK_EXPECT(global_testargtypes_i);
1518 ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
1519 ok(pdp != NULL, "pdp == NULL\n");
1520 ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1521 ok(pdp->cArgs == 6, "cArgs = %d\n", pdp->cArgs);
1522 ok(!pvarRes, "pvarRes != NULL\n");
1523
1524 ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1525 ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1526
1527 ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1528 ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1529
1530 ok(V_VT(pdp->rgvarg+3) == VT_I4, "V_VT(pdp->rgvarg+3) = %d\n", V_VT(pdp->rgvarg+3));
1531 ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %d\n", V_I4(pdp->rgvarg+3));
1532
1533 ok(V_VT(pdp->rgvarg+4) == VT_I4, "V_VT(pdp->rgvarg+4) = %d\n", V_VT(pdp->rgvarg+4));
1534 ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %d\n", V_I4(pdp->rgvarg+4));
1535
1536 ok(V_VT(pdp->rgvarg+5) == VT_DISPATCH, "V_VT(pdp->rgvarg+5) = %d\n", V_VT(pdp->rgvarg+5));
1537 ok(V_DISPATCH(pdp->rgvarg+5) == (IDispatch*)&testObj, "V_DISPATCH(pdp->rgvarg+5) != testObj\n");
1538
1539 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1540
1541 V_VT(args) = VT_I2;
1542 V_I2(args) = 2;
1543 V_VT(args+1) = VT_INT;
1544 V_INT(args+1) = 22;
1545 V_VT(args+2) = VT_UNKNOWN;
1547 V_VT(args+3) = VT_UNKNOWN;
1548 V_UNKNOWN(args+3) = NULL;
1549 V_VT(args+4) = VT_UI4;
1550 V_UI4(args+4) = 0xffffffff;
1552 V_VARIANTREF(args+5) = &v;
1553 V_VT(args+6) = VT_R4;
1554 V_R4(args+6) = 0.5;
1555 V_VT(args+7) = VT_UI2;
1556 V_UI2(args+7) = 3;
1557 V_VT(args+8) = VT_UI1;
1558 V_UI1(args+8) = 4;
1559 V_VT(args+9) = VT_I1;
1560 V_I1(args+9) = 5;
1561 V_VT(&v) = VT_I4;
1562 V_I4(&v) = 2;
1563 hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
1564 ok(hres == S_OK, "Invoke failed: %08x\n", hres);
1565
1566 return S_OK;
1567 }
1568
1570 IDispatchEx *eval_func;
1572 VARIANT arg, res;
1573 HRESULT hres;
1574
1575 CHECK_EXPECT(global_calleval_i);
1576
1577 ok(pdp != NULL, "pdp == NULL\n");
1578 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1579 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1580 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1581 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1582 ok(pvarRes == NULL, "pvarRes != NULL\n");
1583 ok(pei != NULL, "pei == NULL\n");
1584
1585 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg));
1586 hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&eval_func);
1587 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1588
1589 params.rgvarg = &arg;
1590 params.rgdispidNamedArgs = NULL;
1591 params.cArgs = 1;
1592 params.cNamedArgs = 0;
1593 V_VT(&arg) = VT_BSTR;
1594
1595 V_BSTR(&arg) = a2bstr("var x = 5; v");
1596 V_VT(&res) = VT_ERROR;
1597 hres = IDispatchEx_InvokeEx(eval_func, DISPID_VALUE, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
1598 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1599 ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
1600 ok(V_I4(&res) == 2, "eval returned %d\n", V_I4(&res));
1602 IDispatchEx_Release(eval_func);
1603 return S_OK;
1604 }
1605 }
1606
1607 ok(0, "unexpected call %x\n", id);
1608 return DISP_E_MEMBERNOTFOUND;
1609}
enum tagSCRIPTSTATE SCRIPTSTATE
static int state
Definition: maze.c:121
#define ARRAY_SIZE(A)
Definition: main.h:20
#define E_INVALIDARG
Definition: ddrawi.h:101
@ VT_BSTR
Definition: compat.h:2303
@ VT_INT
Definition: compat.h:2316
@ VT_R4
Definition: compat.h:2299
@ VT_UNKNOWN
Definition: compat.h:2308
@ VT_BYREF
Definition: compat.h:2342
@ VT_UI2
Definition: compat.h:2312
@ 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_I1
Definition: compat.h:2310
@ VT_I2
Definition: compat.h:2297
@ VT_UI4
Definition: compat.h:2313
@ VT_EMPTY
Definition: compat.h:2295
@ VT_UI1
Definition: compat.h:2311
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum const GLfloat * params
Definition: glext.h:5645
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static IActiveScript * script_engine
Definition: run.c:181
static IDispatchEx pureDisp
Definition: run.c:730
static IDispatchEx dispexFunc
Definition: run.c:653
static IDispatch * script_disp
Definition: run.c:178
static IDispatchEx bindEventHandlerDisp
Definition: run.c:799
static const char * test_name
Definition: run.c:177
static IDispatchEx testObj
Definition: run.c:595
static BOOL testing_expr
Definition: run.c:176
struct stdole::DISPPARAMS DISPPARAMS
#define V_UI1(A)
Definition: oleauto.h:266
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_R4(A)
Definition: oleauto.h:260
#define V_UI4(A)
Definition: oleauto.h:270
#define V_I2(A)
Definition: oleauto.h:245
#define IID_NULL
Definition: guiddef.h:98
#define args
Definition: format.c:66
Definition: match.c:390
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
#define V_INT(x)
Definition: webchild.h:78
void * arg
Definition: msvc.h:10

◆ invoke_procedure()

static HRESULT invoke_procedure ( const char argsa,
const char sourcea,
DISPPARAMS *  dp 
)
static

Definition at line 1855 of file run.c.

1856{
1857 IActiveScriptParseProcedure2 *parse_proc;
1858 IActiveScriptParse *parser;
1859 IActiveScript *engine;
1860 IDispatchEx *dispex;
1861 EXCEPINFO ei = {0};
1862 BSTR source, args;
1863 IDispatch *disp;
1864 VARIANT res;
1865 HRESULT hres;
1866
1867 engine = create_script();
1868 if(!engine)
1869 return S_OK;
1870
1871 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1872 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1873
1875 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1876
1877 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1878 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1879
1880 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1881 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1882
1883 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
1884 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1885
1886 source = a2bstr(sourcea);
1887 args = argsa ? a2bstr(argsa) : NULL;
1889 SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
1890 ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
1893
1894 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1895 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1896 IDispatch_Release(disp);
1897
1898 V_VT(&res) = VT_EMPTY;
1899 hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, 0, DISPATCH_METHOD, dp, &res, &ei, NULL);
1900 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1901 ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%x)\n", V_VT(&res), V_I4(&res));
1902 IDispatchEx_Release(dispex);
1903
1905 IActiveScript_Release(engine);
1907
1908 return hres;
1909}
@ SCRIPTSTATE_STARTED
Definition: activscp.idl:58
#define IActiveScriptParseProcedure2_ParseProcedureText
Definition: run.c:46
#define IActiveScriptParse_InitNew
Definition: run.c:43
#define IActiveScriptParseProcedure2_Release
Definition: run.c:45
#define IActiveScriptParse_Release
Definition: run.c:42
static const WCHAR emptyW[]
Definition: run.c:174
static IActiveScript * create_script(void)
Definition: run.c:1788
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1743
struct stdole::EXCEPINFO EXCEPINFO
Definition: import.c:81

Referenced by test_parse_proc().

◆ is_lang_english()

static BOOL is_lang_english ( void  )
static

Definition at line 187 of file run.c.

188{
189 static HMODULE hkernel32 = NULL;
190 static LANGID (WINAPI *pGetThreadUILanguage)(void) = NULL;
191 static LANGID (WINAPI *pGetUserDefaultUILanguage)(void) = NULL;
192
193 if (!hkernel32)
194 {
195 hkernel32 = GetModuleHandleA("kernel32.dll");
196 pGetThreadUILanguage = (void*)GetProcAddress(hkernel32, "GetThreadUILanguage");
197 pGetUserDefaultUILanguage = (void*)GetProcAddress(hkernel32, "GetUserDefaultUILanguage");
198 }
199 if (pGetThreadUILanguage)
200 return PRIMARYLANGID(pGetThreadUILanguage()) == LANG_ENGLISH;
201 if (pGetUserDefaultUILanguage)
202 return PRIMARYLANGID(pGetUserDefaultUILanguage()) == LANG_ENGLISH;
203
205}
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
LANGID WINAPI GetUserDefaultLangID(void)
Definition: locale.c:1177
USHORT LANGID
Definition: mui.h:9
static HINSTANCE hkernel32
Definition: process.c:66
#define LANG_ENGLISH
Definition: nls.h:52
#define PRIMARYLANGID(l)
Definition: nls.h:16
#define WINAPI
Definition: msvc.h:6

Referenced by test_IActiveScriptError().

◆ load_res()

static BSTR load_res ( const char name)
static

Definition at line 2201 of file run.c.

2202{
2203 const char *data;
2204 DWORD size, len;
2205 BSTR str;
2206 HRSRC src;
2207
2209 test_name = name;
2210
2211 src = FindResourceA(NULL, name, (LPCSTR)40);
2212 ok(src != NULL, "Could not find resource %s\n", name);
2213
2216
2220
2221 return str;
2222}
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
GLenum src
Definition: glext.h:6340
Definition: name.c:39
const char * LPCSTR
Definition: xmlstorage.h:183

Referenced by run_benchmark(), and run_from_res().

◆ parse_htmlscript()

static HRESULT parse_htmlscript ( BSTR  script_str)
static

Definition at line 1911 of file run.c.

1912{
1913 IActiveScriptParse *parser;
1914 IActiveScript *engine;
1915 HRESULT hres;
1916 BSTR tmp = a2bstr("</SCRIPT>");
1917
1918 engine = create_script();
1919 if(!engine)
1920 return E_FAIL;
1921
1922 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1923 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1924 if (FAILED(hres))
1925 {
1926 IActiveScript_Release(engine);
1927 return E_FAIL;
1928 }
1929
1931 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1932
1933 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1934 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1935
1936 hres = IActiveScript_AddNamedItem(engine, testW,
1937 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
1938 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1939
1940 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1941 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1942
1943 hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, tmp, 0, 0, 0, NULL, NULL);
1944
1945 IActiveScript_Release(engine);
1947 SysFreeString(tmp);
1948
1949 return hres;
1950}
static const WCHAR testW[]
Definition: run.c:170
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44

Referenced by parse_htmlscript_a().

◆ parse_htmlscript_a()

static HRESULT parse_htmlscript_a ( const char src)
static

Definition at line 2138 of file run.c.

2139{
2140 HRESULT hres;
2141 BSTR tmp = a2bstr(src);
2142 hres = parse_htmlscript(tmp);
2143 SysFreeString(tmp);
2144
2145 return hres;
2146}
static HRESULT parse_htmlscript(BSTR script_str)
Definition: run.c:1911

◆ parse_script()

static HRESULT parse_script ( DWORD  flags,
BSTR  script_str 
)
static

Definition at line 1810 of file run.c.

1811{
1812 IActiveScriptParse *parser;
1813 IActiveScript *engine;
1814 HRESULT hres;
1815
1816 engine = create_script();
1817 if(!engine)
1818 return S_OK;
1819
1820 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1821 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1822 if (FAILED(hres))
1823 {
1824 IActiveScript_Release(engine);
1825 return hres;
1826 }
1827
1829 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1830
1831 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1832 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1833
1834 hres = IActiveScript_AddNamedItem(engine, testW,
1835 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
1836 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1837
1838 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1839 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1840
1841 hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
1842 ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
1843 ok(script_disp != NULL, "script_disp == NULL\n");
1844 ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
1845
1846 hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
1847
1848 IDispatch_Release(script_disp);
1849 IActiveScript_Release(engine);
1851
1852 return hres;
1853}
GLbitfield flags
Definition: glext.h:7161

Referenced by _parse_htmlscript_a(), check_jscript(), parse_script_ae(), parse_script_af(), parse_script_ar(), run_bom_tests(), run_encoded_tests(), run_from_file(), and run_from_res().

◆ parse_script_a()

static void parse_script_a ( const char src)
static

Definition at line 2105 of file run.c.

2106{
2107 parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src);
2108}
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:2094

◆ parse_script_ae()

static void parse_script_ae ( const char src,
HRESULT  exhres 
)
static

Definition at line 2110 of file run.c.

2111{
2112 BSTR tmp;
2113 HRESULT hres;
2114
2115 tmp = a2bstr(src);
2116 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp);
2117 SysFreeString(tmp);
2118 ok(hres == exhres, "parse_script failed: %08x, expected %08x\n", hres, exhres);
2119}

Referenced by run_tests().

◆ parse_script_af()

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

Definition at line 2094 of file run.c.

2095{
2096 BSTR tmp;
2097 HRESULT hres;
2098
2099 tmp = a2bstr(src);
2100 hres = parse_script(flags, tmp);
2101 SysFreeString(tmp);
2102 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2103}

Referenced by parse_script_a(), and run_tests().

◆ parse_script_expr()

static HRESULT parse_script_expr ( const char expr,
VARIANT res,
IActiveScript **  engine_ret 
)
static

Definition at line 2378 of file run.c.

2379{
2380 IActiveScriptParse *parser;
2381 IActiveScript *engine;
2382 BSTR str;
2383 HRESULT hres;
2384
2385 engine = create_script();
2386 if(!engine)
2387 return E_FAIL;
2388
2389 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2390 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2391
2393 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2394
2395 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2396 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2397
2398 SET_EXPECT(GetItemInfo_testVal);
2399 hres = IActiveScript_AddNamedItem(engine, test_valW,
2400 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2401 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2402 CHECK_CALLED(GetItemInfo_testVal);
2403
2404 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2405 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2406
2407 str = a2bstr(expr);
2408 hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, res, NULL);
2410
2412
2413 if(engine_ret) {
2414 *engine_ret = engine;
2415 }else {
2416 IActiveScript_Close(engine);
2417 IActiveScript_Release(engine);
2418 }
2419 return hres;
2420}
#define SET_EXPECT(func)
Definition: run.c:58
#define CHECK_CALLED(func)
Definition: run.c:73
static const WCHAR test_valW[]
Definition: run.c:172
Definition: query.h:86

Referenced by test_default_value(), test_invokeex(), and test_script_exprs().

◆ parse_script_with_error()

static void parse_script_with_error ( DWORD  flags,
BSTR  script_str,
SCODE  errorcode,
ULONG  line,
LONG  pos,
BSTR  script_source,
BSTR  description,
BSTR  line_text 
)
static

Definition at line 2040 of file run.c.

2041{
2042 IActiveScriptParse *parser;
2043 IActiveScript *engine;
2044 HRESULT hres;
2045
2046 engine = create_script();
2047 if(!engine)
2048 return;
2049
2050 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2051 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2052 if (FAILED(hres))
2053 {
2054 IActiveScript_Release(engine);
2055 return;
2056 }
2057
2059 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2060
2061 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite_CheckError);
2062 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2063
2064 hres = IActiveScript_AddNamedItem(engine, testW,
2065 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
2066 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2067
2068 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2069 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2070
2071 hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
2072 ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
2073 ok(script_disp != NULL, "script_disp == NULL\n");
2074 ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
2075
2078 hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2079 todo_wine ok(hres == 0x80020101, "parse_script_with_error should have returned 0x80020101, got: 0x%08x\n", hres);
2081
2082 if (script_error)
2083 {
2084 test_IActiveScriptError(script_error, errorcode, line, pos, script_source, description, line_text);
2085
2086 IActiveScriptError_Release(script_error);
2087 }
2088
2089 IDispatch_Release(script_disp);
2090 IActiveScript_Release(engine);
2092}
static void test_IActiveScriptError(IActiveScriptError *error, SCODE errorcode, ULONG line, LONG pos, BSTR script_source, BSTR description, BSTR line_text)
Definition: run.c:1952
static IActiveScriptSite ActiveScriptSite_CheckError
Definition: run.c:1771
const char * description
Definition: directx.c:2497

Referenced by parse_script_with_error_a().

◆ parse_script_with_error_a()

static void parse_script_with_error_a ( const char src,
SCODE  errorcode,
ULONG  line,
LONG  pos,
LPCSTR  source,
LPCSTR  desc,
LPCSTR  linetext 
)
static

Definition at line 2121 of file run.c.

2122{
2123 BSTR tmp, script_source, description, line_text;
2124
2125 tmp = a2bstr(src);
2126 script_source = a2bstr(source);
2128 line_text = a2bstr(linetext);
2129
2130 parse_script_with_error(SCRIPTITEM_GLOBALMEMBERS, tmp, errorcode, line, pos, script_source, description, line_text);
2131
2132 SysFreeString(line_text);
2134 SysFreeString(script_source);
2135 SysFreeString(tmp);
2136}
static const WCHAR desc[]
Definition: protectdata.c:36
static void parse_script_with_error(DWORD flags, BSTR script_str, SCODE errorcode, ULONG line, LONG pos, BSTR script_source, BSTR description, BSTR line_text)
Definition: run.c:2040

Referenced by run_tests().

◆ pureDisp_GetIDsOfNames()

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

Definition at line 666 of file run.c.

669{
670 ok(IsEqualGUID(riid, &IID_NULL), "Expected IID_NULL\n");
671 ok(cNames==1, "cNames = %d\n", cNames);
672
673 if(!strcmp_wa(*rgszNames, "prop")) {
674 CHECK_EXPECT(puredisp_prop_d);
675 *rgDispId = DISPID_TESTOBJ_PROP;
676 return S_OK;
677 } else if(!strcmp_wa(*rgszNames, "noprop")) {
678 CHECK_EXPECT(puredisp_noprop_d);
679 return DISP_E_UNKNOWNNAME;
680 }
681
682 ok(0, "unexpected call\n");
683 return E_NOTIMPL;
684}
#define DISPID_TESTOBJ_PROP
Definition: run.c:163

◆ pureDisp_Invoke()

static HRESULT WINAPI pureDisp_Invoke ( IDispatchEx iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT res,
EXCEPINFO *  ei,
UINT puArgErr 
)
static

Definition at line 686 of file run.c.

688{
689 ok(IsEqualGUID(&IID_NULL, riid), "unexpected riid\n");
690
691 switch(dispIdMember) {
692 case DISPID_VALUE:
693 CHECK_EXPECT(puredisp_value);
694
695 ok(pdp != NULL, "pdp == NULL\n");
696 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
697 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
698 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
699 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
700 ok(res != NULL, "res == NULL\n");
701 ok(ei != NULL, "ei == NULL\n");
702 ok(puArgErr != NULL, "puArgErr == NULL\n");
703
704 ok(V_VT(pdp->rgvarg) == VT_BOOL, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
705
706 if(V_BOOL(pdp->rgvarg))
707 todo_wine ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
708 else
709 ok(wFlags == (DISPATCH_PROPERTYGET|DISPATCH_METHOD), "wFlags = %x\n", wFlags);
710
711 if(res)
712 V_VT(res) = VT_NULL;
713 return S_OK;
714 default:
715 ok(0, "unexpected call\n");
716 return E_NOTIMPL;
717 }
718}

◆ pureDisp_QueryInterface()

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

Definition at line 655 of file run.c.

656{
658 *ppv = iface;
659 return S_OK;
660 }
661
662 *ppv = NULL;
663 return E_NOINTERFACE;
664}

◆ run_benchmark()

static void run_benchmark ( const char script_name)
static

Definition at line 3249 of file run.c.

3250{
3251 IActiveScriptParse *parser;
3252 IActiveScript *engine;
3253 ULONG start, end;
3254 BSTR src;
3255 HRESULT hres;
3256
3257 engine = create_script();
3258 if(!engine)
3259 return;
3260
3261 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
3262 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
3263 if (FAILED(hres)) {
3264 IActiveScript_Release(engine);
3265 return;
3266 }
3267
3269 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
3270
3271 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
3272 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
3273
3274 hres = IActiveScript_AddNamedItem(engine, testW,
3275 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE);
3276 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
3277
3278 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
3279 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
3280
3282
3283 start = GetTickCount();
3285 end = GetTickCount();
3286 ok(hres == S_OK, "%s: ParseScriptText failed: %08x\n", script_name, hres);
3287
3288 trace("%s ran in %u ms\n", script_name, end-start);
3289
3290 IActiveScript_Release(engine);
3293}
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
static BSTR load_res(const char *name)
Definition: run.c:2201
static const char * script_name
Definition: run.c:74
uint32_t ULONG
Definition: typedefs.h:59

Referenced by run_benchmarks().

◆ run_benchmarks()

static void run_benchmarks ( void  )
static

Definition at line 3295 of file run.c.

3296{
3297 trace("Running benchmarks...\n");
3298
3299 run_benchmark("dna.js");
3300 run_benchmark("base64.js");
3301 run_benchmark("validateinput.js");
3302}
static void run_benchmark(const char *script_name)
Definition: run.c:3249

Referenced by START_TEST().

◆ run_bom_tests()

static void run_bom_tests ( void  )
static

Definition at line 2712 of file run.c.

2713{
2714 BSTR src;
2715 int i;
2716 HRESULT hres;
2717 struct bom_test bom_tests[] = {
2718 {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2719 {{0xFEFF,'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2720 {{'v',0xFEFF,'a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, JS_E_OUT_OF_MEMORY},
2721 {{'v','a','r',0xFEFF,' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2722 {{'v','a','r',' ','a',' ','=',' ','1',';',' ',0xFEFF,'r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2723 {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t',0xFEFF,'S','u','c','c','e','s','s','(',')',';','\0'}, JS_E_OUT_OF_MEMORY},
2724 {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s',0xFEFF,'(',')',';','\0'}, S_OK},
2725 {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK},
2726 {{'v','a','r',' ','a',' ','=',0xFEFF,' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK},
2727 {{0xFEFF,'v','a','r',' ','a',' ','=',0xFEFF,0xFEFF,' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',0xFEFF,')',';','\0'}, S_OK},
2728 {{0}}
2729 };
2730
2732
2733 for (i = 0; bom_tests[i].str[0]; i++)
2734 {
2735 if(bom_tests[i].hres == S_OK)
2736 {
2737 SET_EXPECT(global_success_d);
2738 SET_EXPECT(global_success_i);
2739 src = SysAllocString(bom_tests[i].str);
2740 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
2741 ok(hres == S_OK, "test %s failed with %08x\n", wine_dbgstr_w(src), hres);
2743 CHECK_CALLED(global_success_d);
2744 CHECK_CALLED(global_success_i);
2745 }
2746 else
2747 {
2748 src = SysAllocString(bom_tests[i].str);
2749 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
2750 todo_wine ok(hres == bom_tests[i].hres, "test %s returned with %08x\n", wine_dbgstr_w(src), hres);
2752 }
2753 }
2754}
#define JS_E_OUT_OF_MEMORY
Definition: run.c:167
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
Definition: run.c:2707
WCHAR str[1024]
Definition: run.c:2708

Referenced by run_tests().

◆ run_encoded_tests()

static void run_encoded_tests ( void  )
static

Definition at line 3184 of file run.c.

3185{
3186 BSTR src;
3187 HRESULT hres;
3188
3190
3191 SET_EXPECT(global_success_d);
3192 SET_EXPECT(global_success_i);
3193 /* |reportSuccess(); | */
3194 parse_script_a("#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
3195 CHECK_CALLED(global_success_d);
3196 CHECK_CALLED(global_success_i);
3197
3198 SET_EXPECT(global_success_d);
3199 SET_EXPECT(global_success_i);
3200 parse_script_a("reportSuccess();");
3201 CHECK_CALLED(global_success_d);
3202 CHECK_CALLED(global_success_i);
3203
3204 SET_EXPECT(global_success_d);
3205 SET_EXPECT(global_success_i);
3206 /* |Success | */
3207 parse_script_a("report#@~^BwAAAA==j!m^\x7f/k2QIAAA==^#~@();");
3208 CHECK_CALLED(global_success_d);
3209 CHECK_CALLED(global_success_i);
3210
3211 SET_EXPECT(global_success_d);
3212 SET_EXPECT(global_success_i);
3213 /* |\r\n\treportSuccess();\r\n | */
3214 parse_script_a("#@~^GQAAAA==@#@&d.\x7fwKDYUE1^+k/c#p@#@&OAYAAA==^#~@");
3215 CHECK_CALLED(global_success_d);
3216 CHECK_CALLED(global_success_i);
3217
3218 /* v */
3219 src = a2bstr("#@~^EAA*AA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
3220 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
3222 ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
3223
3224 /* vv */
3225 src = a2bstr("#@~^EAAAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
3226 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
3228 ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
3229
3230 /* v */
3231 src = a2bstr("#@~^EAAAAA^=.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
3232 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
3234 ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
3235
3236 /* v */
3237 src = a2bstr("#@~^EAAAAA==.\x7fwGMYUEm1ekd`*iAQYAAA==^#~@");
3238 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
3240 ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
3241
3242 /* vv */
3243 src = a2bstr("#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^~#@");
3244 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
3246 ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
3247}
#define parse_script_a(p, s)
Definition: activex.c:704
#define JS_E_INVALID_CHAR
Definition: run.c:168
static const CLSID CLSID_JScriptEncode
Definition: run.c:52

Referenced by START_TEST().

◆ run_from_file()

static void run_from_file ( const char filename)
static

Definition at line 2186 of file run.c.

2187{
2188 BSTR script_str;
2189 HRESULT hres;
2190
2191 script_str = get_script_from_file(filename);
2192 if(!script_str)
2193 return;
2194
2196 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str);
2197 SysFreeString(script_str);
2198 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2199}
static BSTR get_script_from_file(const char *filename)
Definition: run.c:2148

Referenced by START_TEST().

◆ run_from_res()

static void run_from_res ( const char name)
static

Definition at line 2224 of file run.c.

2225{
2226 BSTR str;
2227 HRESULT hres;
2228
2229 str = load_res(name);
2230
2231 SET_EXPECT(global_success_d);
2232 SET_EXPECT(global_success_i);
2233 hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, str);
2234 CHECK_CALLED(global_success_d);
2235 CHECK_CALLED(global_success_i);
2236
2237 ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2239}

Referenced by run_tests().

◆ run_tests()

static BOOL run_tests ( void  )
static

Definition at line 2756 of file run.c.

2757{
2758 HRESULT hres;
2759
2760 if(invoke_version) {
2762
2764 if(!script) {
2765 win_skip("Could not create script\n");
2766 return FALSE;
2767 }
2768 IActiveScript_Release(script);
2769 }
2770
2772
2773 parse_script_a("");
2774 parse_script_a("/* empty */ ;");
2775
2776 SET_EXPECT(global_propget_d);
2777 SET_EXPECT(global_propget_i);
2778 parse_script_a("testPropGet;");
2779 CHECK_CALLED(global_propget_d);
2780 CHECK_CALLED(global_propget_i);
2781
2782 SET_EXPECT(global_propput_d);
2783 SET_EXPECT(global_propput_i);
2784 parse_script_a("testPropPut = 1;");
2785 CHECK_CALLED(global_propput_d);
2786 CHECK_CALLED(global_propput_i);
2787
2788 SET_EXPECT(global_propputref_d);
2789 SET_EXPECT(global_propputref_i);
2790 parse_script_a("testPropPutRef = new Object();");
2791 CHECK_CALLED(global_propputref_d);
2792 CHECK_CALLED(global_propputref_i);
2793
2794 SET_EXPECT(global_propputref_d);
2795 SET_EXPECT(global_propputref_i);
2796 parse_script_a("testPropPutRef = testObj;");
2797 CHECK_CALLED(global_propputref_d);
2798 CHECK_CALLED(global_propputref_i);
2799
2800 SET_EXPECT(global_success_d);
2801 SET_EXPECT(global_success_i);
2802 parse_script_a("reportSuccess();");
2803 CHECK_CALLED(global_success_d);
2804 CHECK_CALLED(global_success_i);
2805
2806 SET_EXPECT(testobj_delete_test);
2807 parse_script_a("ok((delete testObj.deleteTest) === true, 'delete testObj.deleteTest did not return true');");
2808 CHECK_CALLED(testobj_delete_test);
2809
2810 SET_EXPECT(testobj_delete_nodelete);
2811 parse_script_a("ok((delete testObj.noDeleteTest) === false, 'delete testObj.noDeleteTest did not return false');");
2812 CHECK_CALLED(testobj_delete_nodelete);
2813
2814 SET_EXPECT(global_propdelete_d);
2815 SET_EXPECT(DeleteMemberByDispID);
2816 parse_script_a("ok((delete testPropDelete) === true, 'delete testPropDelete did not return true');");
2817 CHECK_CALLED(global_propdelete_d);
2818 CHECK_CALLED(DeleteMemberByDispID);
2819
2820 SET_EXPECT(global_nopropdelete_d);
2821 SET_EXPECT(DeleteMemberByDispID_false);
2822 parse_script_a("ok((delete testNoPropDelete) === false, 'delete testPropDelete did not return false');");
2823 CHECK_CALLED(global_nopropdelete_d);
2824 CHECK_CALLED(DeleteMemberByDispID_false);
2825
2826 SET_EXPECT(global_propdeleteerror_d);
2827 SET_EXPECT(DeleteMemberByDispID_error);
2828 parse_script_ae("delete testPropDeleteError;", E_FAIL);
2829 CHECK_CALLED(global_propdeleteerror_d);
2830 CHECK_CALLED(DeleteMemberByDispID_error);
2831
2832 SET_EXPECT(puredisp_prop_d);
2833 parse_script_a("ok((delete pureDisp.prop) === false, 'delete pureDisp.prop did not return true');");
2834 CHECK_CALLED(puredisp_prop_d);
2835
2836 SET_EXPECT(puredisp_noprop_d);
2837 parse_script_a("ok((delete pureDisp.noprop) === true, 'delete pureDisp.noprop did not return false');");
2838 CHECK_CALLED(puredisp_noprop_d);
2839
2840 SET_EXPECT(puredisp_value);
2841 parse_script_a("var t=pureDisp; t=t(false);");
2842 CHECK_CALLED(puredisp_value);
2843
2844 SET_EXPECT(puredisp_value);
2845 parse_script_a("var t = {func: pureDisp}; t = t.func(false);");
2846 CHECK_CALLED(puredisp_value);
2847
2848 SET_EXPECT(dispexfunc_value);
2849 parse_script_a("var t = dispexFunc; t = t(false);");
2850 CHECK_CALLED(dispexfunc_value);
2851
2852 SET_EXPECT(dispexfunc_value);
2853 parse_script_a("var t = {func: dispexFunc}; t = t.func(false);");
2854 CHECK_CALLED(dispexfunc_value);
2855
2856 SET_EXPECT(dispexfunc_value);
2857 parse_script_a("Function.prototype.apply.call(dispexFunc, testObj, [true]);");
2858 CHECK_CALLED(dispexfunc_value);
2859
2860 SET_EXPECT(puredisp_value);
2861 parse_script_a("Function.prototype.apply.call(pureDisp, testObj, [true]);");
2862 CHECK_CALLED(puredisp_value);
2863
2864 parse_script_a("(function reportSuccess() {})()");
2865
2866 parse_script_a("ok(typeof(test) === 'object', \"typeof(test) != 'object'\");");
2867
2868 parse_script_a("function reportSuccess() {}; reportSuccess();");
2869
2870 SET_EXPECT(global_propget_d);
2871 parse_script_a("var testPropGet");
2872 CHECK_CALLED(global_propget_d);
2873
2874 SET_EXPECT(global_propget_d);
2875 parse_script_a("eval('var testPropGet;');");
2876 CHECK_CALLED(global_propget_d);
2877
2878 parse_script_a("var testPropGet; function testPropGet() {}");
2879
2880 SET_EXPECT(global_notexists_d);
2881 parse_script_a("var notExists; notExists = 1;");
2882 CHECK_CALLED(global_notexists_d);
2883
2884 SET_EXPECT(testobj_notexists_d);
2885 parse_script_a("testObj.notExists;");
2886 CHECK_CALLED(testobj_notexists_d);
2887
2888 parse_script_a("function f() { var testPropGet; }");
2889 parse_script_a("(function () { var testPropGet; })();");
2890 parse_script_a("(function () { eval('var testPropGet;'); })();");
2891
2892 SET_EXPECT(invoke_func);
2893 parse_script_a("ok(propGetFunc() == 0, \"Incorrect propGetFunc value\");");
2894 CHECK_CALLED(invoke_func);
2895 parse_script_a("ok(propGetFunc(1) == 1, \"Incorrect propGetFunc value\");");
2896 parse_script_a("ok(propGetFunc(1, 2) == 2, \"Incorrect propGetFunc value\");");
2897 SET_EXPECT(invoke_func);
2898 parse_script_a("ok(propGetFunc().toString() == 0, \"Incorrect propGetFunc value\");");
2899 CHECK_CALLED(invoke_func);
2900 parse_script_a("ok(propGetFunc(1).toString() == 1, \"Incorrect propGetFunc value\");");
2901 SET_EXPECT(invoke_func);
2902 parse_script_a("propGetFunc(1);");
2903 CHECK_CALLED(invoke_func);
2904
2905 parse_script_a("objectFlag(1).toString();");
2906
2907 parse_script_a("(function() { var tmp = (function () { return testObj; })()(1);})();");
2908 parse_script_a("(function() { var tmp = (function () { return testObj; })()();})();");
2909
2910 parse_script_a("ok((testObj instanceof Object) === false, 'testObj is instance of Object');");
2911
2912 SET_EXPECT(testobj_prop_d);
2913 parse_script_a("ok(('prop' in testObj) === true, 'prop is not in testObj');");
2914 CHECK_CALLED(testobj_prop_d);
2915
2916 SET_EXPECT(testobj_noprop_d);
2917 parse_script_a("ok(('noprop' in testObj) === false, 'noprop is in testObj');");
2918 CHECK_CALLED(testobj_noprop_d);
2919
2920 SET_EXPECT(testobj_prop_d);
2921 parse_script_a("ok(Object.prototype.hasOwnProperty.call(testObj, 'prop') === true, 'hasOwnProperty(\\\"prop\\\") returned false');");
2922 CHECK_CALLED(testobj_prop_d);
2923
2924 SET_EXPECT(testobj_noprop_d);
2925 parse_script_a("ok(Object.prototype.hasOwnProperty.call(testObj, 'noprop') === false, 'hasOwnProperty(\\\"noprop\\\") returned true');");
2926 CHECK_CALLED(testobj_noprop_d);
2927
2928 SET_EXPECT(puredisp_prop_d);
2929 parse_script_a("ok(Object.prototype.hasOwnProperty.call(pureDisp, 'prop') === true, 'hasOwnProperty(\\\"noprop\\\") returned false');");
2930 CHECK_CALLED(puredisp_prop_d);
2931
2932 SET_EXPECT(puredisp_noprop_d);
2933 parse_script_a("ok(Object.prototype.hasOwnProperty.call(pureDisp, 'noprop') === false, 'hasOwnProperty(\\\"noprop\\\") returned true');");
2934 CHECK_CALLED(puredisp_noprop_d);
2935
2936 SET_EXPECT(testobj_value);
2937 parse_script_a("ok(String(testObj) === '1', 'wrong testObj value');");
2938 CHECK_CALLED(testobj_value);
2939
2940 SET_EXPECT(testobj_value);
2941 parse_script_a("ok(String.prototype.concat.call(testObj, ' OK') === '1 OK', 'wrong concat result');");
2942 CHECK_CALLED(testobj_value);
2943
2944 SET_EXPECT(testobj_construct);
2945 parse_script_a("var t = new testObj(1);");
2946 CHECK_CALLED(testobj_construct);
2947
2948 SET_EXPECT(global_propget_d);
2949 SET_EXPECT(global_propget_i);
2950 parse_script_a("this.testPropGet;");
2951 CHECK_CALLED(global_propget_d);
2952 CHECK_CALLED(global_propget_i);
2953
2954 SET_EXPECT(global_propputref_d);
2955 SET_EXPECT(global_propputref_i);
2956 parse_script_a("testPropPutRef = nullDisp;");
2957 CHECK_CALLED(global_propputref_d);
2958 CHECK_CALLED(global_propputref_i);
2959
2960 SET_EXPECT(global_propget_d);
2961 SET_EXPECT(global_propget_i);
2962 parse_script_a("(function () { this.testPropGet; })();");
2963 CHECK_CALLED(global_propget_d);
2964 CHECK_CALLED(global_propget_i);
2965
2966 parse_script_a("testThis(this);");
2967 parse_script_a("(function () { testThis(this); })();");
2968 parse_script_a("function x() { testThis(this); }; x();");
2969 parse_script_a("var t = {func: function () { ok(this === t, 'this !== t'); }}; with(t) { func(); }");
2970 parse_script_a("function x() { testThis(this); }; with({y: 1}) { x(); }");
2971 parse_script_a("(function () { function x() { testThis(this);} x(); })();");
2972
2973 SET_EXPECT(testobj_onlydispid_d);
2974 SET_EXPECT(testobj_onlydispid_i);
2975 parse_script_a("ok(typeof(testObj.onlyDispID) === 'unknown', 'unexpected typeof(testObj.onlyDispID)');");
2976 CHECK_CALLED(testobj_onlydispid_d);
2977 CHECK_CALLED(testobj_onlydispid_i);
2978
2979 SET_EXPECT(global_propargput_d);
2980 SET_EXPECT(global_propargput_i);
2981 parse_script_a("var t=0; propArgPutG(t++, t++) = t++;");
2982 CHECK_CALLED(global_propargput_d);
2983 CHECK_CALLED(global_propargput_i);
2984
2985 SET_EXPECT(global_propargput_d);
2986 SET_EXPECT(global_propargput_i);
2987 parse_script_a("var t=0; test.propArgPutO(t++, t++) = t++;");
2988 CHECK_CALLED(global_propargput_d);
2989 CHECK_CALLED(global_propargput_i);
2990
2991 SET_EXPECT(global_propargputop_d);
2992 SET_EXPECT(global_propargputop_get_i);
2993 SET_EXPECT(global_propargputop_put_i);
2994 parse_script_a("var t=0; propArgPutOp(t++, t++) += t++;");
2995 CHECK_CALLED(global_propargputop_d);
2996 CHECK_CALLED(global_propargputop_get_i);
2997 CHECK_CALLED(global_propargputop_put_i);
2998
2999 SET_EXPECT(global_propargputop_d);
3000 SET_EXPECT(global_propargputop_get_i);
3001 SET_EXPECT(global_propargputop_put_i);
3002 parse_script_a("var t=0; propArgPutOp(t++, t++) ^= 14;");
3003 CHECK_CALLED(global_propargputop_d);
3004 CHECK_CALLED(global_propargputop_get_i);
3005 CHECK_CALLED(global_propargputop_put_i);
3006
3007 SET_EXPECT(global_testargtypes_i);
3008 parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp,"
3009 "function(i1,ui1,ui2,r4,i4ref,ui4,nullunk,d,i,s) {"
3010 " ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));"
3011 " ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));"
3012 " ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));"
3013 " ok(getVT(nullunk) === 'VT_DISPATCH', 'getVT(nullunk) = ' + getVT(nullunk));"
3014 " ok(nullunk === null, 'nullunk !== null');"
3015 " ok(getVT(ui4) === 'VT_R8', 'getVT(ui4) = ' + getVT(ui4));"
3016 " ok(ui4 > 0, 'ui4 = ' + ui4);"
3017 " ok(getVT(i4ref) === 'VT_I4', 'getVT(i4ref) = ' + getVT(i4ref));"
3018 " ok(i4ref === 2, 'i4ref = ' + i4ref);"
3019 " ok(r4 === 0.5, 'r4 = ' + r4);"
3020 " ok(getVT(r4) === 'VT_R8', 'getVT(r4) = ' + getVT(r4));"
3021 " ok(getVT(ui2) === 'VT_I4', 'getVT(ui2) = ' + getVT(ui2));"
3022 " ok(getVT(ui1) === 'VT_I4', 'getVT(ui1) = ' + getVT(ui1));"
3023 " ok(ui1 === 4, 'ui1 = ' + ui1);"
3024 " ok(getVT(i1) === 'VT_I4', 'getVT(i1) = ' + getVT(i1));"
3025 " ok(i1 === 5, 'i1 = ' + i1);"
3026 "});");
3027 CHECK_CALLED(global_testargtypes_i);
3028
3029 SET_EXPECT(testobj_withprop_d);
3030 SET_EXPECT(testobj_withprop_i);
3031 parse_script_a("var t = (function () { with(testObj) { return withProp; }})(); ok(t === 1, 't = ' + t);");
3032 CHECK_CALLED(testobj_withprop_d);
3033 CHECK_CALLED(testobj_withprop_i);
3034
3035 parse_script_a("@set @t=2\nok(@t === 2, '@t = ' + @t);");
3036
3037 SET_EXPECT(global_success_d);
3038 SET_EXPECT(global_success_i);
3039 parse_script_a("@if(true)\nif(@_jscript) reportSuccess();\n@end");
3040 CHECK_CALLED(global_success_d);
3041 CHECK_CALLED(global_success_i);
3042
3045 SET_EXPECT(testobj_newenum);
3046 SET_EXPECT(enumvariant_next_0);
3047 parse_script_a("new Enumerator(testObj);");
3048 CHECK_CALLED(testobj_newenum);
3049 CHECK_CALLED(enumvariant_next_0);
3050
3053 SET_EXPECT(testobj_newenum);
3054 SET_EXPECT(enumvariant_next_0);
3055 SET_EXPECT(enumvariant_reset);
3056 parse_script_a("(function () {"
3057 " var testEnumObj = new Enumerator(testObj);"
3058 " var tmp = testEnumObj.moveFirst();"
3059 " ok(tmp == undefined, \"testEnumObj.moveFirst() = \" + tmp);"
3060 "})()");
3061 CHECK_CALLED(testobj_newenum);
3062 CHECK_CALLED(enumvariant_next_0);
3063 CHECK_CALLED(enumvariant_reset);
3064
3067 SET_EXPECT(testobj_newenum);
3068 SET_EXPECT(enumvariant_next_0);
3069 SET_EXPECT(enumvariant_next_1);
3070 parse_script_a("(function () {"
3071 " var testEnumObj = new Enumerator(testObj);"
3072 " while (!testEnumObj.atEnd())"
3073 " {"
3074 " ok(testEnumObj.item() == 123, "
3075 " \"testEnumObj.item() = \"+testEnumObj.item());"
3076 " testEnumObj.moveNext();"
3077 " }"
3078 "})()");
3079 CHECK_CALLED(testobj_newenum);
3080 CHECK_CALLED(enumvariant_next_0);
3081 CHECK_CALLED(enumvariant_next_1);
3082
3083 run_from_res("lang.js");
3084 run_from_res("api.js");
3085 run_from_res("regexp.js");
3086 run_from_res("cc.js");
3087
3090 test_start();
3092
3093 parse_script_af(0, "test.testThis2(this);");
3094 parse_script_af(0, "(function () { test.testThis2(this); })();");
3095
3096 hres = parse_htmlscript_a("<!--");
3097 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
3098 hres = parse_htmlscript_a("-->");
3099 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
3100 hres = parse_htmlscript_a("<!--\nvar a=1;\n-->\n");
3101 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
3102 hres = parse_htmlscript_a("<!--\n<!-- ignore this\n-->\n");
3103 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
3104 hres = parse_htmlscript_a("var a=1;\nif(a-->0) a=5;\n");
3105 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
3106 hres = parse_htmlscript_a("var a=1;\nif(a\n-->0) a=5;\n");
3107 ok(hres != S_OK, "ParseScriptText have not failed\n");
3108
3110 test_invokeex();
3111 test_eval();
3112
3114 "?",
3115 0x800a03ea, 0, 0,
3116 "Microsoft JScript compilation error",
3117 "Syntax error",
3118 "?");
3119
3121 "var a=1;\nif(a\n-->0) a=5;\n",
3122 0x800a03ee, 2, 0,
3123 "Microsoft JScript compilation error",
3124 "Expected ')'",
3125 "-->0) a=5;");
3126
3128 "new 3;",
3129 0x800a01bd, 0, 0,
3130 "Microsoft JScript runtime error",
3131 "Object doesn't support this action",
3132 NULL);
3133
3135 "new null;",
3136 0x800a138f, 0, 0,
3137 "Microsoft JScript runtime error",
3138 "Object expected",
3139 NULL);
3140
3142 "var a;\nnew null;",
3143 0x800a138f, 1, 0,
3144 "Microsoft JScript runtime error",
3145 "Object expected",
3146 NULL);
3147
3149 "var a; new null;",
3150 0x800a138f, 0, 7,
3151 "Microsoft JScript runtime error",
3152 "Object expected",
3153 NULL);
3154
3155 run_bom_tests();
3156
3157 return TRUE;
3158}
static void test_isvisible(void)
static void test_invokeex(void)
Definition: run.c:2547
static void test_eval(void)
Definition: run.c:2605
static void parse_script_with_error_a(const char *src, SCODE errorcode, ULONG line, LONG pos, LPCSTR source, LPCSTR desc, LPCSTR linetext)
Definition: run.c:2121
static void run_from_res(const char *name)
Definition: run.c:2224
static void test_script_exprs(void)
Definition: run.c:2498
static void parse_script_ae(const char *src, HRESULT exhres)
Definition: run.c:2110
static void run_bom_tests(void)
Definition: run.c:2712
static void test_automagic(void)
Definition: run.c:2335
static void test_start(void)
Definition: run.c:2294
#define parse_htmlscript_a(a)
Definition: run.c:2113
#define win_skip
Definition: test.h:163

Referenced by START_TEST(), test_Console(), and WinMain().

◆ set_script_prop()

static HRESULT set_script_prop ( IActiveScript engine,
DWORD  property,
VARIANT val 
)
static

Definition at line 1773 of file run.c.

1774{
1775 IActiveScriptProperty *script_prop;
1776 HRESULT hres;
1777
1778 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty,
1779 (void**)&script_prop);
1780 ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08x\n", hres);
1781
1782 hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val);
1783 IActiveScriptProperty_Release(script_prop);
1784
1785 return hres;
1786}
GLuint GLfloat * val
Definition: glext.h:7180

Referenced by create_script().

◆ START_TEST()

START_TEST ( run  )

Definition at line 3323 of file run.c.

3324{
3325 int argc;
3326 char **argv;
3327
3329
3331
3332 if(!check_jscript()) {
3333 win_skip("Broken engine, probably too old\n");
3334 }else if(argc > 2) {
3335 invoke_version = 2;
3336 run_from_file(argv[2]);
3337 }else {
3338 trace("invoke version 0\n");
3339 invoke_version = 0;
3340 run_tests();
3341
3342 trace("invoke version 2\n");
3343 invoke_version = 2;
3344 if(run_tests()) {
3345 trace("JSctipt.Encode tests...\n");
3347 trace("ParseProcedureText tests...\n");
3349 }
3350
3353 }
3354
3356}
static int argc
Definition: ServiceArgs.c:12
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static BOOL check_jscript(void)
Definition: run.c:3304
static BOOL run_tests(void)
Definition: run.c:2756
static void test_parse_proc(void)
Definition: run.c:3160
static void run_benchmarks(void)
Definition: run.c:3295
static void run_encoded_tests(void)
Definition: run.c:3184
static void run_from_file(const char *filename)
Definition: run.c:2186
#define argv
Definition: mplay32.c:18
int winetest_interactive
int winetest_get_mainargs(char ***pargv)

◆ strcmp_wa()

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

Definition at line 219 of file run.c.

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

Referenced by ActiveScriptSite_GetItemInfo(), BindEventHandler_BindHandler(), collectionObj_GetDispID(), Dispatch_GetIDsOfNames(), Global_GetDispID(), pureDisp_GetIDsOfNames(), test_isexpression(), test_procedures(), testObj_DeleteMemberByName(), and testObj_GetDispID().

◆ test_automagic()

static void test_automagic ( void  )
static

Definition at line 2335 of file run.c.

2336{
2337 IActiveScriptParse *parser;
2338 IActiveScript *engine;
2339 BSTR str;
2340 HRESULT hres;
2341
2342 script_engine = engine = create_script();
2343 if(!engine)
2344 return;
2345
2346 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2347 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2348
2350 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2351
2352 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2353 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2354
2355 hres = IActiveScript_AddNamedItem(engine, testW, SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2356 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2357
2358 str = a2bstr("function bindEventHandler::eventName() {}\n"
2359 "reportSuccess();");
2361 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2363
2364 SET_EXPECT(BindHandler);
2365 SET_EXPECT(global_success_d);
2366 SET_EXPECT(global_success_i);
2367 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2368 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2369 CHECK_CALLED(BindHandler);
2370 CHECK_CALLED(global_success_d);
2371 CHECK_CALLED(global_success_i);
2372
2373 IActiveScript_Release(engine);
2376}

Referenced by run_tests().

◆ test_default_value()

static void test_default_value ( void  )
static

Definition at line 2474 of file run.c.

2475{
2476 DISPPARAMS dp = {0};
2477 IDispatch *disp;
2478 VARIANT v;
2479 HRESULT hres;
2480
2481 hres = parse_script_expr("new Date()", &v, NULL);
2482 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2483 ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
2484 disp = V_DISPATCH(&v);
2485
2486 V_VT(&v) = VT_EMPTY;
2487 hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
2488 ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08x\n", hres);
2489 if(hres == S_OK)
2490 {
2491 ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
2492 }
2493
2494 VariantClear(&v);
2495 IDispatch_Release(disp);
2496}
static HRESULT parse_script_expr(const char *expr, VARIANT *res, IActiveScript **engine_ret)
Definition: run.c:2378

Referenced by test_script_exprs().

◆ test_eval()

static void test_eval ( void  )
static

Definition at line 2605 of file run.c.

2606{
2607 IActiveScriptParse *parser;
2608 IDispatchEx *script_dispex;
2610 IActiveScript *engine;
2611 VARIANT arg, res;
2613 DISPID id, v_id;
2614 BSTR str;
2615 HRESULT hres;
2616
2617 engine = create_script();
2618
2619 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2620 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2621
2623 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2624
2625 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2626 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2627
2628 SET_EXPECT(GetItemInfo_testVal);
2629 hres = IActiveScript_AddNamedItem(engine, test_valW,
2630 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2631 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2632 CHECK_CALLED(GetItemInfo_testVal);
2633
2634 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2635 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2636
2637 hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
2638 ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
2639 ok(script_disp != NULL, "script_disp == NULL\n");
2640
2641 hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&script_dispex);
2642 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2643 IDispatch_Release(script_disp);
2644
2645 str = a2bstr("eval");
2646 hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id);
2647 ok(hres == S_OK, "Could not get eval dispid: %08x\n", hres);
2649
2650 params.rgvarg = &arg;
2651 params.rgdispidNamedArgs = NULL;
2652 params.cArgs = 1;
2653 params.cNamedArgs = 0;
2654 V_VT(&arg) = VT_BSTR;
2655
2656 V_BSTR(&arg) = a2bstr("var v = 1;");
2657 V_VT(&res) = VT_ERROR;
2658 hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
2659 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2660 ok(V_VT(&res) == VT_EMPTY, "eval returned type %u\n", V_VT(&res));
2662
2663 V_BSTR(&arg) = a2bstr("v");
2664 V_VT(&res) = VT_ERROR;
2665 hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
2666 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2667 ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
2668 ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res));
2670
2671 str = a2bstr("v");
2672 hres = IDispatchEx_GetDispID(script_dispex, str, 0, &v_id);
2673 ok(hres == S_OK, "Could not get v dispid: %08x\n", hres);
2675
2676 params.rgvarg = NULL;
2677 params.cArgs = 0;
2678 V_VT(&res) = VT_ERROR;
2679 hres = IDispatchEx_InvokeEx(script_dispex, v_id, 0, DISPATCH_PROPERTYGET, &params, &res, NULL, NULL);
2680 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2681 ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
2682 ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res));
2683
2684 SET_EXPECT(global_calleval_i);
2685 str = a2bstr("(function(){"
2686 " var v = 2;"
2687 " callEval(eval);"
2688 " ok(x === 5, 'x = ' + x);"
2689 "})();");
2691 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2693 CHECK_CALLED(global_calleval_i);
2694
2695 str = a2bstr("x");
2696 hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id);
2697 ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(x) returned %08x\n", hres);
2699
2700 IDispatchEx_Release(script_dispex);
2702 IActiveScript_Close(engine);
2703 IActiveScript_Release(engine);
2704}
GLuint id
Definition: glext.h:5910
static VARIANTARG static DISPID
Definition: ordinal.c:52

Referenced by run_tests().

◆ test_IActiveScriptError()

static void test_IActiveScriptError ( IActiveScriptError error,
SCODE  errorcode,
ULONG  line,
LONG  pos,
BSTR  script_source,
BSTR  description,
BSTR  line_text 
)
static

Definition at line 1952 of file run.c.

1953{
1954 HRESULT hres;
1955 DWORD source_context;
1957 LONG char_position;
1958 BSTR linetext;
1959 EXCEPINFO excep;
1960
1961 /* IActiveScriptError_GetSourcePosition */
1962
1963 hres = IActiveScriptError_GetSourcePosition(error, NULL, NULL, NULL);
1964 ok(hres == S_OK, "IActiveScriptError_GetSourcePosition -- hres: expected S_OK, got 0x%08x\n", hres);
1965
1966 source_context = 0xdeadbeef;
1967 hres = IActiveScriptError_GetSourcePosition(error, &source_context, NULL, NULL);
1968 ok(hres == S_OK, "IActiveScriptError_GetSourcePosition -- hres: expected S_OK, got 0x%08x\n", hres);
1969 ok(source_context == 0, "IActiveScriptError_GetSourcePosition -- source_context: expected 0, got 0x%08x\n", source_context);
1970
1971 line_number = 0xdeadbeef;
1972 hres = IActiveScriptError_GetSourcePosition(error, NULL, &line_number, NULL);
1973 ok(hres == S_OK, "IActiveScriptError_GetSourcePosition -- hres: expected S_OK, got 0x%08x\n", hres);
1974 ok(line_number == line, "IActiveScriptError_GetSourcePosition -- line_number: expected %d, got %d\n", line, line_number);
1975
1976 char_position = 0xdeadbeef;
1977 hres = IActiveScriptError_GetSourcePosition(error, NULL, NULL, &char_position);
1978 ok(hres == S_OK, "IActiveScriptError_GetSourcePosition -- hres: expected S_OK, got 0x%08x\n", hres);
1979 ok(char_position == pos, "IActiveScriptError_GetSourcePosition -- char_position: expected %d, got %d\n", pos, char_position);
1980
1981 /* IActiveScriptError_GetSourceLineText */
1982
1983 hres = IActiveScriptError_GetSourceLineText(error, NULL);
1984 ok(hres == E_POINTER, "IActiveScriptError_GetSourceLineText -- hres: expected E_POINTER, got 0x%08x\n", hres);
1985
1986 linetext = NULL;
1987 hres = IActiveScriptError_GetSourceLineText(error, &linetext);
1988 if (line_text) {
1989 ok(hres == S_OK, "IActiveScriptError_GetSourceLineText -- hres: expected S_OK, got 0x%08x\n", hres);
1990 ok(linetext != NULL && !lstrcmpW(linetext, line_text),
1991 "IActiveScriptError_GetSourceLineText -- expected %s, got %s\n", wine_dbgstr_w(line_text), wine_dbgstr_w(linetext));
1992 } else {
1993 ok(hres == E_FAIL, "IActiveScriptError_GetSourceLineText -- hres: expected S_OK, got 0x%08x\n", hres);
1994 ok(linetext == NULL,
1995 "IActiveScriptError_GetSourceLineText -- expected NULL, got %s\n", wine_dbgstr_w(linetext));
1996 }
1997 SysFreeString(linetext);
1998
1999 /* IActiveScriptError_GetExceptionInfo */
2000
2001 hres = IActiveScriptError_GetExceptionInfo(error, NULL);
2002 ok(hres == E_POINTER, "IActiveScriptError_GetExceptionInfo -- hres: expected E_POINTER, got 0x%08x\n", hres);
2003
2004 excep.wCode = 0xdead;
2005 excep.wReserved = 0xdead;
2006 excep.bstrSource = (BSTR)0xdeadbeef;
2007 excep.bstrDescription = (BSTR)0xdeadbeef;
2008 excep.bstrHelpFile = (BSTR)0xdeadbeef;
2009 excep.dwHelpContext = 0xdeadbeef;
2010 excep.pvReserved = (void *)0xdeadbeef;
2011 excep.pfnDeferredFillIn = (void *)0xdeadbeef;
2012 excep.scode = 0xdeadbeef;
2013
2014 hres = IActiveScriptError_GetExceptionInfo(error, &excep);
2015 ok(hres == S_OK, "IActiveScriptError_GetExceptionInfo -- hres: expected S_OK, got 0x%08x\n", hres);
2016
2017 ok(excep.wCode == 0, "IActiveScriptError_GetExceptionInfo -- excep.wCode: expected 0, got 0x%08x\n", excep.wCode);
2018 ok(excep.wReserved == 0, "IActiveScriptError_GetExceptionInfo -- excep.wReserved: expected 0, got %d\n", excep.wReserved);
2019 if (!is_lang_english())
2020 skip("Non-english UI (test with hardcoded strings)\n");
2021 else {
2022 ok(excep.bstrSource != NULL && !lstrcmpW(excep.bstrSource, script_source),
2023 "IActiveScriptError_GetExceptionInfo -- excep.bstrSource is not valid: expected %s, got %s\n",
2024 wine_dbgstr_w(script_source), wine_dbgstr_w(excep.bstrSource));
2025 ok(excep.bstrDescription != NULL && !lstrcmpW(excep.bstrDescription, description),
2026 "IActiveScriptError_GetExceptionInfo -- excep.bstrDescription is not valid: got %s\n", wine_dbgstr_w(excep.bstrDescription));
2027 }
2028 ok(excep.bstrHelpFile == NULL,
2029 "IActiveScriptError_GetExceptionInfo -- excep.bstrHelpFile: expected NULL, got %s\n", wine_dbgstr_w(excep.bstrHelpFile));
2030 ok(excep.dwHelpContext == 0, "IActiveScriptError_GetExceptionInfo -- excep.dwHelpContext: expected 0, got %d\n", excep.dwHelpContext);
2031 ok(excep.pvReserved == NULL, "IActiveScriptError_GetExceptionInfo -- excep.pvReserved: expected NULL, got %p\n", excep.pvReserved);
2032 ok(excep.pfnDeferredFillIn == NULL, "IActiveScriptError_GetExceptionInfo -- excep.pfnDeferredFillIn: expected NULL, got %p\n", excep.pfnDeferredFillIn);
2033 ok(excep.scode == errorcode, "IActiveScriptError_GetExceptionInfo -- excep.scode: expected 0x%08x, got 0x%08x\n", errorcode, excep.scode);
2034
2035 SysFreeString(excep.bstrSource);
2036 SysFreeString(excep.bstrDescription);
2037 SysFreeString(excep.bstrHelpFile);
2038}
#define skip(...)
Definition: atltest.h:64
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4243
#define error(str)
Definition: mkdosfs.c:1605
static BOOL is_lang_english(void)
Definition: run.c:187
long LONG
Definition: pedump.c:60
static long line_number
Definition: main.cpp:17
#define E_POINTER
Definition: winerror.h:2365

Referenced by parse_script_with_error().

◆ test_invokeex()

static void test_invokeex ( void  )
static

Definition at line 2547 of file run.c.

2548{
2549 DISPID func_id, prop_id;
2550 DISPPARAMS dp = {NULL};
2552 IDispatchEx *dispex;
2553 VARIANT v;
2554 BSTR str;
2555 HRESULT hres;
2556
2557 hres = parse_script_expr("var o = {func: function() {return 3;}, prop: 6}; o", &v, &script);
2558 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2559 ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
2560
2561 hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex);
2562 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2563 VariantClear(&v);
2564
2565 str = a2bstr("func");
2566 hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
2568 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
2569
2570 str = a2bstr("prop");
2571 hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
2573 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
2574
2575 hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
2576 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2577 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2578 ok(V_I4(&v) == 3, "V_I4(v) = %d\n", V_I4(&v));
2579
2580 hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
2581 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2582 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2583 ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v));
2584
2585 hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
2586 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2587
2588 str = a2bstr("func");
2589 hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
2591 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
2592
2593 hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
2594 ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08x\n", hres);
2595
2596 hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
2597 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2598 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2599 ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v));
2600
2601 IDispatchEx_Release(dispex);
2602 IActiveScript_Release(script);
2603}
@ SCRIPTSTATE_UNINITIALIZED
Definition: activscp.idl:57
#define E_UNEXPECTED
Definition: winerror.h:2456

Referenced by run_tests().

◆ test_isvisible()

static void test_isvisible ( BOOL  global_members)
static

Definition at line 2241 of file run.c.

2242{
2243 IActiveScriptParse *parser;
2244 IActiveScript *engine;
2245 HRESULT hres;
2246
2247 static const WCHAR script_textW[] =
2248 {'v','a','r',' ','v',' ','=',' ','t','e','s','t','V','a','l',';',0};
2249
2250 engine = create_script();
2251 if(!engine)
2252 return;
2253
2254 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2255 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2256 if (FAILED(hres))
2257 {
2258 IActiveScript_Release(engine);
2259 return;
2260 }
2261
2263 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2264
2265 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2266 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2267
2268 if(global_members)
2269 SET_EXPECT(GetItemInfo_testVal);
2270 hres = IActiveScript_AddNamedItem(engine, test_valW,
2271 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|
2272 (global_members ? SCRIPTITEM_GLOBALMEMBERS : 0));
2273 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2274 if(global_members)
2275 CHECK_CALLED(GetItemInfo_testVal);
2276
2277 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2278 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2279
2280 if(!global_members)
2281 SET_EXPECT(GetItemInfo_testVal);
2282 hres = IActiveScriptParse_ParseScriptText(parser, script_textW, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2283 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2284 if(!global_members)
2285 CHECK_CALLED(GetItemInfo_testVal);
2286
2287 hres = IActiveScriptParse_ParseScriptText(parser, script_textW, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2288 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2289
2290 IActiveScript_Release(engine);
2292}
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ test_parse_proc()

static void test_parse_proc ( void  )
static

Definition at line 3160 of file run.c.

3161{
3162 VARIANT args[2];
3163 DISPPARAMS dp = {args};
3164
3165 dp.cArgs = 0;
3166 invoke_procedure(NULL, "return true;", &dp);
3167
3168 dp.cArgs = 1;
3169 V_VT(args) = VT_EMPTY;
3170 invoke_procedure(NULL, "return arguments.length == 1;", &dp);
3171
3172 V_VT(args) = VT_BOOL;
3173 V_BOOL(args) = VARIANT_TRUE;
3174 invoke_procedure(" x ", "return x;", &dp);
3175
3176 dp.cArgs = 2;
3177 V_VT(args) = VT_I4;
3178 V_I4(args) = 2;
3179 V_VT(args+1) = VT_I4;
3180 V_I4(args+1) = 1;
3181 invoke_procedure(" _x1 , y_2", "return _x1 === 1 && y_2 === 2;", &dp);
3182}
static HRESULT invoke_procedure(const char *argsa, const char *sourcea, DISPPARAMS *dp)
Definition: run.c:1855

Referenced by START_TEST().

◆ test_retval()

static void test_retval ( void  )
static

Definition at line 2422 of file run.c.

2423{
2424 BSTR str = a2bstr("reportSuccess(), true");
2425 IActiveScriptParse *parser;
2426 IActiveScript *engine;
2428 VARIANT res;
2429 HRESULT hres;
2430
2431 engine = create_script();
2432 if(!engine)
2433 return;
2434
2435 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2436 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2437
2439 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2440
2441 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2442 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2443
2444 SET_EXPECT(GetItemInfo_testVal);
2445 hres = IActiveScript_AddNamedItem(engine, test_valW,
2446 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2447 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2448 CHECK_CALLED(GetItemInfo_testVal);
2449
2450 V_VT(&res) = VT_NULL;
2451 SET_EXPECT(global_success_d);
2452 SET_EXPECT(global_success_i);
2454 CHECK_CALLED(global_success_d);
2455 CHECK_CALLED(global_success_i);
2456 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2457 ok(V_VT(&res) == VT_EMPTY, "V_VT(&res) = %d\n", V_VT(&res));
2458
2459 hres = IActiveScript_GetScriptState(engine, &state);
2460 ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
2461 ok(state == SCRIPTSTATE_INITIALIZED, "state = %d\n", state);
2462
2463 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2464 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2465
2466 hres = IActiveScript_Close(engine);
2467 ok(hres == S_OK, "Close failed: %08x\n", hres);
2468
2470 IActiveScript_Release(engine);
2472}
@ SCRIPTSTATE_INITIALIZED
Definition: activscp.idl:62

Referenced by test_script_exprs().

◆ test_script_exprs()

static void test_script_exprs ( void  )
static

Definition at line 2498 of file run.c.

2499{
2500 VARIANT v;
2501 HRESULT hres;
2502
2504
2505 hres = parse_script_expr("true", &v, NULL);
2506 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2507 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
2508 ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
2509
2510 hres = parse_script_expr("false, true", &v, NULL);
2511 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2512 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
2513 ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
2514
2515 SET_EXPECT(global_success_d);
2516 SET_EXPECT(global_success_i);
2517 hres = parse_script_expr("reportSuccess(); true", &v, NULL);
2518 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2519 ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
2520 ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
2521 CHECK_CALLED(global_success_d);
2522 CHECK_CALLED(global_success_i);
2523
2524 hres = parse_script_expr("if(false) true", &v, NULL);
2525 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2526 ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
2527
2528 hres = parse_script_expr("return testPropGet", &v, NULL);
2529 ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
2530
2531 hres = parse_script_expr("reportSuccess(); return true", &v, NULL);
2532 ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
2533
2534 SET_EXPECT(global_success_d);
2535 SET_EXPECT(global_success_i);
2536 hres = parse_script_expr("reportSuccess(); true", NULL, NULL);
2537 ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
2538 CHECK_CALLED(global_success_d);
2539 CHECK_CALLED(global_success_i);
2540
2542 test_retval();
2543
2545}
static void test_retval(void)
Definition: run.c:2422
static void test_default_value(void)
Definition: run.c:2474

Referenced by run_tests().

◆ test_start()

static void test_start ( void  )
static

Definition at line 2294 of file run.c.

2295{
2296 IActiveScriptParse *parser;
2297 IActiveScript *engine;
2298 BSTR str;
2299 HRESULT hres;
2300
2301 script_engine = engine = create_script();
2302 if(!engine)
2303 return;
2304
2305 hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2306 ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2307
2309 ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2310
2311 hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2312 ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2313
2314 hres = IActiveScript_AddNamedItem(engine, testW, SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2315 ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2316
2317 str = a2bstr("ok(getScriptState() === 5, \"getScriptState = \" + getScriptState());\n"
2318 "reportSuccess();");
2320 ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
2322
2323 SET_EXPECT(global_success_d);
2324 SET_EXPECT(global_success_i);
2325 hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2326 ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2327 CHECK_CALLED(global_success_d);
2328 CHECK_CALLED(global_success_i);
2329
2330 IActiveScript_Release(engine);
2333}

Referenced by run_tests().

◆ testObj_DeleteMemberByName()

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

Definition at line 560 of file run.c.

561{
562 if(!strcmp_wa(bstrName, "deleteTest")) {
563 CHECK_EXPECT(testobj_delete_test);
564 test_grfdex(grfdex, fdexNameCaseSensitive);
565 return S_OK;
566 }
567 if(!strcmp_wa(bstrName, "noDeleteTest")) {
568 CHECK_EXPECT(testobj_delete_nodelete);
569 test_grfdex(grfdex, fdexNameCaseSensitive);
570 return S_FALSE;
571 }
572
573 ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName));
574 return E_FAIL;
575}

◆ testObj_GetDispID()

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

Definition at line 451 of file run.c.

452{
453 if(!strcmp_wa(bstrName, "prop")) {
454 CHECK_EXPECT(testobj_prop_d);
455 test_grfdex(grfdex, fdexNameCaseSensitive);
457 return S_OK;
458 }
459 if(!strcmp_wa(bstrName, "withProp")) {
460 CHECK_EXPECT(testobj_withprop_d);
461 test_grfdex(grfdex, fdexNameCaseSensitive|fdexNameImplicit);
463 return S_OK;
464 }
465 if(!strcmp_wa(bstrName, "noprop")) {
466 CHECK_EXPECT(testobj_noprop_d);
467 test_grfdex(grfdex, fdexNameCaseSensitive);
468 return DISP_E_UNKNOWNNAME;
469 }
470 if(!strcmp_wa(bstrName, "onlyDispID")) {
472 CHECK_EXPECT(testobj_onlydispid_d);
473 test_grfdex(grfdex, fdexNameCaseSensitive);
475 return S_OK;
476 }
477 if(!strcmp_wa(bstrName, "notExists")) {
478 CHECK_EXPECT(testobj_notexists_d);
479 test_grfdex(grfdex, fdexNameCaseSensitive);
480 return DISP_E_UNKNOWNNAME;
481 }
482
483 ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName));
484 return E_NOTIMPL;
485}
#define DISPID_TESTOBJ_WITHPROP
Definition: run.c:165
#define DISPID_TESTOBJ_ONLYDISPID
Definition: run.c:164

◆ testObj_Invoke()

static HRESULT WINAPI testObj_Invoke ( IDispatchEx iface,
DISPID  id,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT pvarRes,
EXCEPINFO *  pei,
UINT puArgErr 
)
static

Definition at line 429 of file run.c.

432{
433 switch(id) {
434 case DISPID_NEWENUM:
435 ok(pdp != NULL, "pdp == NULL\n");
436 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
437 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
438 ok(pvarRes != NULL, "pvarRes == NULL\n");
439 ok(pei == NULL, "pei != NULL\n");
440
441 CHECK_EXPECT(testobj_newenum);
442 V_VT(pvarRes) = VT_DISPATCH;
444 return S_OK;
445 }
446
447 ok(0, "unexpected call %x\n", id);
449}
static IEnumVARIANT testEnumVARIANT
Definition: run.c:326

◆ testObj_InvokeEx()

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

Definition at line 487 of file run.c.

489{
490 ok(pspCaller != NULL, "pspCaller = NULL\n");
491
492 switch(id) {
493 case DISPID_VALUE:
494 ok(pdp != NULL, "pdp == NULL\n");
495 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
496 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
497 ok(pvarRes != NULL, "pvarRes == NULL\n");
498 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
499 ok(pei != NULL, "pei == NULL\n");
500
501 switch(wFlags) {
502 case INVOKE_PROPERTYGET:
503 CHECK_EXPECT(testobj_value);
504 ok(!pdp->rgvarg, "rgvarg != NULL\n");
505 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
506 break;
507 case INVOKE_FUNC:
508 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
509 break;
510 case INVOKE_FUNC|INVOKE_PROPERTYGET:
511 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
512 break;
513 case DISPATCH_CONSTRUCT:
514 CHECK_EXPECT(testobj_construct);
515 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
516 break;
517 default:
518 ok(0, "invalid flag (%x)\n", wFlags);
519 }
520
521 V_VT(pvarRes) = VT_I4;
522 V_I4(pvarRes) = 1;
523 return S_OK;
526 CHECK_EXPECT(testobj_onlydispid_i);
527 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
528 ok(pdp != NULL, "pdp == NULL\n");
529 ok(!pdp->rgvarg, "rgvarg != NULL\n");
530 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
531 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
532 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
533 ok(pvarRes != NULL, "pvarRes == NULL\n");
534 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
535 ok(pei != NULL, "pei == NULL\n");
538 CHECK_EXPECT(testobj_withprop_i);
539
540 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
541 ok(pdp != NULL, "pdp == NULL\n");
542 ok(!pdp->rgvarg, "rgvarg != NULL\n");
543 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
544 ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
545 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
546 ok(pvarRes != NULL, "pvarRes == NULL\n");
547 ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
548 ok(pei != NULL, "pei == NULL\n");
549
550 V_VT(pvarRes) = VT_I4;
551 V_I4(pvarRes) = 1;
552
553 return S_OK;
554 }
555
556 ok(0, "unexpected call %x\n", id);
558}

Variable Documentation

◆ ActiveScriptSite

◆ ActiveScriptSite_CheckError

IActiveScriptSite ActiveScriptSite_CheckError = { &ActiveScriptSite_CheckErrorVtbl }
static

Definition at line 1771 of file run.c.

Referenced by parse_script_with_error().

◆ ActiveScriptSite_CheckErrorVtbl

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

Definition at line 1757 of file run.c.

◆ ActiveScriptSiteVtbl

◆ BindEventHandler

IBindEventHandler BindEventHandler = { &BindEventHandlerVtbl }
static

Definition at line 763 of file run.c.

Referenced by bindEventHandlerDisp_QueryInterface().

◆ bindEventHandlerDisp

IDispatchEx bindEventHandlerDisp = { &bindEventHandlerDispVtbl }
static

Definition at line 799 of file run.c.

Referenced by Global_InvokeEx().

◆ bindEventHandlerDispVtbl

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

Definition at line 781 of file run.c.

◆ BindEventHandlerVtbl

const IBindEventHandlerVtbl BindEventHandlerVtbl
static
Initial value:
= {
}
static HRESULT WINAPI BindEventHandler_QueryInterface(IBindEventHandler *iface, REFIID riid, void **ppv)
Definition: run.c:732
static ULONG WINAPI BindEventHandler_Release(IBindEventHandler *iface)
Definition: run.c:743
static HRESULT WINAPI BindEventHandler_BindHandler(IBindEventHandler *iface, const WCHAR *event, IDispatch *disp)
Definition: run.c:748
static ULONG WINAPI BindEventHandler_AddRef(IBindEventHandler *iface)
Definition: run.c:738

Definition at line 756 of file run.c.

◆ CLSID_JScript

const CLSID CLSID_JScript
static
Initial value:
=
{0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}

Definition at line 50 of file run.c.

Referenced by check_jscript(), and run_bom_tests().

◆ CLSID_JScriptEncode

const CLSID CLSID_JScriptEncode
static
Initial value:
=
{0xf414c262,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}}

Definition at line 52 of file run.c.

Referenced by run_encoded_tests().

◆ dispexFunc

IDispatchEx dispexFunc = { &dispexFuncVtbl }
static

Definition at line 653 of file run.c.

Referenced by Global_InvokeEx().

◆ dispexFuncVtbl

IDispatchExVtbl dispexFuncVtbl
static
Initial value:
= {
}
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: run.c:328
static HRESULT WINAPI dispexFunc_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *res, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: run.c:597

Definition at line 635 of file run.c.

◆ emptyW

const WCHAR emptyW[] = {0}
static

Definition at line 174 of file run.c.

Referenced by invoke_procedure(), parse_procedure(), and test_procedures().

◆ engine_clsid

const CLSID* engine_clsid = &CLSID_JScript
static

Definition at line 182 of file run.c.

Referenced by create_script(), run_bom_tests(), and run_encoded_tests().

◆ EnumVARIANT_index

int EnumVARIANT_index = 0
static

Definition at line 255 of file run.c.

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

◆ EnumVARIANT_next_0_count

int EnumVARIANT_next_0_count = 0
static

Definition at line 256 of file run.c.

Referenced by EnumVARIANT_Next(), and run_tests().

◆ Global

IDispatchEx Global = { &GlobalVtbl }
static

Definition at line 1648 of file run.c.

Referenced by ActiveScriptSite_GetItemInfo(), parse_script(), and parse_script_with_error().

◆ GlobalVtbl

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

Definition at line 1630 of file run.c.

◆ invoke_version

int invoke_version
static

Definition at line 179 of file run.c.

Referenced by _test_grfdex(), create_script(), Global_InvokeEx(), run_tests(), and START_TEST().

◆ pureDisp

IDispatchEx pureDisp = { &pureDispVtbl }
static

Definition at line 730 of file run.c.

Referenced by Global_InvokeEx().

◆ pureDispVtbl

IDispatchExVtbl pureDispVtbl
static
Initial value:
= {
}
static HRESULT WINAPI pureDisp_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: run.c:666
static HRESULT WINAPI pureDisp_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: run.c:655
static HRESULT WINAPI pureDisp_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *res, EXCEPINFO *ei, UINT *puArgErr)
Definition: run.c:686

Definition at line 720 of file run.c.

◆ script_disp

IDispatch* script_disp
static

◆ script_engine

IActiveScript* script_engine
static

Definition at line 181 of file run.c.

Referenced by Global_InvokeEx(), test_automagic(), and test_start().

◆ script_error

IActiveScriptError* script_error
static

Definition at line 180 of file run.c.

Referenced by ActiveScriptSite_OnScriptError_CheckError(), and parse_script_with_error().

◆ strict_dispid_check

◆ test_name

◆ test_valA

const CHAR test_valA[] = "testVal"
static

Definition at line 173 of file run.c.

Referenced by ActiveScriptSite_GetItemInfo().

◆ test_valW

const WCHAR test_valW[] = {'t','e','s','t','V','a','l',0}
static

Definition at line 172 of file run.c.

Referenced by parse_script_expr(), test_eval(), test_isvisible(), and test_retval().

◆ testA

const CHAR testA[] = "test"
static

◆ testEnumVARIANT

IEnumVARIANT testEnumVARIANT = { &testEnumVARIANTVtbl }
static

Definition at line 326 of file run.c.

Referenced by testObj_Invoke().

◆ testEnumVARIANTVtbl

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

Definition at line 316 of file run.c.

◆ testing_expr

BOOL testing_expr
static

Definition at line 176 of file run.c.

Referenced by Global_InvokeEx(), and test_script_exprs().

◆ testObj

IDispatchEx testObj = { &testObjVtbl }
static

Definition at line 595 of file run.c.

Referenced by Global_InvokeEx(), and test_disp().

◆ testObjVtbl

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

Definition at line 577 of file run.c.

◆ testW