ReactOS  0.4.14-dev-337-gf981a68
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)
GLenum func
Definition: glext.h:6028

Definition at line 73 of file run.c.

◆ CHECK_EXPECT

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

Definition at line 67 of file run.c.

◆ CHECK_EXPECT2

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

Definition at line 61 of file run.c.

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

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

Referenced by check_jscript(), Global_InvokeEx(), invoke_procedure(), parse_htmlscript(), parse_htmlscript_a(), parse_script_ae(), parse_script_af(), parse_script_expr(), parse_script_with_error_a(), run_encoded_tests(), test_automagic(), test_eval(), test_invokeex(), test_retval(), and test_start().

◆ ActiveScriptSite_AddRef()

static ULONG WINAPI ActiveScriptSite_AddRef ( IActiveScriptSite iface)
static

Definition at line 1663 of file run.c.

1664 {
1665  return 2;
1666 }

◆ ActiveScriptSite_GetDocVersionString()

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

Definition at line 1694 of file run.c.

1695 {
1696  return E_NOTIMPL;
1697 }
#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 1679 of file run.c.

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

◆ ActiveScriptSite_GetLCID()

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

Definition at line 1673 of file run.c.

1674 {
1675  *plcid = GetUserDefaultLCID();
1676  return S_OK;
1677 }
LCID WINAPI GetUserDefaultLCID(void)
Definition: lang.c:768
#define S_OK
Definition: intsafe.h:59

◆ ActiveScriptSite_OnEnterScript()

static HRESULT WINAPI ActiveScriptSite_OnEnterScript ( IActiveScriptSite iface)
static

Definition at line 1715 of file run.c.

1716 {
1717  return E_NOTIMPL;
1718 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnLeaveScript()

static HRESULT WINAPI ActiveScriptSite_OnLeaveScript ( IActiveScriptSite iface)
static

Definition at line 1720 of file run.c.

1721 {
1722  return E_NOTIMPL;
1723 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnScriptError()

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

Definition at line 1710 of file run.c.

1711 {
1712  return E_NOTIMPL;
1713 }
#define E_NOTIMPL
Definition: ddrawi.h:99

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

1744 {
1745  ok(pscripterror != NULL, "ActiveScriptSite_OnScriptError -- expected pscripterror to be set, got NULL\n");
1746 
1747  script_error = pscripterror;
1748  IActiveScriptError_AddRef(script_error);
1749 
1751 
1752  return S_OK;
1753 }
static IActiveScriptError * script_error
Definition: run.c:180
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: run.c:1710
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: run.c:67
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

◆ ActiveScriptSite_OnScriptTerminate()

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

Definition at line 1699 of file run.c.

1701 {
1702  return E_NOTIMPL;
1703 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_OnStateChange()

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

Definition at line 1705 of file run.c.

1706 {
1707  return E_NOTIMPL;
1708 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScriptSite_QueryInterface()

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

Definition at line 1648 of file run.c.

1649 {
1650  *ppv = NULL;
1651 
1653  *ppv = iface;
1654  else if(IsEqualGUID(&IID_IActiveScriptSite, riid))
1655  *ppv = iface;
1656  else
1657  return E_NOINTERFACE;
1658 
1659  IUnknown_AddRef((IUnknown*)*ppv);
1660  return S_OK;
1661 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ActiveScriptSite_Release()

static ULONG WINAPI ActiveScriptSite_Release ( IActiveScriptSite iface)
static

Definition at line 1668 of file run.c.

1669 {
1670  return 1;
1671 }

◆ 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 }
disp
Definition: i386-dis.c:3181
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: run.c:67
struct _cl_event * event
Definition: glext.h:7739
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57

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

◆ 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)) {
773  *ppv = &BindEventHandler;
774  return S_OK;
775  }
776 
777  *ppv = NULL;
778  return E_NOINTERFACE;
779 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
const GUID IID_IDispatch
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static IBindEventHandler BindEventHandler
Definition: run.c:763

◆ check_jscript()

static BOOL check_jscript ( void  )
static

Definition at line 3302 of file run.c.

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

Referenced by START_TEST().

◆ create_script()

static IActiveScript* create_script ( void  )
static

Definition at line 1786 of file run.c.

1787 {
1789  VARIANT v;
1790  HRESULT hres;
1791 
1792  hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1793  &IID_IActiveScript, (void**)&script);
1794  ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
1795 
1796  V_VT(&v) = VT_I4;
1797  V_I4(&v) = invoke_version;
1798  hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
1799  ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
1800  if(invoke_version && FAILED(hres)) {
1801  IActiveScript_Release(script);
1802  return NULL;
1803  }
1804 
1805  return script;
1806 }
Definition: compat.h:1947
#define V_I4(A)
Definition: oleauto.h:247
smooth NULL
Definition: ftsmooth.c:416
script
Definition: msipriv.h:374
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define V_VT(A)
Definition: oleauto.h:211
#define broken(x)
Definition: _sntprintf.h:21
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
static const CLSID * engine_clsid
Definition: run.c:182
static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *val)
Definition: run.c:1771
static int invoke_version
Definition: run.c:179

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

◆ DEFINE_EXPECT() [1/45]

DEFINE_EXPECT ( global_propget_d  )

◆ DEFINE_EXPECT() [2/45]

DEFINE_EXPECT ( global_propget_i  )

◆ DEFINE_EXPECT() [3/45]

DEFINE_EXPECT ( global_propput_d  )

◆ DEFINE_EXPECT() [4/45]

DEFINE_EXPECT ( global_propput_i  )

◆ DEFINE_EXPECT() [5/45]

DEFINE_EXPECT ( global_propputref_d  )

◆ DEFINE_EXPECT() [6/45]

DEFINE_EXPECT ( global_propputref_i  )

◆ DEFINE_EXPECT() [7/45]

DEFINE_EXPECT ( global_propdelete_d  )

◆ DEFINE_EXPECT() [8/45]

DEFINE_EXPECT ( global_nopropdelete_d  )

◆ DEFINE_EXPECT() [9/45]

DEFINE_EXPECT ( global_propdeleteerror_d  )

◆ DEFINE_EXPECT() [10/45]

DEFINE_EXPECT ( global_success_d  )

◆ DEFINE_EXPECT() [11/45]

DEFINE_EXPECT ( global_success_i  )

◆ DEFINE_EXPECT() [12/45]

DEFINE_EXPECT ( global_notexists_d  )

◆ DEFINE_EXPECT() [13/45]

DEFINE_EXPECT ( global_propargput_d  )

◆ DEFINE_EXPECT() [14/45]

DEFINE_EXPECT ( global_propargput_i  )

◆ DEFINE_EXPECT() [15/45]

DEFINE_EXPECT ( global_propargputop_d  )

◆ DEFINE_EXPECT() [16/45]

DEFINE_EXPECT ( global_propargputop_get_i  )

◆ DEFINE_EXPECT() [17/45]

DEFINE_EXPECT ( global_propargputop_put_i  )

◆ DEFINE_EXPECT() [18/45]

DEFINE_EXPECT ( global_testargtypes_i  )

◆ DEFINE_EXPECT() [19/45]

DEFINE_EXPECT ( global_calleval_i  )

◆ DEFINE_EXPECT() [20/45]

DEFINE_EXPECT ( puredisp_prop_d  )

◆ DEFINE_EXPECT() [21/45]

DEFINE_EXPECT ( puredisp_noprop_d  )

◆ DEFINE_EXPECT() [22/45]

DEFINE_EXPECT ( puredisp_value  )

◆ DEFINE_EXPECT() [23/45]

DEFINE_EXPECT ( dispexfunc_value  )

