33#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
34#define IActiveScriptParse_Release IActiveScriptParse64_Release
35#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
36#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
40#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
41#define IActiveScriptParse_Release IActiveScriptParse32_Release
42#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
43#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
48 {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
50#define DEFINE_EXPECT(func) \
51 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
53#define SET_EXPECT(func) \
54 expect_ ## func = TRUE
56#define CHECK_EXPECT2(func) \
58 ok(expect_ ##func, "unexpected call " #func "\n"); \
59 called_ ## func = TRUE; \
62#define CHECK_EXPECT(func) \
64 CHECK_EXPECT2(func); \
65 expect_ ## func = FALSE; \
68#define CHECK_CALLED(func) \
70 ok(called_ ## func, "expected " #func "\n"); \
71 expect_ ## func = called_ ## func = FALSE; \
81#define DISPID_TEST_TESTARGCONV 0x1000
110#define call_change_type(a,b,c,d) _call_change_type(__LINE__,a,b,c,d)
121#define change_type_fail(a,b,c,d) _change_type_fail(__LINE__,a,b,c,d)
129 ok_(__FILE__,
line)(
hres == exhres,
"ChangeType failed: %08x, expected %08x\n",
hres, exhres);
137 ok(
V_I4(&
v) ==
ex->int_result,
"V_I4(v) = %d, expected %d\n",
V_I4(&
v),
ex->int_result);
147 ok(
V_BOOL(&
v) ==
ex->bool_result,
"V_BOOL(v) = %x, expected %x\n",
V_BOOL(&
v),
ex->bool_result);
149 if(
ex->test_double) {
151 ok(
V_R8(&
v) ==
ex->double_result,
"V_R8(v) = %lf, expected %lf\n",
V_R8(&
v),
ex->double_result);
154 ok(
V_R4(&
v) == (
float)
ex->double_result,
"V_R4(v) = %f, expected %f\n",
V_R4(&
v), (
float)
ex->double_result);
178 {0,
"false", VARIANT_FALSE, 1,0.0},
179 {1,
"true", VARIANT_TRUE, 1,1.0}};
181 {0,
"0", VARIANT_FALSE, 1,0.0},
182 {-100,
"-100", VARIANT_TRUE, 1,-100.0},
183 {0x10010,
"65552", VARIANT_TRUE, 1,65552.0}};
185 {0,
"undefined", VARIANT_FALSE, 0,0};
187 {0,
"null", VARIANT_FALSE, 0,0};
189 {10,
"strval", VARIANT_TRUE, 1,10.0};
237 hres = IServiceProvider_QueryService(caller, &SID_VariantConversion, &IID_IVariantChangeType, (
void**)&
change_type);
238 ok(
hres ==
S_OK,
"Could not get SID_VariantConversion service: %08x\n",
hres);
253 ok(0,
"Unexpected IID_IObjectSafety query\n");
274 ok(0,
"unexpected call\n");
281 ok(0,
"unexpected call\n");
289 ok(0,
"unexpected call\n");
295 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
297 ok(0,
"unexpected call\n");
309 ok(0,
"unexpected call\n");
315 ok(0,
"unexpected call\n");
321 ok(0,
"unexpected call\n");
327 ok(0,
"unexpected call\n");
333 ok(0,
"unexpected call\n");
339 if(!
strcmp_wa(bstrName,
"testArgConv")) {
340 ok(grfdex == fdexNameCaseSensitive,
"grfdex = %x\n", grfdex);
351 ok(pspCaller !=
NULL,
"pspCaller == NULL\n");
358 ok(pdp !=
NULL,
"pdp == NULL\n");
359 ok(!pdp->rgdispidNamedArgs,
"rgdispidNamedArgs != NULL\n");
360 ok(!pvarRes,
"pvarRes != NULL\n");
361 ok(pei !=
NULL,
"pei == NULL\n");
363 ok(pdp->cArgs == 1,
"cArgs = %d\n", pdp->cArgs);
373 ok(0,
"unexpected call\n");
434 ok(dwReturnMask == SCRIPTINFO_IUNKNOWN,
"unexpected dwReturnMask %x\n", dwReturnMask);
435 ok(!ppti,
"ppti != NULL\n");
448 const VARIANT *pvarResult,
const EXCEPINFO *pexcepinfo)
489#define parse_script_a(p,s) _parse_script_a(__LINE__,p,s)
503 IActiveScriptParse *
parser;
508 &IID_IActiveScript, (
void**)&
script);
512 hres = IActiveScript_QueryInterface(
script, &IID_IActiveScriptParse, (
void**)&
parser);
513 ok(
hres ==
S_OK,
"Could not get IActiveScriptParse: %08x\n",
hres);
522 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
526 ok(
hres ==
S_OK,
"SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n",
hres);
528 IActiveScript_Release(
script);
535 IActiveScriptParse *
parser;
541 ok(
hres ==
S_OK,
"Could not get IVariantChangeType iface: %08x\n",
hres);
546 " toString: function() { return 'strval'; },"
547 " valueOf: function() { return 10; }"
549 "testArgConv(obj);");
562 IActiveScriptParse *
parser;
570 str =
a2bstr(
"if(!('localeCompare' in String.prototype)) throw 1;");
578 IActiveScriptProperty_Release(script_prop);
590 win_skip(
"Broken (too old) jscript\n");
enum tagSCRIPTSTATE SCRIPTSTATE
static BOOL check_jscript(void)
static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface)
static IVariantChangeType * script_change_type
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface)
static void test_change_type(IVariantChangeType *change_type, VARIANT *src, const conv_results_t *ex)
static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
#define parse_script_a(p, s)
static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
static void test_caller(IServiceProvider *caller, IDispatch *arg_obj)
#define call_change_type(a, b, c, d)
static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
static const WCHAR testW[]
static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static const CLSID CLSID_JScript
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
static void run_scripts(void)
static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const char *script)
#define CHECK_EXPECT(func)
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion)
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
#define DEFINE_EXPECT(func)
static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
#define IActiveScriptParse_InitNew
#define IActiveScriptParse_ParseScriptText
static IActiveScriptParse * create_script(void)
#define IActiveScriptParse_Release
static BSTR a2bstr(const char *str)
#define change_type_fail(a, b, c, d)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_disp)
static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
#define IActiveScriptParse_QueryInterface
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface)
static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
static void _change_type_fail(unsigned line, IVariantChangeType *change_type, VARIANT *src, VARTYPE vt, HRESULT exhres)
#define CHECK_CALLED(func)
static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface)
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
static void _call_change_type(unsigned line, IVariantChangeType *change_type, VARIANT *dst, VARIANT *src, VARTYPE vt)
static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
#define DISPID_TEST_TESTARGCONV
static IDispatch * stored_obj
static IDispatchEx testObj
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid)
static IActiveScriptSite ActiveScriptSite
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
static IDispatchExVtbl testObjVtbl
static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
#define WideCharToMultiByte
#define MultiByteToWideChar
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
LCID WINAPI GetUserDefaultLCID(void)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const char * strw(LPCWSTR x)
static VARIANTARG static DISPID
static HRESULT change_type(VARIANT *dst, VARIANT *src, VARTYPE vt, IServiceProvider *caller)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IsEqualGUID(rguid1, rguid2)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
void WINAPI VariantInit(VARIANTARG *pVarg)
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define DISP_E_BADVARTYPE