◆ DEFINE_EXPECT() [24/45]

DEFINE_EXPECT ( testobj_delete_test  )

◆ DEFINE_EXPECT() [25/45]

DEFINE_EXPECT ( testobj_delete_nodelete  )

◆ DEFINE_EXPECT() [26/45]

DEFINE_EXPECT ( testobj_value  )

◆ DEFINE_EXPECT() [27/45]

DEFINE_EXPECT ( testobj_construct  )

◆ DEFINE_EXPECT() [28/45]

DEFINE_EXPECT ( testobj_prop_d  )

◆ DEFINE_EXPECT() [29/45]

DEFINE_EXPECT ( testobj_withprop_d  )

◆ DEFINE_EXPECT() [30/45]

DEFINE_EXPECT ( testobj_withprop_i  )

◆ DEFINE_EXPECT() [31/45]

DEFINE_EXPECT ( testobj_noprop_d  )

◆ DEFINE_EXPECT() [32/45]

DEFINE_EXPECT ( testobj_onlydispid_d  )

◆ DEFINE_EXPECT() [33/45]

DEFINE_EXPECT ( testobj_onlydispid_i  )

◆ DEFINE_EXPECT() [34/45]

DEFINE_EXPECT ( testobj_notexists_d  )

◆ DEFINE_EXPECT() [35/45]

DEFINE_EXPECT ( testobj_newenum  )

◆ DEFINE_EXPECT() [36/45]

DEFINE_EXPECT ( enumvariant_next_0  )

◆ DEFINE_EXPECT() [37/45]

DEFINE_EXPECT ( enumvariant_next_1  )

◆ DEFINE_EXPECT() [38/45]

DEFINE_EXPECT ( enumvariant_reset  )

◆ DEFINE_EXPECT() [39/45]

DEFINE_EXPECT ( GetItemInfo_testVal  )

◆ DEFINE_EXPECT() [40/45]

DEFINE_EXPECT ( ActiveScriptSite_OnScriptError  )

◆ DEFINE_EXPECT() [41/45]

DEFINE_EXPECT ( invoke_func  )

◆ DEFINE_EXPECT() [42/45]

DEFINE_EXPECT ( DeleteMemberByDispID  )

◆ DEFINE_EXPECT() [43/45]

DEFINE_EXPECT ( DeleteMemberByDispID_false  )

◆ DEFINE_EXPECT() [44/45]

DEFINE_EXPECT ( DeleteMemberByDispID_error  )

◆ DEFINE_EXPECT() [45/45]

DEFINE_EXPECT ( BindHandler  )

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

◆ DispatchEx_DeleteMemberByName()

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

Definition at line 393 of file run.c.

394 {
395  ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
396  return E_NOTIMPL;
397 }
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetDispID()

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

Definition at line 380 of file run.c.

381 {
382  ok(0, "unexpected call\n");
383  return E_NOTIMPL;
384 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetIDsOfNames()

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

Definition at line 364 of file run.c.

367 {
368  ok(0, "unexpected call\n");
369  return E_NOTIMPL;
370 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetMemberName()

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

Definition at line 411 of file run.c.

412 {
413  ok(0, "unexpected call\n");
414  return E_NOTIMPL;
415 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetMemberProperties()

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

Definition at line 405 of file run.c.

406 {
407  ok(0, "unexpected call\n");
408  return E_NOTIMPL;
409 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetNameSpaceParent()

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

Definition at line 423 of file run.c.

424 {
425  ok(0, "unexpected call\n");
426  return E_NOTIMPL;
427 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetNextDispID()

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

Definition at line 417 of file run.c.

418 {
419  ok(0, "unexpected call\n");
420  return E_NOTIMPL;
421 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetTypeInfo()

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

Definition at line 358 of file run.c.

360 {
361  return E_NOTIMPL;
362 }
#define E_NOTIMPL
Definition: ddrawi.h:99

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

◆ DispatchEx_Invoke()

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

Definition at line 372 of file run.c.

375 {
376  ok(0, "unexpected call\n");
377  return E_NOTIMPL;
378 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_InvokeEx()

static HRESULT WINAPI DispatchEx_InvokeEx ( IDispatchEx *  iface,
DISPID  id,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pdp,
VARIANT 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 }
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_QueryInterface()

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

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

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx *  iface)
static

Definition at line 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);
631  return DISP_E_MEMBERNOTFOUND;
632  }
633 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: run.c:67
#define V_BOOL(A)
Definition: oleauto.h:224
#define todo_wine
Definition: test.h:154
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define DISPID_THIS
Definition: olectl.h:395
#define ok(value,...)
Definition: atltest.h:57
GLuint res
Definition: glext.h:9613

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

◆ 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  {
273  if (EnumVARIANT_next_0_count <= 0)
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 }
Definition: compat.h:1947
static int EnumVARIANT_next_0_count
Definition: run.c:256
#define V_I4(A)
Definition: oleauto.h:247
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: run.c:67
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
static int EnumVARIANT_index
Definition: run.c:255

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

◆ 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);
304  EnumVARIANT_index = 0;
305  return S_OK;
306 }
#define CHECK_EXPECT(func)
Definition: run.c:67
#define S_OK
Definition: intsafe.h:59
static int EnumVARIANT_index
Definition: run.c:255

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

◆ get_script_from_file()

static BSTR get_script_from_file ( const char filename)
static

Definition at line 2146 of file run.c.

2147 {
2148  DWORD size, len;
2149  HANDLE file, map;
2150  const char *file_map;
2151  BSTR ret;
2152 
2154  if(file == INVALID_HANDLE_VALUE) {
2155  trace("Could not open file: %u\n", GetLastError());
2156  return NULL;
2157  }
2158 
2159  size = GetFileSize(file, NULL);
2160 
2162  CloseHandle(file);
2163  if(map == INVALID_HANDLE_VALUE) {
2164  trace("Could not create file mapping: %u\n", GetLastError());
2165  return NULL;
2166  }
2167 
2168  file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
2169  CloseHandle(map);
2170  if(!file_map) {
2171  trace("MapViewOfFile failed: %u\n", GetLastError());
2172  return NULL;
2173  }
2174 
2175  len = MultiByteToWideChar(CP_ACP, 0, file_map, size, NULL, 0);
2177  MultiByteToWideChar(CP_ACP, 0, file_map, size, ret, len);
2178 
2179  UnmapViewOfFile(file_map);
2180 
2181  return ret;
2182 }
#define CloseHandle
Definition: compat.h:406
#define MapViewOfFile
Definition: compat.h:410
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
OLECHAR * BSTR
Definition: compat.h:1942
const char * filename
Definition: ioapi.h:135
smooth NULL
Definition: ftsmooth.c:416
#define FILE_MAP_READ
Definition: compat.h:435
#define OPEN_EXISTING
Definition: compat.h:434
GLsizeiptr size
Definition: glext.h:5919
#define trace
Definition: atltest.h:70
#define CreateFileMappingW(a, b, c, d, e, f)
Definition: compat.h:409
const char file[]
Definition: icontest.c:11
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned long DWORD
Definition: ntddk_ex.h:95
DWORD WINAPI GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
Definition: fileinfo.c:481
Definition: _map.h:44
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define GENERIC_READ
Definition: compat.h:124
#define PAGE_READONLY
Definition: compat.h:127
#define MultiByteToWideChar
Definition: compat.h:100
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:407
#define UnmapViewOfFile
Definition: compat.h:411
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
Definition: glfuncs.h:262
Definition: fci.c:126

Referenced by run_from_file().

◆ Global_DeleteMemberByDispID()

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

Definition at line 1609 of file run.c.

1610 {
1611  switch(id) {
1613  CHECK_EXPECT(DeleteMemberByDispID);
1614  return S_OK;
1616  CHECK_EXPECT(DeleteMemberByDispID_false);
1617  return S_FALSE;
1619  CHECK_EXPECT(DeleteMemberByDispID_error);
1620  return E_FAIL;
1621  default:
1622  ok(0, "id = %d\n", id);
1623  }
1624 
1625  return E_FAIL;
1626 }
#define DISPID_GLOBAL_TESTPROPDELETE
Definition: run.c:159
#define E_FAIL
Definition: ddrawi.h:102
#define DISPID_GLOBAL_TESTPROPDELETEERROR
Definition: run.c:161
#define S_FALSE
Definition: winerror.h:2357
#define CHECK_EXPECT(func)
Definition: run.c:67
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define DISPID_GLOBAL_TESTNOPROPDELETE
Definition: run.c:160

◆ 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 DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define DISPID_GLOBAL_PROPARGPUTOP
Definition: run.c:157
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define DISPID_GLOBAL_INVOKEVERSION
Definition: run.c:136
#define DISPID_GLOBAL_TESTENUMOBJ
Definition: run.c:155
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
#define DISPID_GLOBAL_TESTPROPGET
Definition: run.c:125
#define DISPID_GLOBAL_GETSCRIPTSTATE
Definition: run.c:153
#define DISPID_GLOBAL_GETNULLBSTR
Definition: run.c:132
#define test_grfdex(a, b)
Definition: run.c:226
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_TESTNORES
Definition: run.c:150
#define DISPID_GLOBAL_TESTPROPDELETE
Definition: run.c:159
#define DISPID_GLOBAL_TESTPROPPUT
Definition: run.c:126
#define DISPID_GLOBAL_CALLEVAL
Definition: run.c:156
#define DISPID_GLOBAL_DISPUNK
Definition: run.c:148
#define DISPID_GLOBAL_TRACE
Definition: run.c:128
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:127
#define DISPID_GLOBAL_TESTPROPDELETEERROR
Definition: run.c:161
#define DISPID_GLOBAL_PROPGETFUNC
Definition: run.c:138
#define CHECK_EXPECT(func)
Definition: run.c:67
#define DISPID_GLOBAL_PUREDISP
Definition: run.c:141
#define DISPID_GLOBAL_ISWIN64
Definition: run.c:140
#define DISPID_GLOBAL_ISNULLBSTR
Definition: run.c:142
static BOOL strict_dispid_check
Definition: run.c:176
#define DISPID_GLOBAL_OK
Definition: run.c:129
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:131
#define S_OK
Definition: intsafe.h:59
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:143
#define DISPID_GLOBAL_TESTPROPPUTREF
Definition: run.c:152
#define ok(value,...)
Definition: atltest.h:57
#define DISPID_GLOBAL_GETSHORT
Definition: run.c:145
#define DISPID_GLOBAL_OBJECT_FLAG
Definition: run.c:139
#define DISPID_GLOBAL_TESTNOPROPDELETE
Definition: run.c:160
#define DISPID_GLOBAL_TESTTHIS
Definition: run.c:134
#define DISPID_GLOBAL_DISPEXFUNC
Definition: run.c:151
#define DISPID_GLOBAL_INTPROP
Definition: run.c:147
#define DISPID_GLOBAL_GETVT
Definition: run.c:130
#define DISPID_GLOBAL_TESTARGTYPES
Definition: run.c:146
#define DISPID_GLOBAL_TESTRES
Definition: run.c:149
#define DISPID_GLOBAL_TESTTHIS2
Definition: run.c:135
#define DISPID_GLOBAL_CREATEARRAY
Definition: run.c:137
#define DISPID_GLOBAL_NULL_DISP
Definition: run.c:133
#define DISPID_GLOBAL_SHORTPROP
Definition: run.c:144
#define DISPID_GLOBAL_BINDEVENTHANDLER
Definition: run.c:154

◆ 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  ok(V_BOOL(pdp->rgvarg+1), "%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1036 
1037  return S_OK;
1038 
1039  case DISPID_GLOBAL_TRACE:
1040  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1041  ok(pdp != NULL, "pdp == NULL\n");
1042  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1043  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1044  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1045  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1046  ok(!pvarRes, "pvarRes != NULL\n");
1047  ok(pei != NULL, "pei == NULL\n");
1048 
1049  ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1050  if(V_VT(pdp->rgvarg) == VT_BSTR)
1051  trace("%s: %s\n", test_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
1052 
1053  return S_OK;
1054 
1056  CHECK_EXPECT(global_success_i);
1057 
1058  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1059  ok(pdp != NULL, "pdp == NULL\n");
1060  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1061  ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
1062  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1063  if(!testing_expr)
1064  ok(!pvarRes, "pvarRes != NULL\n");
1065  ok(pei != NULL, "pei == NULL\n");
1066 
1067  return S_OK;
1068 
1070  CHECK_EXPECT(global_propget_i);
1071 
1072  ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1073  ok(pdp != NULL, "pdp == NULL\n");
1074  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1075  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1076  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1077  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1078  ok(pvarRes != NULL, "pvarRes == NULL\n");
1079  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1080  ok(pei != NULL, "pei == NULL\n");
1081 
1082  V_VT(pvarRes) = VT_I4;
1083  V_I4(pvarRes) = 1;
1084 
1085  return S_OK;
1086 
1088  CHECK_EXPECT(global_propput_i);
1089 
1090  ok(wFlags == INVOKE_PROPERTYPUT, "wFlags = %x\n", wFlags);
1091  ok(pdp != NULL, "pdp == NULL\n");
1092  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1093  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1094  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1095  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1096  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1097  ok(!pvarRes, "pvarRes != NULL\n");
1098 
1099  ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
1100  ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%d\n", V_I4(pdp->rgvarg));
1101  return S_OK;
1102 
1104  CHECK_EXPECT(global_propputref_i);
1105 
1106  ok(wFlags == (INVOKE_PROPERTYPUT|INVOKE_PROPERTYPUTREF), "wFlags = %x\n", wFlags);
1107  ok(pdp != NULL, "pdp == NULL\n");
1108  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1109  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1110  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1111  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1112  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1113  ok(!pvarRes, "pvarRes != NULL\n");
1114 
1115  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
1116  return S_OK;
1117 
1118  case DISPID_GLOBAL_GETVT:
1119  ok(pdp != NULL, "pdp == NULL\n");
1120  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1121  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1122  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1123  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1124  ok(pvarRes != NULL, "pvarRes == NULL\n");
1125  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1126  ok(pei != NULL, "pei == NULL\n");
1127 
1128  V_VT(pvarRes) = VT_BSTR;
1129  switch(V_VT(pdp->rgvarg)) {
1130  case VT_EMPTY:
1131  V_BSTR(pvarRes) = a2bstr("VT_EMPTY");
1132  break;
1133  case VT_NULL:
1134  V_BSTR(pvarRes) = a2bstr("VT_NULL");
1135  break;
1136  case VT_I4:
1137  V_BSTR(pvarRes) = a2bstr("VT_I4");
1138  break;
1139  case VT_R8:
1140  V_BSTR(pvarRes) = a2bstr("VT_R8");
1141  break;
1142  case VT_BSTR:
1143  V_BSTR(pvarRes) = a2bstr("VT_BSTR");
1144  break;
1145  case VT_DISPATCH:
1146  V_BSTR(pvarRes) = a2bstr("VT_DISPATCH");
1147  break;
1148  case VT_BOOL:
1149  V_BSTR(pvarRes) = a2bstr("VT_BOOL");
1150  break;
1151  case VT_ARRAY|VT_VARIANT:
1152  V_BSTR(pvarRes) = a2bstr("VT_ARRAY|VT_VARIANT");
1153  break;
1154  default:
1155  ok(0, "unknown vt %d\n", V_VT(pdp->rgvarg));
1156  return E_FAIL;
1157  }
1158 
1159  return S_OK;
1160 
1161  case DISPID_GLOBAL_TESTRES:
1162  ok(pvarRes != NULL, "pvarRes = NULL\n");
1163  if(pvarRes) {
1164  V_VT(pvarRes) = VT_BOOL;
1165  V_BOOL(pvarRes) = VARIANT_TRUE;
1166  }
1167  return S_OK;
1168 
1170  ok(!pvarRes, "pvarRes != NULL\n");
1171  if(pvarRes)
1172  V_VT(pvarRes) = VT_NULL;
1173  return S_OK;
1174 
1175  case DISPID_GLOBAL_TESTOBJ:
1176  ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1177  ok(pdp != NULL, "pdp == NULL\n");
1178  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1179  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1180  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1181  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1182  ok(pvarRes != NULL, "pvarRes == NULL\n");
1183  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1184  ok(pei != NULL, "pei == NULL\n");
1185 
1186  V_VT(pvarRes) = VT_DISPATCH;
1187  V_DISPATCH(pvarRes) = (IDispatch*)&testObj;
1188  return S_OK;
1189 
1191  ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1192  ok(pdp != NULL, "pdp == NULL\n");
1193  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1194  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1195  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1196  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1197  ok(pvarRes != NULL, "pvarRes == NULL\n");
1198  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1199  ok(pei != NULL, "pei == NULL\n");
1200 
1201  V_VT(pvarRes) = VT_DISPATCH;
1202  V_DISPATCH(pvarRes) = (IDispatch*)&pureDisp;
1203  return S_OK;
1204 
1206  V_VT(pvarRes) = VT_DISPATCH;
1207  V_DISPATCH(pvarRes) = (IDispatch*)&dispexFunc;
1208  return S_OK;
1209 
1211  if(pvarRes) {
1212  V_VT(pvarRes) = VT_BSTR;
1213  V_BSTR(pvarRes) = NULL;
1214  }
1215  return S_OK;
1216 
1218  ok(pdp != NULL, "pdp == NULL\n");
1219  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1220  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1221  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1222  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1223  ok(pvarRes != NULL, "pvarRes == NULL\n");
1224  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1225  ok(pei != NULL, "pei == NULL\n");
1226  ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1227 
1228  V_VT(pvarRes) = VT_BOOL;
1229  V_BOOL(pvarRes) = V_BSTR(pdp->rgvarg) ? VARIANT_FALSE : VARIANT_TRUE;
1230  return S_OK;
1231 
1232  case DISPID_GLOBAL_ISWIN64:
1233  if(pvarRes) {
1234  V_VT(pvarRes) = VT_BOOL;
1235  V_BOOL(pvarRes) = sizeof(void*) == 8 ? VARIANT_TRUE : VARIANT_FALSE;
1236  }
1237  return S_OK;
1238 
1240  ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1241  ok(pdp != NULL, "pdp == NULL\n");
1242  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1243  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1244  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1245  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1246  ok(pvarRes != NULL, "pvarRes == NULL\n");
1247  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1248  ok(pei != NULL, "pei == NULL\n");
1249 
1250  V_VT(pvarRes) = VT_DISPATCH;
1251  V_DISPATCH(pvarRes) = NULL;
1252  return S_OK;
1253 
1255  ok(pdp != NULL, "pdp == NULL\n");
1256  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1257  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1258  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1259  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1260  ok(pvarRes == NULL, "pvarRes != NULL\n");
1261  ok(pei != NULL, "pei == NULL\n");
1262 
1263  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1264  ok(V_DISPATCH(pdp->rgvarg) == (IDispatch*)iface, "disp != iface\n");
1265 
1266  return S_OK;
1267 
1269  ok(pdp != NULL, "pdp == NULL\n");
1270  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1271  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1272  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1273  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1274  ok(pvarRes == NULL, "pvarRes != NULL\n");
1275  ok(pei != NULL, "pei == NULL\n");
1276 
1277  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg));
1278  ok(V_DISPATCH(pdp->rgvarg) != (IDispatch*)iface, "disp == iface\n");
1279  ok(V_DISPATCH(pdp->rgvarg) == script_disp, "disp != script_disp\n");
1280 
1281  return S_OK;
1282 
1284  ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
1285  ok(pdp != NULL, "pdp == NULL\n");
1286  ok(!pdp->rgvarg, "rgvarg != NULL\n");
1287  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1288  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1289  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1290  ok(pvarRes != NULL, "pvarRes == NULL\n");
1291  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1292  ok(pei != NULL, "pei == NULL\n");
1293 
1294  V_VT(pvarRes) = VT_I4;
1295  V_I4(pvarRes) = invoke_version;
1296 
1297  return S_OK;
1298 
1300  SAFEARRAYBOUND bound[2];
1301  VARIANT *data;
1302  int i,j;
1303 
1304  ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
1305  ok(pdp != NULL, "pdp == NULL\n");
1306  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1307  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1308  ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs);
1309  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1310  ok(pvarRes != NULL, "pvarRes == NULL\n");
1311  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1312  ok(pei != NULL, "pei == NULL\n");
1313 
1314  bound[0].lLbound = 0;
1315  bound[0].cElements = 5;
1316  bound[1].lLbound = 2;
1317  bound[1].cElements = 2;
1318 
1319  V_VT(pvarRes) = VT_ARRAY|VT_VARIANT;
1320  V_ARRAY(pvarRes) = SafeArrayCreate(VT_VARIANT, 2, bound);
1321 
1322  SafeArrayAccessData(V_ARRAY(pvarRes), (void**)&data);
1323  for(i=0; i<5; i++) {
1324  for(j=2; j<4; j++) {
1325  V_VT(data) = VT_I4;
1326  V_I4(data) = i*10+j;
1327  data++;
1328  }
1329  }
1330  SafeArrayUnaccessData(V_ARRAY(pvarRes));
1331 
1332  return S_OK;
1333  }
1334 
1336  switch(wFlags) {
1337  case INVOKE_FUNC:
1338  CHECK_EXPECT(invoke_func);
1339  break;
1340  case INVOKE_FUNC|INVOKE_PROPERTYGET:
1341  ok(pdp->cArgs != 0, "pdp->cArgs = %d\n", pdp->cArgs);
1342  ok(pvarRes != NULL, "pdp->pvarRes == NULL\n");
1343  break;
1344  default:
1345  ok(0, "invalid flag (%x)\n", wFlags);
1346  }
1347 
1348  ok(pdp != NULL, "pdp == NULL\n");
1349  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1350  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1351  ok(pei != NULL, "pei == NULL\n");
1352 
1353  if(pvarRes) {
1354  ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1355  V_VT(pvarRes) = VT_I4;
1356  V_I4(pvarRes) = pdp->cArgs;
1357  }
1358 
1359  return S_OK;
1360 
1363  HRESULT hres;
1364 
1365  hres = IActiveScript_GetScriptState(script_engine, &state);
1366  ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
1367 
1368  V_VT(pvarRes) = VT_I4;
1369  V_I4(pvarRes) = state;
1370  return S_OK;
1371  }
1372 
1374  V_VT(pvarRes) = VT_DISPATCH;
1376  return S_OK;
1377 
1379  CHECK_EXPECT(global_propargput_i);
1380  ok(wFlags == INVOKE_PROPERTYPUT, "wFlags = %x\n", wFlags);
1381  ok(pdp != NULL, "pdp == NULL\n");
1382  ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1383  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1384  ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1385  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1386  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1387  ok(!pvarRes, "pvarRes != NULL\n");
1388  ok(pei != NULL, "pei == NULL\n");
1389 
1390  ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1391  ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1392 
1393  ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1394  ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1395 
1396  ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1397  ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1398  return S_OK;
1399 
1401  ok(pdp != NULL, "pdp == NULL\n");
1402  ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1403  ok(pei != NULL, "pei == NULL\n");
1404 
1405  switch(wFlags) {
1406  case INVOKE_PROPERTYGET | INVOKE_FUNC:
1407  CHECK_EXPECT(global_propargputop_get_i);
1408 
1409  ok(pdp->cNamedArgs == 0, "cNamedArgs = %d\n", pdp->cNamedArgs);
1410  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1411  ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
1412  ok(pdp->cNamedArgs == 0, "cNamedArgs = %d\n", pdp->cNamedArgs);
1413  ok(pvarRes != NULL, "pvarRes = NULL\n");
1414 
1415  ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1416  ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1417 
1418  ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1419  ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1420 
1421  V_VT(pvarRes) = VT_I4;
1422  V_I4(pvarRes) = 6;
1423  break;
1424  case INVOKE_PROPERTYPUT:
1425  CHECK_EXPECT(global_propargputop_put_i);
1426 
1427  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1428  ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
1429  ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
1430  ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
1431  ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
1432  ok(!pvarRes, "pvarRes != NULL\n");
1433 
1434  ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1435  ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
1436 
1437  ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1438  ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1439 
1440  ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1441  ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1442  break;
1443  default:
1444  ok(0, "wFlags = %x\n", wFlags);
1445  }
1446 
1447  return S_OK;
1448 
1450  IDispatchEx *dispex;
1451  BSTR str;
1452  HRESULT hres;
1453 
1454  hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&dispex);
1455  ok(hres == S_OK, "hres = %x\n", hres);
1456 
1457  str = a2bstr("Object");
1458  hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
1459  SysFreeString(str);
1460  ok(hres == S_OK, "hres = %x\n", hres);
1461 
1462  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, NULL, pei, pspCaller);
1463  ok(hres == S_OK, "hres = %x\n", hres);
1464 
1465  V_VT(pvarRes) = VT_EMPTY;
1466  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, pvarRes, pei, pspCaller);
1467  ok(hres == S_OK, "hres = %x\n", hres);
1468  ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1469  VariantClear(pvarRes);
1470 
1471  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, pdp, NULL, pei, pspCaller);
1472  ok(hres == S_OK, "hres = %x\n", hres);
1473 
1474  V_VT(pvarRes) = VT_EMPTY;
1475  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, pvarRes, pei, pspCaller);
1476  ok(hres == S_OK, "hres = %x\n", hres);
1477  ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1478  VariantClear(pvarRes);
1479 
1480  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, NULL, pei, pspCaller);
1481  ok(hres == S_OK, "hres = %x\n", hres);
1482 
1483  V_VT(pvarRes) = VT_EMPTY;
1484  hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT|DISPATCH_PROPERTYGET, pdp, pvarRes, pei, pspCaller);
1485  ok(hres == E_INVALIDARG, "hres = %x\n", hres);
1486 
1487  V_VT(pvarRes) = VT_EMPTY;
1488  hres = IDispatchEx_InvokeEx(dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
1489  ok(hres == S_OK, "hres = %x\n", hres);
1490  ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
1491  IDispatchEx_Release(dispex);
1492  return S_OK;
1493  }
1496  V_VT(pvarRes) = VT_I2;
1497  V_I2(pvarRes) = 10;
1498  return S_OK;
1499 
1500  case DISPID_GLOBAL_INTPROP:
1501  V_VT(pvarRes) = VT_INT;
1502  V_INT(pvarRes) = 22;
1503  return S_OK;
1504 
1505  case DISPID_GLOBAL_DISPUNK:
1506  V_VT(pvarRes) = VT_UNKNOWN;
1507  V_UNKNOWN(pvarRes) = (IUnknown*)&testObj;
1508  return S_OK;
1509 
1511  VARIANT args[10], v;
1512  DISPPARAMS dp = {args, NULL, ARRAY_SIZE(args), 0};
1513  HRESULT hres;
1514 
1515  CHECK_EXPECT(global_testargtypes_i);
1516  ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
1517  ok(pdp != NULL, "pdp == NULL\n");
1518  ok(pdp->rgvarg != NULL, "rgvarg != NULL\n");
1519  ok(pdp->cArgs == 6, "cArgs = %d\n", pdp->cArgs);
1520  ok(!pvarRes, "pvarRes != NULL\n");
1521 
1522  ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
1523  ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
1524 
1525  ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
1526  ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
1527 
1528  ok(V_VT(pdp->rgvarg+3) == VT_I4, "V_VT(pdp->rgvarg+3) = %d\n", V_VT(pdp->rgvarg+3));
1529  ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %d\n", V_I4(pdp->rgvarg+3));
1530 
1531  ok(V_VT(pdp->rgvarg+4) == VT_I4, "V_VT(pdp->rgvarg+4) = %d\n", V_VT(pdp->rgvarg+4));
1532  ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %d\n", V_I4(pdp->rgvarg+4));
1533 
1534  ok(V_VT(pdp->rgvarg+5) == VT_DISPATCH, "V_VT(pdp->rgvarg+5) = %d\n", V_VT(pdp->rgvarg+5));
1535  ok(V_DISPATCH(pdp->rgvarg+5) == (IDispatch*)&testObj, "V_DISPATCH(pdp->rgvarg+5) != testObj\n");
1536 
1537  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
1538 
1539  V_VT(args) = VT_I2;
1540  V_I2(args) = 2;
1541  V_VT(args+1) = VT_INT;
1542  V_INT(args+1) = 22;
1543  V_VT(args+2) = VT_UNKNOWN;
1544  V_UNKNOWN(args+2) = (IUnknown*)&testObj;
1545  V_VT(args+3) = VT_UNKNOWN;
1546  V_UNKNOWN(args+3) = NULL;
1547  V_VT(args+4) = VT_UI4;
1548  V_UI4(args+4) = 0xffffffff;
1550  V_VARIANTREF(args+5) = &v;
1551  V_VT(args+6) = VT_R4;
1552  V_R4(args+6) = 0.5;
1553  V_VT(args+7) = VT_UI2;
1554  V_UI2(args+7) = 3;
1555  V_VT(args+8) = VT_UI1;
1556  V_UI1(args+8) = 4;
1557  V_VT(args+9) = VT_I1;
1558  V_I1(args+9) = 5;
1559  V_VT(&v) = VT_I4;
1560  V_I4(&v) = 2;
1561  hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
1562  ok(hres == S_OK, "Invoke failed: %08x\n", hres);
1563 
1564  return S_OK;
1565  }
1566 
1567  case DISPID_GLOBAL_CALLEVAL: {
1568  IDispatchEx *eval_func;
1570  VARIANT arg, res;
1571  HRESULT hres;
1572 
1573  CHECK_EXPECT(global_calleval_i);
1574 
1575  ok(pdp != NULL, "pdp == NULL\n");
1576  ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
1577  ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
1578  ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
1579  ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
1580  ok(pvarRes == NULL, "pvarRes != NULL\n");
1581  ok(pei != NULL, "pei == NULL\n");
1582 
1583  ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg));
1584  hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&eval_func);
1585  ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1586 
1587  params.rgvarg = &arg;
1588  params.rgdispidNamedArgs = NULL;
1589  params.cArgs = 1;
1590  params.cNamedArgs = 0;
1591  V_VT(&arg) = VT_BSTR;
1592 
1593  V_BSTR(&arg) = a2bstr("var x = 5; v");
1594  V_VT(&res) = VT_ERROR;
1595  hres = IDispatchEx_InvokeEx(eval_func, DISPID_VALUE, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
1596  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1597  ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
1598  ok(V_I4(&res) == 2, "eval returned %d\n", V_I4(&res));
1600  IDispatchEx_Release(eval_func);
1601  return S_OK;
1602  }
1603  }
1604 
1605  ok(0, "unexpected call %x\n", id);
1606  return DISP_E_MEMBERNOTFOUND;
1607 }
#define DISPID_GLOBAL_PROPARGPUTOP
Definition: run.c:157
static IDispatchEx pureDisp
Definition: run.c:730
#define DISPID_GLOBAL_INVOKEVERSION
Definition: run.c:136
#define DISPID_GLOBAL_TESTPROPGET
Definition: run.c:125
#define DISPID_GLOBAL_GETSCRIPTSTATE
Definition: run.c:153
Definition: compat.h:1947
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISPID_GLOBAL_GETNULLBSTR
Definition: run.c:132
Definition: compat.h:1959
static BOOL testing_expr
Definition: run.c:176
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
#define DISPID_GLOBAL_TESTNORES
Definition: run.c:150
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_I2(A)
Definition: oleauto.h:245
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
void * arg
Definition: msvc.h:12
OLECHAR * BSTR
Definition: compat.h:1942
#define E_FAIL
Definition: ddrawi.h:102
Definition: match.c:390
#define DISPID_GLOBAL_TESTPROPPUT
Definition: run.c:126
#define DISPID_GLOBAL_CALLEVAL
Definition: run.c:156
#define DISPID_GLOBAL_DISPUNK
Definition: run.c:148
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define DISPID_GLOBAL_TRACE
Definition: run.c:128
#define DISPID_GLOBAL_REPORTSUCCESS
Definition: run.c:127
static IActiveScript * script_engine
Definition: run.c:181
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define DISPID_GLOBAL_PROPGETFUNC
Definition: run.c:138
GLenum const GLfloat * params
Definition: glext.h:5645
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1139
static IDispatchEx dispexFunc
Definition: run.c:653
#define E_INVALIDARG
Definition: ddrawi.h:101
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define V_UI2(A)
Definition: oleauto.h:268
#define V_I1(A)
Definition: oleauto.h:243
#define CHECK_EXPECT(func)
Definition: run.c:67
static IDispatchEx bindEventHandlerDisp
Definition: run.c:799
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
#define V_R4(A)
Definition: oleauto.h:260
static IDispatchEx testObj
Definition: run.c:595
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
#define DISPID_GLOBAL_PUREDISP
Definition: run.c:141
LONG HRESULT
Definition: typedefs.h:77
#define V_UI1(A)
Definition: oleauto.h:266
#define V_BOOL(A)
Definition: oleauto.h:224
#define DISPID_GLOBAL_ISWIN64
Definition: run.c:140
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define DISPID_GLOBAL_ISNULLBSTR
Definition: run.c:142
#define V_UI4(A)
Definition: oleauto.h:270
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651
Definition: compat.h:1948
#define IID_NULL
Definition: guiddef.h:98
#define DISPID_GLOBAL_OK
Definition: run.c:129
#define V_VT(A)
Definition: oleauto.h:211
static int state
Definition: maze.c:121
#define V_UNKNOWN(A)
Definition: oleauto.h:281
#define V_BSTR(A)
Definition: oleauto.h:226
#define DISPID_GLOBAL_TESTOBJ
Definition: run.c:131
static IDispatch * script_disp
Definition: run.c:178
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
static const char * test_name
Definition: run.c:177
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:602
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
#define DISPID_GLOBAL_PROPARGPUT
Definition: run.c:143
#define DISPID_GLOBAL_TESTPROPPUTREF
Definition: run.c:152
#define ARRAY_SIZE(a)
Definition: main.h:24
#define ok(value,...)
Definition: atltest.h:57
#define V_INT(x)
Definition: webchild.h:78
SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION enum tagSCRIPTSTATE SCRIPTSTATE
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define DISPID_GLOBAL_GETSHORT
Definition: run.c:145
static BSTR a2bstr(const char *str)
Definition: run.c:207
#define DISPID_GLOBAL_OBJECT_FLAG
Definition: run.c:139
GLuint res
Definition: glext.h:9613
struct stdole::DISPPARAMS DISPPARAMS
#define DISPID_GLOBAL_TESTTHIS
Definition: run.c:134
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define DISPID_GLOBAL_DISPEXFUNC
Definition: run.c:151
#define DISPID_GLOBAL_INTPROP
Definition: run.c:147
#define args
Definition: format.c:66
#define DISPID_GLOBAL_GETVT
Definition: run.c:130
#define DISPID_GLOBAL_TESTARGTYPES
Definition: run.c:146
#define DISPID_GLOBAL_TESTRES
Definition: run.c:149
#define DISPID_GLOBAL_TESTTHIS2
Definition: run.c:135
Definition: compat.h:1949
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1170
Definition: compat.h:1946
#define DISPID_GLOBAL_CREATEARRAY
Definition: run.c:137
static int invoke_version
Definition: run.c:179
#define DISPID_GLOBAL_NULL_DISP
Definition: run.c:133
#define DISPID_GLOBAL_SHORTPROP
Definition: run.c:144
#define DISPID_GLOBAL_BINDEVENTHANDLER
Definition: run.c:154

◆ invoke_procedure()

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

Definition at line 1853 of file run.c.

1854 {
1855  IActiveScriptParseProcedure2 *parse_proc;
1856  IActiveScriptParse *parser;
1857  IActiveScript *engine;
1858  IDispatchEx *dispex;
1859  EXCEPINFO ei = {0};
1860  BSTR source, args;
1861  IDispatch *disp;
1862  VARIANT res;
1863  HRESULT hres;
1864 
1865  engine = create_script();
1866  if(!engine)
1867  return S_OK;
1868 
1869  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1870  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1871 
1873  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1874 
1875  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1876  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1877 
1878  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1879  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1880 
1881  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
1882  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1883 
1884  source = a2bstr(sourcea);
1885  args = argsa ? a2bstr(argsa) : NULL;
1887  SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
1888  ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
1891 
1892  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1893  ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1894  IDispatch_Release(disp);
1895 
1896  V_VT(&res) = VT_EMPTY;
1897  hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, 0, DISPATCH_METHOD, dp, &res, &ei, NULL);
1898  ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1899  ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%x)\n", V_VT(&res), V_I4(&res));
1900  IDispatchEx_Release(dispex);
1901 
1903  IActiveScript_Release(engine);
1905 
1906  return hres;
1907 }
disp
Definition: i386-dis.c:3181
OLECHAR * BSTR
Definition: compat.h:1942
Definition: match.c:390
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define IActiveScriptParseProcedure2_ParseProcedureText
Definition: run.c:46
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
LONG HRESULT
Definition: typedefs.h:77
#define V_BOOL(A)
Definition: oleauto.h:224
#define IActiveScriptParse_Release
Definition: run.c:42
static const WCHAR emptyW[]
Definition: run.c:174
#define V_VT(A)
Definition: oleauto.h:211
static IActiveScript * create_script(void)
Definition: run.c:1786
struct stdole::EXCEPINFO EXCEPINFO
#define S_OK
Definition: intsafe.h:59
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1741
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207
Definition: import.c:86
GLuint res
Definition: glext.h:9613
#define IActiveScriptParseProcedure2_Release
Definition: run.c:45
#define args
Definition: format.c:66

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 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static HINSTANCE hkernel32
Definition: process.c:66
WORD LANGID
Definition: typedefs.h:79
smooth NULL
Definition: ftsmooth.c:416
#define WINAPI
Definition: msvc.h:8
#define LANG_ENGLISH
Definition: nls.h:52
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:821
#define GetProcAddress(x, y)
Definition: compat.h:418
LANGID WINAPI GetUserDefaultLangID(void)
Definition: lang.c:734
#define PRIMARYLANGID(l)
Definition: nls.h:16

Referenced by test_IActiveScriptError().

◆ load_res()

static BSTR load_res ( const char name)
static

Definition at line 2199 of file run.c.

2200 {
2201  const char *data;
2202  DWORD size, len;
2203  BSTR str;
2204  HRSRC src;
2205 
2207  test_name = name;
2208 
2209  src = FindResourceA(NULL, name, (LPCSTR)40);
2210  ok(src != NULL, "Could not find resource %s\n", name);
2211 
2213  data = LoadResource(NULL, src);
2214 
2218 
2219  return str;
2220 }
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
#define CP_ACP
Definition: compat.h:99
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
OLECHAR * BSTR
Definition: compat.h:1942
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
const char * LPCSTR
Definition: xmlstorage.h:183
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static BOOL strict_dispid_check
Definition: run.c:176
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
static const char * test_name
Definition: run.c:177
#define ok(value,...)
Definition: atltest.h:57
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MultiByteToWideChar
Definition: compat.h:100
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

Referenced by run_benchmark(), and run_from_res().

◆ parse_htmlscript()

static HRESULT parse_htmlscript ( BSTR  script_str)
static

Definition at line 1909 of file run.c.

1910 {
1911  IActiveScriptParse *parser;
1912  IActiveScript *engine;
1913  HRESULT hres;
1914  BSTR tmp = a2bstr("</SCRIPT>");
1915 
1916  engine = create_script();
1917  if(!engine)
1918  return E_FAIL;
1919 
1920  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1921  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1922  if (FAILED(hres))
1923  {
1924  IActiveScript_Release(engine);
1925  return E_FAIL;
1926  }
1927 
1929  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1930 
1931  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1932  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1933 
1934  hres = IActiveScript_AddNamedItem(engine, testW,
1935  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
1936  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1937 
1938  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1939  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1940 
1941  hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, tmp, 0, 0, 0, NULL, NULL);
1942 
1943  IActiveScript_Release(engine);
1945  SysFreeString(tmp);
1946 
1947  return hres;
1948 }
OLECHAR * BSTR
Definition: compat.h:1942
#define E_FAIL
Definition: ddrawi.h:102
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
LONG HRESULT
Definition: typedefs.h:77
#define IActiveScriptParse_Release
Definition: run.c:42
static const WCHAR testW[]
Definition: run.c:170
static IActiveScript * create_script(void)
Definition: run.c:1786
#define S_OK
Definition: intsafe.h:59
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1741
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
Definition: import.c:86

Referenced by parse_htmlscript_a().

◆ parse_htmlscript_a()

static HRESULT parse_htmlscript_a ( const char src)
static

Definition at line 2136 of file run.c.

2137 {
2138  HRESULT hres;
2139  BSTR tmp = a2bstr(src);
2140  hres = parse_htmlscript(tmp);
2141  SysFreeString(tmp);
2142 
2143  return hres;
2144 }
OLECHAR * BSTR
Definition: compat.h:1942
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum src
Definition: glext.h:6340
static HRESULT parse_htmlscript(BSTR script_str)
Definition: run.c:1909
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207

Referenced by run_tests().

◆ parse_script()

static HRESULT parse_script ( DWORD  flags,
BSTR  script_str 
)
static

Definition at line 1808 of file run.c.

1809 {
1810  IActiveScriptParse *parser;
1811  IActiveScript *engine;
1812  HRESULT hres;
1813 
1814  engine = create_script();
1815  if(!engine)
1816  return S_OK;
1817 
1818  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
1819  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
1820  if (FAILED(hres))
1821  {
1822  IActiveScript_Release(engine);
1823  return hres;
1824  }
1825 
1827  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
1828 
1829  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
1830  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
1831 
1832  hres = IActiveScript_AddNamedItem(engine, testW,
1833  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
1834  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
1835 
1836  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
1837  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
1838 
1839  hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
1840  ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
1841  ok(script_disp != NULL, "script_disp == NULL\n");
1842  ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
1843 
1844  hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
1845 
1846  IDispatch_Release(script_disp);
1847  IActiveScript_Release(engine);
1849 
1850  return hres;
1851 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
LONG HRESULT
Definition: typedefs.h:77
#define IActiveScriptParse_Release
Definition: run.c:42
GLbitfield flags
Definition: glext.h:7161
static IDispatchEx Global
Definition: run.c:1646
static const WCHAR testW[]
Definition: run.c:170
static IActiveScript * create_script(void)
Definition: run.c:1786
static IDispatch * script_disp
Definition: run.c:178
#define S_OK
Definition: intsafe.h:59
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1741
#define ok(value,...)
Definition: atltest.h:57
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
Definition: import.c:86

Referenced by check_jscript(), parse_script_ae(), parse_script_af(), 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 2103 of file run.c.

2104 {
2105  parse_script_af(SCRIPTITEM_GLOBALMEMBERS, src);
2106 }
static void parse_script_af(DWORD flags, const char *src)
Definition: run.c:2092
GLenum src
Definition: glext.h:6340

Referenced by run_encoded_tests(), and run_tests().

◆ parse_script_ae()

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

Definition at line 2108 of file run.c.

2109 {
2110  BSTR tmp;
2111  HRESULT hres;
2112 
2113  tmp = a2bstr(src);
2114  hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, tmp);
2115  SysFreeString(tmp);
2116  ok(hres == exhres, "parse_script failed: %08x, expected %08x\n", hres, exhres);
2117 }
OLECHAR * BSTR
Definition: compat.h:1942
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum src
Definition: glext.h:6340
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207
static HRESULT parse_script(DWORD flags, BSTR script_str)
Definition: run.c:1808

Referenced by run_tests().

◆ parse_script_af()

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

Definition at line 2092 of file run.c.

2093 {
2094  BSTR tmp;
2095  HRESULT hres;
2096 
2097  tmp = a2bstr(src);
2098  hres = parse_script(flags, tmp);
2099  SysFreeString(tmp);
2100  ok(hres == S_OK, "parse_script failed: %08x\n", hres);
2101 }
OLECHAR * BSTR
Definition: compat.h:1942
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
GLenum src
Definition: glext.h:6340
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207
static HRESULT parse_script(DWORD flags, BSTR script_str)
Definition: run.c:1808

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

2377 {
2378  IActiveScriptParse *parser;
2379  IActiveScript *engine;
2380  BSTR str;
2381  HRESULT hres;
2382 
2383  engine = create_script();
2384  if(!engine)
2385  return E_FAIL;
2386 
2387  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2388  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2389 
2391  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2392 
2393  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
2394  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2395 
2396  SET_EXPECT(GetItemInfo_testVal);
2397  hres = IActiveScript_AddNamedItem(engine, test_valW,
2398  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
2399  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2400  CHECK_CALLED(GetItemInfo_testVal);
2401 
2402  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2403  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2404 
2405  str = a2bstr(expr);
2406  hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, res, NULL);
2407  SysFreeString(str);
2408 
2410 
2411  if(engine_ret) {
2412  *engine_ret = engine;
2413  }else {
2414  IActiveScript_Close(engine);
2415  IActiveScript_Release(engine);
2416  }
2417  return hres;
2418 }
#define CHECK_CALLED(func)
Definition: run.c:73
static const WCHAR test_valW[]
Definition: run.c:172
OLECHAR * BSTR
Definition: compat.h:1942
#define E_FAIL
Definition: ddrawi.h:102
Definition: query.h:86
#define SET_EXPECT(func)
Definition: run.c:58
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
LONG HRESULT
Definition: typedefs.h:77
#define IActiveScriptParse_Release
Definition: run.c:42
static IActiveScript * create_script(void)
Definition: run.c:1786
#define S_OK
Definition: intsafe.h:59
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1741
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
Definition: import.c:86
GLuint res
Definition: glext.h:9613

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

2039 {
2040  IActiveScriptParse *parser;
2041  IActiveScript *engine;
2042  HRESULT hres;
2043 
2044  engine = create_script();
2045  if(!engine)
2046  return;
2047 
2048  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
2049  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
2050  if (FAILED(hres))
2051  {
2052  IActiveScript_Release(engine);
2053  return;
2054  }
2055 
2057  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
2058 
2059  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite_CheckError);
2060  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
2061 
2062  hres = IActiveScript_AddNamedItem(engine, testW,
2063  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
2064  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
2065 
2066  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
2067  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
2068 
2069  hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
2070  ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
2071  ok(script_disp != NULL, "script_disp == NULL\n");
2072  ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
2073 
2074  script_error = NULL;
2076  hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
2077  todo_wine ok(hres == 0x80020101, "parse_script_with_error should have returned 0x80020101, got: 0x%08x\n", hres);
2079 
2080  if (script_error)
2081  {
2082  test_IActiveScriptError(script_error, errorcode, line, pos, script_source, description, line_text);
2083 
2084  IActiveScriptError_Release(script_error);
2085  }
2086 
2087  IDispatch_Release(script_disp);
2088  IActiveScript_Release(engine);
2090 }
#define CHECK_CALLED(func)
Definition: run.c:73
static void test_IActiveScriptError(IActiveScriptError *error, SCODE errorcode, ULONG line, LONG pos, BSTR script_source, BSTR description, BSTR line_text)
Definition: run.c:1950
static IActiveScriptError * script_error
Definition: run.c:180
const char * description
Definition: directx.c:2497
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
Definition: run.c:1710
#define SET_EXPECT(func)
Definition: run.c:58
smooth NULL
Definition: ftsmooth.c:416
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
LONG HRESULT
Definition: typedefs.h:77
#define IActiveScriptParse_Release
Definition: run.c:42
GLbitfield flags
Definition: glext.h:7161
static IDispatchEx Global
Definition: run.c:1646
static IActiveScriptSite ActiveScriptSite_CheckError
Definition: run.c:1769
#define todo_wine
Definition: test.h:154
static const WCHAR testW[]
Definition: run.c:170
static IActiveScript * create_script(void)
Definition: run.c:1786
static IDispatch * script_disp
Definition: run.c:178
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
Definition: import.c:86

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

2120 {
2121  BSTR tmp, script_source, description, line_text;
2122 
2123  tmp = a2bstr(src);
2124  script_source = a2bstr(source);
2125  description = a2bstr(desc);
2126  line_text = a2bstr(linetext);
2127 
2128  parse_script_with_error(SCRIPTITEM_GLOBALMEMBERS, tmp, errorcode, line, pos, script_source, description, line_text);
2129 
2130  SysFreeString(line_text);
2132  SysFreeString(script_source);
2133  SysFreeString(tmp);
2134 }
OLECHAR * BSTR
Definition: compat.h:1942
const char * description
Definition: directx.c:2497
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:2038
static const WCHAR desc[]
Definition: protectdata.c:36
Definition: parser.c:48
GLenum src
Definition: glext.h:6340
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static BSTR a2bstr(const char *str)
Definition: run.c:207

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 DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
REFIID riid
Definition: precomp.h:44
#define CHECK_EXPECT(func)
Definition: run.c:67
#define IID_NULL
Definition: guiddef.h:98
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#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 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
REFIID riid
Definition: precomp.h:44
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
#define CHECK_EXPECT(func)
Definition: run.c:67
#define V_BOOL(A)
Definition: oleauto.h:224
#define IID_NULL
Definition: guiddef.h:98
#define todo_wine
Definition: test.h:154
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
GLuint res
Definition: glext.h:9613

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

◆ run_benchmark()

static void run_benchmark ( const char script_name)
static

Definition at line 3247 of file run.c.

3248 {
3249  IActiveScriptParse *parser;
3250  IActiveScript *engine;
3251  ULONG start, end;
3252  BSTR src;
3253  HRESULT hres;
3254 
3255  engine = create_script();
3256  if(!engine)
3257  return;
3258 
3259  hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
3260  ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
3261  if (FAILED(hres)) {
3262  IActiveScript_Release(engine);
3263  return;
3264  }
3265 
3267  ok(hres == S_OK, "InitNew failed: %08x\n", hres);
3268 
3269  hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
3270  ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
3271 
3272  hres = IActiveScript_AddNamedItem(engine, testW,
3273  SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE);
3274  ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
3275 
3276  hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
3277  ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
3278 
3280 
3281  start = GetTickCount();
3283  end = GetTickCount();
3284  ok(hres == S_OK, "%s: ParseScriptText failed: %08x\n", script_name, hres);
3285 
3286  trace("%s ran in %u ms\n", script_name, end-start);
3287 
3288  IActiveScript_Release(engine);
3290  SysFreeString(src);
3291 }
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:445
GLuint GLuint end
Definition: gl.h:1545
OLECHAR * BSTR
Definition: compat.h:1942
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
#define IActiveScriptParse_InitNew
Definition: run.c:43
#define trace
Definition: atltest.h:70
LONG HRESULT
Definition: typedefs.h:77
#define IActiveScriptParse_Release
Definition: run.c:42
static const WCHAR testW[]
Definition: run.c:170
GLenum src
Definition: glext.h:6340
static IActiveScript * create_script(void)
Definition: run.c:1786
#define S_OK
Definition: intsafe.h:59
GLuint start
Definition: gl.h:1545
static IActiveScriptSite ActiveScriptSite
Definition: run.c:1741
static BSTR load_res(const char *name)
Definition: run.c:2199
#define ok(value,...)
Definition: atltest.h:57
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
#define IActiveScriptParse_ParseScriptText
Definition: run.c:44
Definition: import.c:86
unsigned int ULONG
Definition: retypes.h:1
static const char * script_name
Definition: run.c:74

Referenced by run_benchmarks().

◆ run_benchmarks()

static void run_benchmarks ( void  )
static

Definition at line 3293 of file run.c.

3294 {
3295  trace("Running benchmarks...\n");
3296 
3297  run_benchmark("dna.js");
3298  run_benchmark("base64.js");
3299  run_benchmark("validateinput.js");
3300 }
static void run_benchmark(const char *script_name)
Definition: run.c:3247
#define trace
Definition: atltest.h:70

Referenced by START_TEST().

◆ run_bom_tests()

static void run_bom_tests ( void  )
static

Definition at line 2710 of file run.c.

2711 {
2712  BSTR src;
2713  int i;
2714  HRESULT hres;
2715  struct bom_test bom_tests[] = {
2716  {{'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2717  {{0xFEFF,'v','a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u','c','c','e','s','s','(',')',';','\0'}, S_OK},
2718  {{'v',0xFEFF,'a','r',' ','a',' ','=',' ','1',';',' ','r','e','p','o','r','t','S','u'