Commit 030a6860 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

jscript/tests: Enable compilation with long types.

parent 964a6e99
EXTRADEFS = -DWINE_NO_LONG_TYPES
TESTDLL = jscript.dll
IMPORTS = oleaut32 ole32 advapi32
......
......@@ -140,7 +140,7 @@ static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *p
ok(pUnkSite != NULL, "pUnkSite == NULL\n");
hres = IUnknown_QueryInterface(pUnkSite, &IID_IServiceProvider, (void**)&sp);
ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres);
IServiceProvider_Release(sp);
return SetSite_hres;
......@@ -223,7 +223,7 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
{
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex);
return E_NOTIMPL;
}
......@@ -260,7 +260,7 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown
static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
if(!lstrcmpW(bstrName, L"reportSuccess")) {
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex);
*pid = DISPID_TEST_REPORTSUCCESS;
return S_OK;
}
......@@ -316,7 +316,7 @@ static IDispatchEx testObj = { &testObjVtbl };
static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
if(!lstrcmpW(bstrName, L"ok")) {
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex);
*pid = DISPID_GLOBAL_OK;
return S_OK;
}
......@@ -449,14 +449,14 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
{
CHECK_EXPECT(ProcessUrlAction);
ok(dwAction == URLACTION_ACTIVEX_RUN, "dwAction = %x\n", dwAction);
ok(dwAction == URLACTION_ACTIVEX_RUN, "dwAction = %lx\n", dwAction);
ok(pPolicy != NULL, "pPolicy == NULL\n");
ok(cbPolicy == sizeof(DWORD), "cbPolicy = %d\n", cbPolicy);
ok(cbPolicy == sizeof(DWORD), "cbPolicy = %ld\n", cbPolicy);
ok(pContext != NULL, "pContext == NULL\n");
ok(cbContext == sizeof(GUID), "cbContext = %d\n", cbContext);
ok(cbContext == sizeof(GUID), "cbContext = %ld\n", cbContext);
ok(IsEqualGUID(pContext, &CLSID_TestObj), "pContext = %s\n", wine_dbgstr_guid((const IID*)pContext));
ok(!dwFlags, "dwFlags = %x\n", dwFlags);
ok(!dwReserved, "dwReserved = %x\n", dwReserved);
ok(!dwFlags, "dwFlags = %lx\n", dwFlags);
ok(!dwReserved, "dwReserved = %lx\n", dwReserved);
if(SUCCEEDED(ProcessUrlAction_hres))
*(DWORD*)pPolicy = ProcessUrlAction_policy;
......@@ -476,12 +476,12 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
ok(ppPolicy != NULL, "ppPolicy == NULL\n");
ok(pcbPolicy != NULL, "pcbPolicy == NULL\n");
ok(pContext != NULL, "pContext == NULL\n");
ok(cbContext == sizeof(struct CONFIRMSAFETY), "cbContext = %d\n", cbContext);
ok(!dwReserved, "dwReserved = %x\n", dwReserved);
ok(cbContext == sizeof(struct CONFIRMSAFETY), "cbContext = %ld\n", cbContext);
ok(!dwReserved, "dwReserved = %lx\n", dwReserved);
/* TODO: CLSID */
ok(cs->pUnk != NULL, "cs->pUnk == NULL\n");
ok(!cs->dwFlags, "dwFlags = %x\n", cs->dwFlags);
ok(!cs->dwFlags, "dwFlags = %lx\n", cs->dwFlags);
if(FAILED(QueryCustomPolicy_hres))
return QueryCustomPolicy_hres;
......@@ -592,7 +592,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName,
DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
{
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask);
ok(!ppti, "ppti != NULL\n");
ok(!lstrcmpW(pstrName, L"test"), "pstrName = %s\n", wine_dbgstr_w(pstrName));
......@@ -656,7 +656,7 @@ static void set_safety_options(IUnknown *unk, BOOL use_sec_mgr)
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety);
ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres);
ok(hres == S_OK, "Could not get IObjectSafety: %08lx\n", hres);
if(FAILED(hres))
return;
......@@ -667,13 +667,13 @@ static void set_safety_options(IUnknown *unk, BOOL use_sec_mgr)
options_set = INTERFACE_USES_DISPEX;
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, options_all, options_set);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(supported == options_all, "supported=%x, expected %x\n", supported, options_all);
ok(enabled == options_set, "enabled=%x, expected %x\n", enabled, options_set);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == options_all, "supported=%lx, expected %lx\n", supported, options_all);
ok(enabled == options_set, "enabled=%lx, expected %lx\n", enabled, options_set);
IObjectSafety_Release(safety);
}
......@@ -684,7 +684,7 @@ static void _parse_script(unsigned line, IActiveScriptParse *parser, const WCHAR
HRESULT hres;
hres = IActiveScriptParse_ParseScriptText(parser, script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
}
static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr)
......@@ -707,7 +707,7 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr)
hres = CoCreateInstance(&CLSID_JScript, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IActiveScript, (void**)&script);
if(!skip_tests)
ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
if(FAILED(hres))
return NULL;
......@@ -715,20 +715,20 @@ static IActiveScriptParse *create_script(BOOL skip_tests, BOOL use_sec_mgr)
set_safety_options((IUnknown*)script, use_sec_mgr);
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(script, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScript_Release(script);
......@@ -757,16 +757,16 @@ static IDispatchEx *parse_procedure(IActiveScriptParse *parser, const WCHAR *src
HRESULT hres;
hres = IActiveScriptParse_QueryInterface(parser, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParseProcedure2: %08lx\n", hres);
hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, src, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, &disp);
IActiveScriptParseProcedure2_Release(parse_proc);
ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
ok(hres == S_OK, "ParseProcedureText failed: %08lx\n", hres);
ok(disp != NULL, "disp == NULL\n");
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
IDispatch_Release(disp);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
return dispex;
}
......@@ -779,7 +779,7 @@ static void _call_procedure(unsigned line, IDispatchEx *proc, IServiceProvider *
HRESULT hres;
hres = IDispatchEx_InvokeEx(proc, DISPID_VALUE, 0, DISPATCH_METHOD, &dp, NULL, &ei, caller);
ok_(__FILE__,line)(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok_(__FILE__,line)(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
}
......@@ -1080,7 +1080,7 @@ static BOOL register_activex(void)
hres = CoRegisterClassObject(&CLSID_TestObj, (IUnknown *)&activex_cf,
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &regid);
ok(hres == S_OK, "Could not register script engine: %08x\n", hres);
ok(hres == S_OK, "Could not register script engine: %08lx\n", hres);
return TRUE;
}
......
......@@ -102,7 +102,7 @@ static void _call_change_type(unsigned line, IVariantChangeType *change_type, VA
SET_EXPECT(OnLeaveScript);
}
hres = IVariantChangeType_ChangeType(change_type, dst, src, 0, vt);
ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08x\n", vt, hres);
ok_(__FILE__,line)(hres == S_OK, "ChangeType(%d) failed: %08lx\n", vt, hres);
ok_(__FILE__,line)(V_VT(dst) == vt, "V_VT(dst) = %d\n", V_VT(dst));
if(V_VT(src) == VT_DISPATCH && vt != VT_BOOL) {
CHECK_CALLED(OnEnterScript);
......@@ -118,7 +118,7 @@ static void _change_type_fail(unsigned line, IVariantChangeType *change_type, VA
V_VT(&v) = VT_EMPTY;
hres = IVariantChangeType_ChangeType(change_type, &v, src, 0, vt);
ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08x, expected %08x\n", hres, exhres);
ok_(__FILE__,line)(hres == exhres, "ChangeType failed: %08lx, expected %08lx\n", hres, exhres);
}
static void test_change_type(IVariantChangeType *change_type, VARIANT *src, const conv_results_t *ex)
......@@ -126,7 +126,7 @@ static void test_change_type(IVariantChangeType *change_type, VARIANT *src, cons
VARIANT v;
call_change_type(change_type, &v, src, VT_I4);
ok(V_I4(&v) == ex->int_result, "V_I4(v) = %d, expected %d\n", V_I4(&v), ex->int_result);
ok(V_I4(&v) == ex->int_result, "V_I4(v) = %ld, expected %d\n", V_I4(&v), ex->int_result);
call_change_type(change_type, &v, src, VT_UI2);
ok(V_UI2(&v) == (UINT16)ex->int_result, "V_UI2(v) = %u, expected %u\n", V_UI2(&v), (UINT16)ex->int_result);
......@@ -208,14 +208,14 @@ static void test_change_types(IVariantChangeType *change_type, IDispatch *obj_di
V_BOOL(&v) = VARIANT_FALSE;
V_VT(&dst) = 0xdead;
hres = IVariantChangeType_ChangeType(change_type, &dst, &v, 0, VT_I4);
ok(hres == DISP_E_BADVARTYPE, "ChangeType failed: %08x, expected DISP_E_BADVARTYPE\n", hres);
ok(hres == DISP_E_BADVARTYPE, "ChangeType failed: %08lx, expected DISP_E_BADVARTYPE\n", hres);
ok(V_VT(&dst) == 0xdead, "V_VT(dst) = %d\n", V_VT(&dst));
/* Test conversion in place */
V_VT(&v) = VT_BSTR;
V_BSTR(&v) = str = SysAllocString(L"test");
hres = IVariantChangeType_ChangeType(change_type, &v, &v, 0, VT_BSTR);
ok(hres == S_OK, "ChangeType failed: %08x\n", hres);
ok(hres == S_OK, "ChangeType failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BSTR(&v) != str, "V_BSTR(v) == str\n");
ok(!lstrcmpW(V_BSTR(&v), L"test"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
......@@ -228,7 +228,7 @@ static void test_caller(IServiceProvider *caller, IDispatch *arg_obj)
HRESULT hres;
hres = IServiceProvider_QueryService(caller, &SID_VariantConversion, &IID_IVariantChangeType, (void**)&change_type);
ok(hres == S_OK, "Could not get SID_VariantConversion service: %08x\n", hres);
ok(hres == S_OK, "Could not get SID_VariantConversion service: %08lx\n", hres);
ok(change_type == script_change_type, "change_type != script_change_type\n");
test_change_types(change_type, arg_obj);
......@@ -291,7 +291,7 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
{
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex);
return E_NOTIMPL;
}
......@@ -328,7 +328,7 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown
static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
{
if(!lstrcmpW(bstrName, L"testArgConv")) {
ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
ok(grfdex == fdexNameCaseSensitive, "grfdex = %lx\n", grfdex);
*pid = DISPID_TEST_TESTARGCONV;
return S_OK;
}
......@@ -424,7 +424,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName,
DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
{
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask);
ok(!ppti, "ppti != NULL\n");
ok(!lstrcmpW(pstrName, L"test"), "pstrName = %s\n", wine_dbgstr_w(pstrName));
......@@ -487,7 +487,7 @@ static void _parse_script(unsigned line, IActiveScriptParse *parser, const WCHAR
HRESULT hres;
hres = IActiveScriptParse_ParseScriptText(parser, script, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok_(__FILE__,line)(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
}
static IActiveScriptParse *create_script(void)
......@@ -502,20 +502,20 @@ static IActiveScriptParse *create_script(void)
return NULL;
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(script, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScript_Release(script);
......@@ -530,7 +530,7 @@ static void run_scripts(void)
parser = create_script();
hres = IActiveScriptParse_QueryInterface(parser, &IID_IVariantChangeType, (void**)&script_change_type);
ok(hres == S_OK, "Could not get IVariantChangeType iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IVariantChangeType iface: %08lx\n", hres);
SET_EXPECT(OnEnterScript); /* checked in callback */
SET_EXPECT(testArgConv);
......
......@@ -123,7 +123,7 @@ static void _test_state(unsigned line, IActiveScript *script, SCRIPTSTATE exstat
HRESULT hres;
hres = IActiveScript_GetScriptState(script, &state);
ok_(__FILE__,line) (hres == S_OK, "GetScriptState failed: %08x\n", hres);
ok_(__FILE__,line) (hres == S_OK, "GetScriptState failed: %08lx\n", hres);
ok_(__FILE__,line) (state == exstate, "state=%d, expected %d\n", state, exstate);
}
......@@ -241,7 +241,7 @@ static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID id, REFIID riid,
DISPPARAMS *dp, VARIANT *res, EXCEPINFO *ei, UINT *err)
{
CHECK_EXPECT(testCall);
ok(id == 1, "id = %u\n", id);
ok(id == 1, "id = %lu\n", id);
ok(flags == DISPATCH_METHOD, "flags = %x\n", flags);
ok(!dp->cArgs, "cArgs = %u\n", dp->cArgs);
ok(!res, "res = %p\n", res);
......@@ -342,7 +342,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName,
DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
{
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "dwReturnMask = %x\n", dwReturnMask);
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "dwReturnMask = %lx\n", dwReturnMask);
if(!wcscmp(pstrName, L"globalItem")) {
CHECK_EXPECT(GetItemInfo_global);
IDispatch_AddRef(&global_named_item);
......@@ -464,16 +464,16 @@ static void test_script_dispatch(IDispatchEx *dispex)
str = SysAllocString(L"ActiveXObject");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
str = SysAllocString(L"Math");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
memset(&ei, 0, sizeof(ei));
hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n");
VariantClear(&v);
......@@ -481,11 +481,11 @@ static void test_script_dispatch(IDispatchEx *dispex)
str = SysAllocString(L"String");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
memset(&ei, 0, sizeof(ei));
hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
ok(V_DISPATCH(&v) != NULL, "V_DISPATCH(v) = NULL\n");
VariantClear(&v);
......@@ -499,11 +499,11 @@ static IDispatchEx *get_script_dispatch(IActiveScript *script, const WCHAR *item
disp = (void*)0xdeadbeef;
hres = IActiveScript_GetScriptDispatch(script, item_name, &disp);
ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
IDispatch_Release(disp);
ok(hres == S_OK, "Could not get IDispatch iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatch iface: %08lx\n", hres);
return dispex;
}
......@@ -515,7 +515,7 @@ static void parse_script(IActiveScriptParse *parser, const WCHAR *src)
SET_EXPECT(OnLeaveScript);
hres = IActiveScriptParse_ParseScriptText(parser, src, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -530,12 +530,12 @@ static void _get_disp_id(unsigned line, IDispatchEx *dispex, const WCHAR *name,
str = SysAllocString(name);
hr = IDispatchEx_GetDispID(dispex, str, 0, id);
ok_(__FILE__,line)(hr == exhr, "GetDispID(%s) returned %08x, expected %08x\n",
ok_(__FILE__,line)(hr == exhr, "GetDispID(%s) returned %08lx, expected %08lx\n",
wine_dbgstr_w(name), hr, exhr);
hr = IDispatchEx_GetIDsOfNames(dispex, &IID_NULL, &str, 1, 0, &id2);
SysFreeString(str);
ok_(__FILE__,line)(hr == exhr, "GetIDsOfNames(%s) returned %08x, expected %08x\n",
ok_(__FILE__,line)(hr == exhr, "GetIDsOfNames(%s) returned %08lx, expected %08lx\n",
wine_dbgstr_w(name), hr, exhr);
ok_(__FILE__,line)(*id == id2, "GetIDsOfNames(%s) id != id2\n", wine_dbgstr_w(name));
}
......@@ -547,7 +547,7 @@ static void test_no_script_dispatch(IActiveScript *script)
disp = (void*)0xdeadbeef;
hres = IActiveScript_GetScriptDispatch(script, NULL, &disp);
ok(hres == E_UNEXPECTED, "hres = %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "hres = %08lx, expected E_UNEXPECTED\n", hres);
ok(!disp, "disp != NULL\n");
}
......@@ -558,86 +558,86 @@ static void test_safety(IUnknown *unk)
HRESULT hres;
hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (void**)&safety);
ok(hres == S_OK, "Could not get IObjectSafety: %08x\n", hres);
ok(hres == S_OK, "Could not get IObjectSafety: %08lx\n", hres);
if(FAILED(hres))
return;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, NULL);
ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres);
ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08lx, expected E_POINTER\n", hres);
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, NULL, &enabled);
ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08x, expected E_POINTER\n", hres);
ok(hres == E_POINTER, "GetInterfaceSafetyOptions failed: %08lx, expected E_POINTER\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_NULL, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScript, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER
|INTERFACESAFE_FOR_UNTRUSTED_CALLER,
INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER);
ok(hres == E_FAIL, "SetInterfaceSafetyOptions failed: %08x, expected E_FAIL\n", hres);
ok(hres == E_FAIL, "SetInterfaceSafetyOptions failed: %08lx, expected E_FAIL\n", hres);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER,
INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
"supported=%lx\n", supported);
ok(enabled == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"enabled=%x\n", enabled);
"enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, INTERFACESAFE_FOR_UNTRUSTED_DATA, 0);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == (INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == (INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER), "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER, 0);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse,
INTERFACE_USES_DISPEX, 0);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "SetInterfaceSafetyOptions failed: %08lx\n", hres);
supported = enabled = 0xdeadbeef;
hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &enabled);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08x\n", hres);
ok(hres == S_OK, "GetInterfaceSafetyOptions failed: %08lx\n", hres);
ok(supported == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
"supported=%x\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%x\n", enabled);
"supported=%lx\n", supported);
ok(enabled == INTERFACE_USES_DISPEX, "enabled=%lx\n", enabled);
IObjectSafety_Release(safety);
}
......@@ -649,7 +649,7 @@ static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *v
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty,
(void**)&script_prop);
ok(hres == S_OK, "Could not get IActiveScriptProperty: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptProperty: %08lx\n", hres);
if(FAILED(hres))
return hres;
......@@ -669,22 +669,22 @@ static void test_invoke_versioning(IActiveScript *script)
win_skip("SCRIPTPROP_INVOKESTRING not supported\n");
return;
}
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I2;
V_I2(&v) = 0;
hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I4;
V_I4(&v) = 16;
hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
ok(hres == E_INVALIDARG, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
V_VT(&v) = VT_I4;
V_I4(&v) = 2;
hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
ok(hres == S_OK, "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
}
static IActiveScript *create_jscript(void)
......@@ -694,7 +694,7 @@ static IActiveScript *create_jscript(void)
hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IActiveScript, (void**)&ret);
ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
return ret;
}
......@@ -710,20 +710,20 @@ static void test_jscript(void)
script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
test_safety((IUnknown*)script);
test_invoke_versioning(script);
hres = IActiveScriptParse_InitNew(parse);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parse);
ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "InitNew failed: %08lx, expected E_UNEXPECTED\n", hres);
hres = IActiveScript_SetScriptSite(script, NULL);
ok(hres == E_POINTER, "SetScriptSite failed: %08x, expected E_POINTER\n", hres);
ok(hres == E_POINTER, "SetScriptSite failed: %08lx, expected E_POINTER\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
test_no_script_dispatch(script);
......@@ -731,28 +731,28 @@ static void test_jscript(void)
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
test_state(script, SCRIPTSTATE_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08lx, expected E_UNEXPECTED\n", hres);
dispex = get_script_dispatch(script, NULL);
test_script_dispatch(dispex);
SET_EXPECT(OnStateChange_STARTED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_STARTED);
test_state(script, SCRIPTSTATE_STARTED);
SET_EXPECT(OnStateChange_CLOSED);
hres = IActiveScript_Close(script);
ok(hres == S_OK, "Close failed: %08x\n", hres);
ok(hres == S_OK, "Close failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_CLOSED);
test_state(script, SCRIPTSTATE_CLOSED);
......@@ -763,7 +763,7 @@ static void test_jscript(void)
IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script);
ok(!ref, "ref = %d\n", ref);
ok(!ref, "ref = %ld\n", ref);
}
static void test_jscript2(void)
......@@ -776,28 +776,28 @@ static void test_jscript2(void)
script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
SET_EXPECT(GetLCID);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
CHECK_CALLED(GetLCID);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScriptParse_InitNew(parse);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_INITIALIZED);
hres = IActiveScriptParse_InitNew(parse);
ok(hres == E_UNEXPECTED, "InitNew failed: %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "InitNew failed: %08lx, expected E_UNEXPECTED\n", hres);
SET_EXPECT(OnStateChange_CONNECTED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_CONNECTED);
test_state(script, SCRIPTSTATE_CONNECTED);
......@@ -806,7 +806,7 @@ static void test_jscript2(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CLOSED);
hres = IActiveScript_Close(script);
ok(hres == S_OK, "Close failed: %08x\n", hres);
ok(hres == S_OK, "Close failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_CLOSED);
......@@ -817,7 +817,7 @@ static void test_jscript2(void)
IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script);
ok(!ref, "ref = %d\n", ref);
ok(!ref, "ref = %ld\n", ref);
}
static void test_jscript_uninitializing(void)
......@@ -831,42 +831,42 @@ static void test_jscript_uninitializing(void)
script = create_jscript();
hres = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScriptParse_InitNew(parse);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
test_state(script, SCRIPTSTATE_INITIALIZED);
hres = IActiveScriptParse_ParseScriptText(parse, L"function f() {}", NULL, NULL, NULL, 0, 1, 0x42, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "SetScriptSite failed: %08lx, expected E_UNEXPECTED\n", hres);
SET_EXPECT(OnStateChange_UNINITIALIZED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hres = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
......@@ -874,7 +874,7 @@ static void test_jscript_uninitializing(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_CONNECTED);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -889,7 +889,7 @@ static void test_jscript_uninitializing(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_UNINITIALIZED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hres);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
......@@ -897,19 +897,19 @@ static void test_jscript_uninitializing(void)
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hres = IActiveScript_Close(script);
ok(hres == S_OK, "Close failed: %08x\n", hres);
ok(hres == S_OK, "Close failed: %08lx\n", hres);
test_state(script, SCRIPTSTATE_CLOSED);
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x, expected E_UNEXPECTED\n", hres);
ok(hres == E_UNEXPECTED, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx, expected E_UNEXPECTED\n", hres);
test_state(script, SCRIPTSTATE_CLOSED);
IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script);
ok(!ref, "ref = %d\n", ref);
ok(!ref, "ref = %ld\n", ref);
}
static void test_aggregation(void)
......@@ -920,7 +920,7 @@ static void test_aggregation(void)
hres = CoCreateInstance(&CLSID_JScript, (IUnknown*)0xdeadbeef, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IUnknown, (void**)&unk);
ok(hres == CLASS_E_NOAGGREGATION,
"CoCreateInstance failed: %08x, expected CLASS_E_NOAGGREGATION\n", hres);
"CoCreateInstance failed: %08lx, expected CLASS_E_NOAGGREGATION\n", hres);
ok(!unk || broken(unk != NULL), "unk = %p\n", unk);
}
......@@ -938,43 +938,43 @@ static void test_param_ids(void)
script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr);
SET_EXPECT(GetLCID);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_InitNew(parser);
ok(hr == S_OK, "InitNew failed: %08x\n", hr);
ok(hr == S_OK, "InitNew failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
parse_script(parser, L"function test(a, b, c, foo) { return a + b + c - foo; }\nfunction bar() { }");
disp = get_script_dispatch(script, NULL);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names1, ARRAY_SIZE(names1), 0, id);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"test\": %d\n", id[0]);
ok(id[4] == DISPID_UNKNOWN, "Unexpected DISPID for \"a\" parameter: %d\n", id[4]);
ok(id[3] == DISPID_UNKNOWN, "Unexpected DISPID for \"b\" parameter: %d\n", id[3]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"c\" parameter: %d\n", id[1]);
ok(id[2] == DISPID_UNKNOWN, "Unexpected DISPID for \"foo\" parameter: %d\n", id[2]);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"test\": %ld\n", id[0]);
ok(id[4] == DISPID_UNKNOWN, "Unexpected DISPID for \"a\" parameter: %ld\n", id[4]);
ok(id[3] == DISPID_UNKNOWN, "Unexpected DISPID for \"b\" parameter: %ld\n", id[3]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"c\" parameter: %ld\n", id[1]);
ok(id[2] == DISPID_UNKNOWN, "Unexpected DISPID for \"foo\" parameter: %ld\n", id[2]);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names2, ARRAY_SIZE(names2), 0, id);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"test\": %d\n", id[0]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"bar\": %d\n", id[1]);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"test\": %ld\n", id[0]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"bar\": %ld\n", id[1]);
hr = IDispatchEx_GetIDsOfNames(disp, &IID_NULL, (WCHAR**)names3, ARRAY_SIZE(names3), 0, id);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08x, expected %08x\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"bar\": %d\n", id[0]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"test\": %d\n", id[1]);
ok(hr == DISP_E_UNKNOWNNAME, "GetIDsOfNames returned %08lx, expected %08lx\n", hr, DISP_E_UNKNOWNNAME);
ok(id[0] > 0, "Unexpected DISPID for \"bar\": %ld\n", id[0]);
ok(id[1] == DISPID_UNKNOWN, "Unexpected DISPID for \"test\": %ld\n", id[1]);
IDispatchEx_Release(disp);
IActiveScriptParse_Release(parser);
......@@ -983,7 +983,7 @@ static void test_param_ids(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CLOSED);
hr = IActiveScript_Close(script);
ok(hr == S_OK, "Close failed: %08x\n", hr);
ok(hr == S_OK, "Close failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_CLOSED);
......@@ -1004,18 +1004,18 @@ static void test_code_persistence(void)
script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
test_safety((IUnknown*)script);
SET_EXPECT(GetLCID);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_InitNew(parse);
ok(hr == S_OK, "InitNew failed: %08x\n", hr);
ok(hr == S_OK, "InitNew failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_INITIALIZED);
test_state(script, SCRIPTSTATE_INITIALIZED);
......@@ -1023,50 +1023,50 @@ static void test_code_persistence(void)
L"var x = 1;\n"
L"var y = 2;\n",
NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
hr = IActiveScriptParse_ParseScriptText(parse,
L"var z = 3;\n"
L"var y = 42;\n"
L"var v = 10;\n",
NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
/* Pending code does not add identifiers to the global scope */
dispex = get_script_dispatch(script, NULL);
id = 0;
get_disp_id(dispex, L"x", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
id = 0;
get_disp_id(dispex, L"y", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
id = 0;
get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
IDispatchEx_Release(dispex);
/* Uninitialized state removes code without SCRIPTTEXT_ISPERSISTENT */
SET_EXPECT(OnStateChange_UNINITIALIZED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
test_no_script_dispatch(script);
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_ParseScriptText(parse, L"v = 20;\n", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
SET_EXPECT(OnStateChange_CONNECTED);
SET_EXPECT_MULTI(OnEnterScript, 2);
SET_EXPECT_MULTI(OnLeaveScript, 2);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
CHECK_CALLED_MULTI(OnEnterScript, 2);
CHECK_CALLED_MULTI(OnLeaveScript, 2);
......@@ -1075,7 +1075,7 @@ static void test_code_persistence(void)
dispex = get_script_dispatch(script, NULL);
id = 0;
get_disp_id(dispex, L"x", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
id = 0;
get_disp_id(dispex, L"y", S_OK, &id);
ok(id != -1, "id = -1\n");
......@@ -1087,7 +1087,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"y", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I2(&var) == 42, "V_VT(y) = %d, V_I2(y) = %d\n", V_VT(&var), V_I2(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1095,7 +1095,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"v", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I2(&var) == 20, "V_VT(var) = %d, V_I2(var) = %d\n", V_VT(&var), V_I2(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1105,7 +1105,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_UNINITIALIZED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
......@@ -1114,21 +1114,21 @@ static void test_code_persistence(void)
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
dispex = get_script_dispatch(script, NULL);
id = 0;
get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
IDispatchEx_Release(dispex);
SET_EXPECT(OnStateChange_CONNECTED);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1143,7 +1143,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"y", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I2(&var) == 42, "V_VT(y) = %d, V_I2(y) = %d\n", V_VT(&var), V_I2(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1151,7 +1151,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"v", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I2(&var) == 10, "V_VT(var) = %d, V_I2(var) = %d\n", V_VT(&var), V_I2(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1160,7 +1160,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_UNINITIALIZED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
......@@ -1168,17 +1168,17 @@ static void test_code_persistence(void)
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_ParseScriptText(parse, L"y = 2;\n", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
/* Closing the script engine removes all code (even if it's pending and persistent) */
SET_EXPECT(OnStateChange_CLOSED);
hr = IActiveScript_Close(script);
ok(hr == S_OK, "Close failed: %08x\n", hr);
ok(hr == S_OK, "Close failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CLOSED);
test_state(script, SCRIPTSTATE_CLOSED);
test_no_script_dispatch(script);
......@@ -1186,24 +1186,24 @@ static void test_code_persistence(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(GetLCID);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(GetLCID);
test_state(script, SCRIPTSTATE_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
test_state(script, SCRIPTSTATE_CONNECTED);
dispex = get_script_dispatch(script, NULL);
id = 0;
get_disp_id(dispex, L"y", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
id = 0;
get_disp_id(dispex, L"z", DISP_E_UNKNOWNNAME, &id);
ok(id == -1, "id = %d, expected -1\n", id);
ok(id == -1, "id = %ld, expected -1\n", id);
IDispatchEx_Release(dispex);
IActiveScriptParse_Release(parse);
......@@ -1212,7 +1212,7 @@ static void test_code_persistence(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CLOSED);
ref = IActiveScript_Release(script);
ok(!ref, "ref = %d\n", ref);
ok(!ref, "ref = %ld\n", ref);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_CLOSED);
......@@ -1270,51 +1270,51 @@ static void test_named_items(void)
script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parse);
ok(hr == S_OK, "Could not get IActiveScriptParse: %08x\n", hr);
ok(hr == S_OK, "Could not get IActiveScriptParse: %08lx\n", hr);
test_state(script, SCRIPTSTATE_UNINITIALIZED);
hr = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08x\n", hr);
ok(hr == E_UNEXPECTED, "AddNamedItem returned: %08lx\n", hr);
SET_EXPECT(GetLCID);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
SET_EXPECT(GetItemInfo_global);
hr = IActiveScript_AddNamedItem(script, L"globalItem", SCRIPTITEM_GLOBALMEMBERS);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
CHECK_CALLED(GetItemInfo_global);
hr = IActiveScript_AddNamedItem(script, L"visibleItem", SCRIPTITEM_ISVISIBLE);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"visibleCodeItem", SCRIPTITEM_ISVISIBLE | SCRIPTITEM_CODEONLY);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
hr = IActiveScript_AddNamedItem(script, L"persistent", SCRIPTITEM_ISPERSISTENT | SCRIPTITEM_CODEONLY);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref);
ok(global_named_item_ref > 0, "global_named_item_ref = %lu\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_GetScriptDispatch(script, L"noContext", &disp);
ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08lx\n", hr);
hr = IActiveScript_GetScriptDispatch(script, L"codeONLYItem", &disp);
ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetScriptDispatch returned: %08lx\n", hr);
SET_EXPECT(GetItemInfo_global_code);
hr = IActiveScript_AddNamedItem(script, L"globalCodeItem", SCRIPTITEM_GLOBALMEMBERS | SCRIPTITEM_CODEONLY);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
CHECK_CALLED(GetItemInfo_global_code);
dispex = get_script_dispatch(script, NULL);
......@@ -1329,12 +1329,12 @@ static void test_named_items(void)
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_InitNew(parse);
ok(hr == S_OK, "InitNew failed: %08x\n", hr);
ok(hr == S_OK, "InitNew failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
SET_EXPECT(testCall);
......@@ -1351,7 +1351,7 @@ static void test_named_items(void)
SET_EXPECT(OnLeaveScript);
SET_EXPECT(testCall);
hr = IActiveScriptParse_ParseScriptText(parse, L"testCall();", L"visibleCodeItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
CHECK_CALLED(testCall);
......@@ -1361,18 +1361,18 @@ static void test_named_items(void)
SET_EXPECT(OnScriptError);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"codeOnlyItem();", L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(FAILED(hr), "ParseScriptText returned: %08x\n", hr);
ok(FAILED(hr), "ParseScriptText returned: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(GetIDsOfNames);
CHECK_CALLED(OnScriptError);
CHECK_CALLED(OnLeaveScript);
hr = IActiveScript_GetScriptDispatch(script, L"visibleCodeItem", &disp);
ok(hr == S_OK, "GetScriptDispatch returned: %08x\n", hr);
ok(hr == S_OK, "GetScriptDispatch returned: %08lx\n", hr);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleCodeItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == disp,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1386,17 +1386,17 @@ static void test_named_items(void)
CHECK_CALLED(GetItemInfo_visible_code);
CHECK_CALLED(testCall);
ok(global_named_item_ref > 0, "global_named_item_ref = %u\n", global_named_item_ref);
ok(visible_named_item_ref > 0, "visible_named_item_ref = %u\n", visible_named_item_ref);
ok(visible_code_named_item_ref > 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref);
ok(global_named_item_ref > 0, "global_named_item_ref = %lu\n", global_named_item_ref);
ok(visible_named_item_ref > 0, "visible_named_item_ref = %lu\n", visible_named_item_ref);
ok(visible_code_named_item_ref > 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
SET_EXPECT(testCall);
parse_script(parse, L"visibleItem.testCall();");
CHECK_CALLED(testCall);
hr = IActiveScriptParse_ParseScriptText(parse, L"function testFunc() { }", L"CodeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == E_INVALIDARG, "ParseScriptText returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "ParseScriptText returned: %08lx\n", hr);
SET_EXPECT(OnEnterScript);
SET_EXPECT(GetIDsOfNames);
......@@ -1408,7 +1408,7 @@ static void test_named_items(void)
"var testVar_global = 10;\n"
"function testClassFunc() { this.x = 10; }\n",
NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(GetIDsOfNames);
CHECK_CALLED(OnLeaveScript);
......@@ -1416,7 +1416,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"function testFunc() { }\n", L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1427,7 +1427,7 @@ static void test_named_items(void)
"testVar_global = 5;\n"
"var testFuncConstr = new Function(\"return testVar;\");\n",
L"codeOnlyItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1435,7 +1435,7 @@ static void test_named_items(void)
SET_EXPECT(GetIDsOfNames_visible);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"var abc;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(GetIDsOfNames_visible);
CHECK_CALLED(OnLeaveScript);
......@@ -1443,14 +1443,14 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"abc = 5;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(GetIDsOfNames_visible);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"testVar_global = 5;\n", L"visibleItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(GetIDsOfNames_visible);
CHECK_CALLED(OnLeaveScript);
......@@ -1458,21 +1458,21 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"var abc; testVar_global = 5;\n", L"visibleCodeItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"global_this = this;\n", L"globalItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this = this;\n", L"globalCodeItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1481,13 +1481,13 @@ static void test_named_items(void)
bstr = SysAllocString(global_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr);
ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(global_idents[i]));
id = 0;
hr = IDispatchEx_GetDispID(dispex2, bstr, 0, &id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(global_idents[i]), id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(global_idents[i]), id);
SysFreeString(bstr);
}
......@@ -1496,11 +1496,11 @@ static void test_named_items(void)
bstr = SysAllocString(context_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
id = 0;
hr = IDispatchEx_GetDispID(dispex2, bstr, 0, &id);
ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr);
ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(context_idents[i]));
SysFreeString(bstr);
}
......@@ -1510,7 +1510,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1518,7 +1518,7 @@ static void test_named_items(void)
SET_EXPECT(GetIDsOfNames);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
}
......@@ -1530,7 +1530,7 @@ static void test_named_items(void)
SET_EXPECT(OnScriptError);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(GetIDsOfNames);
CHECK_CALLED(OnScriptError);
......@@ -1539,7 +1539,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(context_code_test[i]), hr);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
}
......@@ -1547,7 +1547,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &global_named_item,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1557,7 +1557,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"visibleItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &visible_named_item,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1567,7 +1567,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"codeOnlyItem", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex2,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1577,7 +1577,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &global_named_item,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1591,7 +1591,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1602,20 +1602,20 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"var x = 13;\n", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISPERSISTENT, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"x = 10;\n", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(V_VT(&var) == VT_I4 && V_I4(&var) == 10, "Unexpected 'x': V_VT = %d, V_I4 = %d\n", V_VT(&var), V_I4(&var));
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I4(&var) == 10, "Unexpected 'x': V_VT = %d, V_I4 = %ld\n", V_VT(&var), V_I4(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1627,39 +1627,39 @@ static void test_named_items(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_UNINITIALIZED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_UNINITIALIZED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_UNINITIALIZED);
test_no_script_dispatch(script);
ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref);
ok(global_named_item_ref == 0, "global_named_item_ref = %lu\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_GetScriptDispatch(script, L"codeOnlyItem", &disp);
ok(hr == E_UNEXPECTED, "hr = %08x, expected E_UNEXPECTED\n", hr);
ok(hr == E_UNEXPECTED, "hr = %08lx, expected E_UNEXPECTED\n", hr);
SET_EXPECT(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(GetItemInfo_persistent);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(GetItemInfo_persistent);
ok(persistent_named_item_ref > 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref);
ok(persistent_named_item_ref > 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
hr = IActiveScript_AddNamedItem(script, L"codeOnlyItem", SCRIPTITEM_CODEONLY);
ok(hr == S_OK, "AddNamedItem failed: %08x\n", hr);
ok(hr == S_OK, "AddNamedItem failed: %08lx\n", hr);
SET_EXPECT(OnStateChange_CONNECTED);
SET_EXPECT_MULTI(OnEnterScript, 5);
SET_EXPECT_MULTI(OnLeaveScript, 5);
SET_EXPECT(GetIDsOfNames_persistent);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
CHECK_CALLED_MULTI(OnEnterScript, 5);
CHECK_CALLED_MULTI(OnLeaveScript, 5);
......@@ -1673,8 +1673,8 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"x", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(V_VT(&var) == VT_I4 && V_I4(&var) == 13, "Unexpected 'x': V_VT = %d, V_I4 = %d\n", V_VT(&var), V_I4(&var));
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_I4 && V_I4(&var) == 13, "Unexpected 'x': V_VT = %d, V_I4 = %ld\n", V_VT(&var), V_I4(&var));
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
......@@ -1682,7 +1682,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"this", L"persistent", NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == &persistent_named_item,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1694,7 +1694,7 @@ static void test_named_items(void)
SET_EXPECT(OnLeaveScript);
SET_EXPECT(GetIDsOfNames_persistent);
hr = IActiveScriptParse_ParseScriptText(parse, L"var abc123;", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
CHECK_CALLED(GetIDsOfNames_persistent);
......@@ -1704,7 +1704,7 @@ static void test_named_items(void)
SET_EXPECT(GetIDsOfNames_persistent);
SET_EXPECT(OnScriptError);
hr = IActiveScriptParse_ParseScriptText(parse, L"testCall();", L"persistent", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(FAILED(hr), "ParseScriptText returned: %08x\n", hr);
ok(FAILED(hr), "ParseScriptText returned: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
CHECK_CALLED(GetIDsOfNames_persistent);
......@@ -1716,7 +1716,7 @@ static void test_named_items(void)
bstr = SysAllocString(global_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == S_OK, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr);
ok(hr == S_OK, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id != -1, "[%s] id = -1\n", wine_dbgstr_w(global_idents[i]));
SysFreeString(bstr);
}
......@@ -1726,15 +1726,15 @@ static void test_named_items(void)
bstr = SysAllocString(context_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
SysFreeString(bstr);
}
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"global_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1744,7 +1744,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"globalCode_this", NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, &var, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
ok(V_VT(&var) == VT_DISPATCH && V_DISPATCH(&var) == (IDispatch*)dispex,
"Unexpected 'this': V_VT = %d, V_DISPATCH = %p\n", V_VT(&var), V_DISPATCH(&var));
VariantClear(&var);
......@@ -1754,7 +1754,7 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, L"global_this = 0; globalCode_this = 0;\n", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText failed: %08x\n", hr);
ok(hr == S_OK, "ParseScriptText failed: %08lx\n", hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
IDispatchEx_Release(dispex);
......@@ -1765,8 +1765,8 @@ static void test_named_items(void)
bstr = SysAllocString(global_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(global_idents[i]), id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(global_idents[i]), hr);
ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(global_idents[i]), id);
SysFreeString(bstr);
}
......@@ -1775,8 +1775,8 @@ static void test_named_items(void)
bstr = SysAllocString(context_idents[i]);
id = 0;
hr = IDispatchEx_GetDispID(dispex, bstr, 0, &id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08x\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %d, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
ok(hr == DISP_E_UNKNOWNNAME, "GetDispID(%s) returned %08lx\n", wine_dbgstr_w(context_idents[i]), hr);
ok(id == -1, "[%s] id = %ld, expected -1\n", wine_dbgstr_w(context_idents[i]), id);
SysFreeString(bstr);
}
IDispatchEx_Release(dispex);
......@@ -1786,13 +1786,13 @@ static void test_named_items(void)
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
SET_EXPECT(OnEnterScript);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, global_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08x\n", wine_dbgstr_w(global_code_test[i]), hr);
ok(hr == S_OK, "ParseScriptText(%s) failed: %08lx\n", wine_dbgstr_w(global_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnLeaveScript);
}
......@@ -1803,7 +1803,7 @@ static void test_named_items(void)
SET_EXPECT(OnScriptError);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnScriptError);
CHECK_CALLED(OnLeaveScript);
......@@ -1812,7 +1812,7 @@ static void test_named_items(void)
SET_EXPECT(OnScriptError);
SET_EXPECT(OnLeaveScript);
hr = IActiveScriptParse_ParseScriptText(parse, context_code_test[i], L"codeOnlyItem", NULL, NULL, 0, 0, 0, NULL, NULL);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08x\n", wine_dbgstr_w(context_code_test[i]), hr);
ok(FAILED(hr), "ParseScriptText(%s) returned: %08lx\n", wine_dbgstr_w(context_code_test[i]), hr);
CHECK_CALLED(OnEnterScript);
CHECK_CALLED(OnScriptError);
CHECK_CALLED(OnLeaveScript);
......@@ -1822,21 +1822,21 @@ static void test_named_items(void)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CLOSED);
hr = IActiveScript_Close(script);
ok(hr == S_OK, "Close failed: %08x\n", hr);
ok(hr == S_OK, "Close failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_CLOSED);
ok(global_named_item_ref == 0, "global_named_item_ref = %u\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %u\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %u\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %u\n", persistent_named_item_ref);
ok(global_named_item_ref == 0, "global_named_item_ref = %lu\n", global_named_item_ref);
ok(visible_named_item_ref == 0, "visible_named_item_ref = %lu\n", visible_named_item_ref);
ok(visible_code_named_item_ref == 0, "visible_code_named_item_ref = %lu\n", visible_code_named_item_ref);
ok(persistent_named_item_ref == 0, "persistent_named_item_ref = %lu\n", persistent_named_item_ref);
test_state(script, SCRIPTSTATE_CLOSED);
IActiveScriptParse_Release(parse);
ref = IActiveScript_Release(script);
ok(!ref, "ref = %d\n", ref);
ok(!ref, "ref = %ld\n", ref);
}
static void test_typeinfo(const WCHAR *parse_func_name)
......@@ -1919,21 +1919,21 @@ static void test_typeinfo(const WCHAR *parse_func_name)
script = create_jscript();
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParse, (void**)&parser);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08x\n", hr);
ok(hr == S_OK, "Could not get IActiveScriptParse iface: %08lx\n", hr);
SET_EXPECT(GetLCID);
hr = IActiveScript_SetScriptSite(script, &ActiveScriptSite);
ok(hr == S_OK, "SetScriptSite failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptSite failed: %08lx\n", hr);
CHECK_CALLED(GetLCID);
SET_EXPECT(OnStateChange_INITIALIZED);
hr = IActiveScriptParse_InitNew(parser);
ok(hr == S_OK, "InitNew failed: %08x\n", hr);
ok(hr == S_OK, "InitNew failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CONNECTED);
hr = IActiveScript_SetScriptState(script, SCRIPTSTATE_CONNECTED);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08x\n", hr);
ok(hr == S_OK, "SetScriptState(SCRIPTSTATE_CONNECTED) failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_CONNECTED);
if (parse_func_name)
......@@ -1942,15 +1942,15 @@ static void test_typeinfo(const WCHAR *parse_func_name)
IDispatch *proc_disp;
hr = IActiveScript_QueryInterface(script, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
ok(hr == S_OK, "Could not get IActiveScriptParse: %08x\n", hr);
ok(hr == S_OK, "Could not get IActiveScriptParse: %08lx\n", hr);
hr = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, source, NULL, parse_func_name,
NULL, NULL, NULL, 0, 0, SCRIPTPROC_IMPLICIT_THIS | SCRIPTPROC_IMPLICIT_PARENTS, &proc_disp);
ok(hr == S_OK, "ParseProcedureText failed: %08x\n", hr);
ok(hr == S_OK, "ParseProcedureText failed: %08lx\n", hr);
IActiveScriptParseProcedure2_Release(parse_proc);
hr = IDispatch_QueryInterface(proc_disp, &IID_IDispatchEx, (void**)&disp);
ok(hr == S_OK, "Could not get IDispatchEx: %08x\n", hr);
ok(hr == S_OK, "Could not get IDispatchEx: %08lx\n", hr);
IDispatch_Release(proc_disp);
}
else
......@@ -1960,37 +1960,37 @@ static void test_typeinfo(const WCHAR *parse_func_name)
}
hr = IDispatchEx_QueryInterface(disp, &IID_ITypeInfo, (void**)&typeinfo);
ok(hr == E_NOINTERFACE, "QueryInterface(IID_ITypeInfo) returned: %08x\n", hr);
ok(hr == E_NOINTERFACE, "QueryInterface(IID_ITypeInfo) returned: %08lx\n", hr);
hr = IDispatchEx_GetTypeInfo(disp, 1, LOCALE_USER_DEFAULT, &typeinfo);
ok(hr == DISP_E_BADINDEX, "GetTypeInfo returned: %08x\n", hr);
ok(hr == DISP_E_BADINDEX, "GetTypeInfo returned: %08lx\n", hr);
hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo);
ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr);
hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2);
ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr);
ok(typeinfo != typeinfo2, "TypeInfo was not supposed to be shared.\n");
ITypeInfo_Release(typeinfo2);
obj = (void*)0xdeadbeef;
hr = ITypeInfo_CreateInstance(typeinfo, NULL, NULL, NULL);
ok(hr == E_INVALIDARG, "CreateInstance returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "CreateInstance returned: %08lx\n", hr);
hr = ITypeInfo_CreateInstance(typeinfo, NULL, NULL, &obj);
ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08lx\n", hr);
hr = ITypeInfo_CreateInstance(typeinfo, NULL, &IID_IDispatch, &obj);
ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "CreateInstance returned: %08lx\n", hr);
ok(!obj, "Unexpected non-null obj %p.\n", obj);
hr = ITypeInfo_GetDocumentation(typeinfo, MEMBERID_NIL, &bstr, NULL, NULL, NULL);
ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08x\n", hr);
ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08lx\n", hr);
ok(!lstrcmpW(bstr, L"JScriptTypeInfo"), "Unexpected TypeInfo name %s\n", wine_dbgstr_w(bstr));
SysFreeString(bstr);
hr = ITypeInfo_GetTypeAttr(typeinfo, &attr);
ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr);
ok(IsEqualGUID(&attr->guid, &IID_IScriptTypeInfo), "Unexpected GUID %s\n", wine_dbgstr_guid(&attr->guid));
ok(attr->lcid == LOCALE_USER_DEFAULT, "Unexpected LCID %u\n", attr->lcid);
ok(attr->memidConstructor == MEMBERID_NIL, "Unexpected constructor memid %u\n", attr->memidConstructor);
ok(attr->memidDestructor == MEMBERID_NIL, "Unexpected destructor memid %u\n", attr->memidDestructor);
ok(attr->cbSizeInstance == 4, "Unexpected cbSizeInstance %u\n", attr->cbSizeInstance);
ok(attr->lcid == LOCALE_USER_DEFAULT, "Unexpected LCID %lu\n", attr->lcid);
ok(attr->memidConstructor == MEMBERID_NIL, "Unexpected constructor memid %lu\n", attr->memidConstructor);
ok(attr->memidDestructor == MEMBERID_NIL, "Unexpected destructor memid %lu\n", attr->memidDestructor);
ok(attr->cbSizeInstance == 4, "Unexpected cbSizeInstance %lu\n", attr->cbSizeInstance);
ok(attr->typekind == TKIND_DISPATCH, "Unexpected typekind %u\n", attr->typekind);
ok(attr->cFuncs == expected_funcs_cnt, "Unexpected cFuncs %u\n", attr->cFuncs);
ok(attr->cVars == expected_vars_cnt, "Unexpected cVars %u\n", attr->cVars);
......@@ -2004,39 +2004,39 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* The type inherits from IDispatch */
hr = ITypeInfo_GetImplTypeFlags(typeinfo, 0, NULL);
ok(hr == E_INVALIDARG, "GetImplTypeFlags returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetImplTypeFlags returned: %08lx\n", hr);
hr = ITypeInfo_GetImplTypeFlags(typeinfo, 1, &implTypeFlags);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08lx\n", hr);
hr = ITypeInfo_GetImplTypeFlags(typeinfo, -1, &implTypeFlags);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetImplTypeFlags returned: %08lx\n", hr);
hr = ITypeInfo_GetImplTypeFlags(typeinfo, 0, &implTypeFlags);
ok(hr == S_OK, "GetImplTypeFlags failed: %08x\n", hr);
ok(hr == S_OK, "GetImplTypeFlags failed: %08lx\n", hr);
ok(implTypeFlags == 0, "Unexpected implTypeFlags 0x%x\n", implTypeFlags);
hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, NULL);
ok(hr == E_INVALIDARG, "GetRefTypeOfImplType returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetRefTypeOfImplType returned: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 1, &reftype);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType returned: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType returned: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, -1, &reftype);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType failed: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetRefTypeOfImplType failed: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeOfImplType(typeinfo, 0, &reftype);
ok(hr == S_OK, "GetRefTypeOfImplType failed: %08x\n", hr);
ok(reftype == 1, "Unexpected reftype %d\n", reftype);
ok(hr == S_OK, "GetRefTypeOfImplType failed: %08lx\n", hr);
ok(reftype == 1, "Unexpected reftype %ld\n", reftype);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, reftype, NULL);
ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, -1, &typeinfo2);
ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetRefTypeInfo returned: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, 4, &typeinfo2);
ok(hr == E_FAIL, "GetRefTypeInfo returned: %08x\n", hr);
ok(hr == E_FAIL, "GetRefTypeInfo returned: %08lx\n", hr);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, 0, &typeinfo2);
ok(hr == S_OK, "GetRefTypeInfo failed: %08x\n", hr);
ok(hr == S_OK, "GetRefTypeInfo failed: %08lx\n", hr);
ok(typeinfo == typeinfo2, "Unexpected TypeInfo %p (expected %p)\n", typeinfo2, typeinfo);
ITypeInfo_Release(typeinfo2);
hr = ITypeInfo_GetRefTypeInfo(typeinfo, reftype, &typeinfo2);
ok(hr == S_OK, "GetRefTypeInfo failed: %08x\n", hr);
ok(hr == S_OK, "GetRefTypeInfo failed: %08lx\n", hr);
hr = ITypeInfo_GetDocumentation(typeinfo2, MEMBERID_NIL, &bstr, NULL, NULL, NULL);
ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08x\n", hr);
ok(hr == S_OK, "GetDocumentation(MEMBERID_NIL) failed: %08lx\n", hr);
ok(!lstrcmpW(bstr, L"IDispatch"), "Unexpected TypeInfo name %s\n", wine_dbgstr_w(bstr));
ITypeInfo_Release(typeinfo2);
SysFreeString(bstr);
......@@ -2044,29 +2044,29 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* GetIDsOfNames looks into the inherited types as well */
wcscpy(str, L"queryinterface");
hr = ITypeInfo_GetIDsOfNames(typeinfo, NULL, 1, &memid);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr);
hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, NULL);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr);
hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 0, &memid);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetIDsOfNames returned: %08lx\n", hr);
hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid);
ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr);
ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr);
ok(!lstrcmpW(str, L"queryinterface"), "Unexpected string %s\n", wine_dbgstr_w(str));
if (expected_funcs_cnt)
{
wcscpy(str, L"Math");
hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid);
ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr);
ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr);
ok(!lstrcmpW(str, L"Math"), "Unexpected string %s\n", wine_dbgstr_w(str));
hr = ITypeInfo_GetNames(typeinfo, memid, NULL, 1, &count);
ok(hr == E_INVALIDARG, "GetNames returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetNames returned: %08lx\n", hr);
hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, 1, NULL);
ok(hr == E_INVALIDARG, "GetNames returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetNames returned: %08lx\n", hr);
hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, 0, &count);
ok(hr == S_OK, "GetNames failed: %08x\n", hr);
ok(hr == S_OK, "GetNames failed: %08lx\n", hr);
ok(count == 0, "Unexpected count %u\n", count);
hr = ITypeInfo_GetNames(typeinfo, memid, bstrs, ARRAY_SIZE(bstrs), &count);
ok(hr == S_OK, "GetNames failed: %08x\n", hr);
ok(hr == S_OK, "GetNames failed: %08lx\n", hr);
ok(count == 3, "Unexpected count %u\n", count);
ok(!lstrcmpW(bstrs[0], L"math"), "Unexpected function name %s\n", wine_dbgstr_w(bstrs[0]));
ok(!lstrcmpW(bstrs[1], L"x"), "Unexpected function first param name %s\n", wine_dbgstr_w(bstrs[1]));
......@@ -2074,56 +2074,56 @@ static void test_typeinfo(const WCHAR *parse_func_name)
for (i = 0; i < count; i++) SysFreeString(bstrs[i]);
hr = ITypeInfo_GetMops(typeinfo, memid, NULL);
ok(hr == E_INVALIDARG, "GetMops returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetMops returned: %08lx\n", hr);
hr = ITypeInfo_GetMops(typeinfo, memid, &bstr);
ok(hr == S_OK, "GetMops failed: %08x\n", hr);
ok(hr == S_OK, "GetMops failed: %08lx\n", hr);
ok(!bstr, "Unexpected non-null string %s\n", wine_dbgstr_w(bstr));
hr = ITypeInfo_GetMops(typeinfo, MEMBERID_NIL, &bstr);
ok(hr == S_OK, "GetMops failed: %08x\n", hr);
ok(hr == S_OK, "GetMops failed: %08lx\n", hr);
ok(!bstr, "Unexpected non-null string %s\n", wine_dbgstr_w(bstr));
/* These always fail */
obj = (void*)0xdeadbeef;
hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, NULL);
ok(hr == E_INVALIDARG, "AddressOfMember returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "AddressOfMember returned: %08lx\n", hr);
hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, &obj);
ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08lx\n", hr);
ok(!obj, "Unexpected non-null obj %p.\n", obj);
bstr = (BSTR)0xdeadbeef;
hr = ITypeInfo_GetDllEntry(typeinfo, memid, INVOKE_FUNC, &bstr, NULL, NULL);
ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08lx\n", hr);
ok(!bstr, "Unexpected non-null str %p.\n", bstr);
wcscpy(str, L"Invoke");
hr = ITypeInfo_GetIDsOfNames(typeinfo, &names, 1, &memid);
ok(hr == S_OK, "GetIDsOfNames failed: %08x\n", hr);
ok(hr == S_OK, "GetIDsOfNames failed: %08lx\n", hr);
obj = (void*)0xdeadbeef;
hr = ITypeInfo_AddressOfMember(typeinfo, memid, INVOKE_FUNC, &obj);
ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "AddressOfMember returned: %08lx\n", hr);
ok(!obj, "Unexpected non-null obj %p.\n", obj);
bstr = (BSTR)0xdeadbeef;
hr = ITypeInfo_GetDllEntry(typeinfo, memid, INVOKE_FUNC, &bstr, NULL, NULL);
ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08x\n", hr);
ok(hr == TYPE_E_BADMODULEKIND, "GetDllEntry returned: %08lx\n", hr);
ok(!bstr, "Unexpected non-null str %p.\n", bstr);
}
/* Check variable descriptions */
hr = ITypeInfo_GetVarDesc(typeinfo, 0, NULL);
ok(hr == E_INVALIDARG, "GetVarDesc returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetVarDesc returned: %08lx\n", hr);
hr = ITypeInfo_GetVarDesc(typeinfo, 1337, &vardesc);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetVarDesc returned: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetVarDesc returned: %08lx\n", hr);
for (i = 0; i < expected_vars_cnt; i++)
{
hr = ITypeInfo_GetVarDesc(typeinfo, i, &vardesc);
ok(hr == S_OK, "GetVarDesc(%u) failed: %08x\n", i, hr);
ok(hr == S_OK, "GetVarDesc(%u) failed: %08lx\n", i, hr);
hr = ITypeInfo_GetDocumentation(typeinfo, vardesc->memid, &bstr, &bstrs[0], NULL, NULL);
ok(hr == S_OK, "[%u] GetDocumentation failed: %08x\n", i, hr);
ok(hr == S_OK, "[%u] GetDocumentation failed: %08lx\n", i, hr);
ok(!lstrcmpW(bstr, var[i].name), "[%u] Unexpected variable name %s (expected %s)\n",
i, wine_dbgstr_w(bstr), wine_dbgstr_w(var[i].name));
ok(!bstrs[0], "[%u] Unexpected doc string %s\n", i, wine_dbgstr_w(bstrs[0]));
SysFreeString(bstr);
ok(vardesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%x\n", i, vardesc->memid);
ok(vardesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%lx\n", i, vardesc->memid);
ok(vardesc->lpstrSchema == NULL, "[%u] Unexpected lpstrSchema %p\n", i, vardesc->lpstrSchema);
ok(vardesc->oInst == 0, "[%u] Unexpected oInst %u\n", i, vardesc->oInst);
ok(vardesc->oInst == 0, "[%u] Unexpected oInst %lu\n", i, vardesc->oInst);
ok(vardesc->varkind == VAR_DISPATCH, "[%u] Unexpected varkind %d\n", i, vardesc->varkind);
ok(vardesc->wVarFlags == 0, "[%u] Unexpected wVarFlags 0x%x\n", i, vardesc->wVarFlags);
ok(vardesc->elemdescVar.tdesc.vt == VT_VARIANT,
......@@ -2137,20 +2137,20 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* Check function descriptions */
hr = ITypeInfo_GetFuncDesc(typeinfo, 0, NULL);
ok(hr == E_INVALIDARG, "GetFuncDesc returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetFuncDesc returned: %08lx\n", hr);
hr = ITypeInfo_GetFuncDesc(typeinfo, 1337, &funcdesc);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetFuncDesc returned: %08x\n", hr);
ok(hr == TYPE_E_ELEMENTNOTFOUND, "GetFuncDesc returned: %08lx\n", hr);
for (i = 0; i < expected_funcs_cnt; i++)
{
hr = ITypeInfo_GetFuncDesc(typeinfo, i, &funcdesc);
ok(hr == S_OK, "GetFuncDesc(%u) failed: %08x\n", i, hr);
ok(hr == S_OK, "GetFuncDesc(%u) failed: %08lx\n", i, hr);
hr = ITypeInfo_GetDocumentation(typeinfo, funcdesc->memid, &bstr, &bstrs[0], NULL, NULL);
ok(hr == S_OK, "[%u] GetDocumentation failed: %08x\n", i, hr);
ok(hr == S_OK, "[%u] GetDocumentation failed: %08lx\n", i, hr);
ok(!lstrcmpW(bstr, func[i].name), "[%u] Unexpected function name %s (expected %s)\n",
i, wine_dbgstr_w(bstr), wine_dbgstr_w(func[i].name));
ok(!bstrs[0], "[%u] Unexpected doc string %s\n", i, wine_dbgstr_w(bstrs[0]));
SysFreeString(bstr);
ok(funcdesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%x\n", i, funcdesc->memid);
ok(funcdesc->memid <= 0xFFFF, "[%u] Unexpected memid 0x%lx\n", i, funcdesc->memid);
ok(funcdesc->lprgscode == NULL, "[%u] Unexpected lprgscode %p\n", i, funcdesc->lprgscode);
ok(func[i].num_args ? (funcdesc->lprgelemdescParam != NULL) : (funcdesc->lprgelemdescParam == NULL),
"[%u] Unexpected lprgelemdescParam %p\n", i, funcdesc->lprgelemdescParam);
......@@ -2183,28 +2183,28 @@ static void test_typeinfo(const WCHAR *parse_func_name)
/* Test TypeComp Binds */
hr = ITypeInfo_QueryInterface(typeinfo, &IID_ITypeComp, (void**)&typecomp);
ok(hr == S_OK, "QueryInterface(IID_ITypeComp) failed: %08x\n", hr);
ok(hr == S_OK, "QueryInterface(IID_ITypeComp) failed: %08lx\n", hr);
hr = ITypeInfo_GetTypeComp(typeinfo, NULL);
ok(hr == E_INVALIDARG, "GetTypeComp returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "GetTypeComp returned: %08lx\n", hr);
hr = ITypeInfo_GetTypeComp(typeinfo, &typecomp2);
ok(hr == S_OK, "GetTypeComp failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeComp failed: %08lx\n", hr);
ok(typecomp == typecomp2, "QueryInterface(IID_ITypeComp) and GetTypeComp returned different TypeComps\n");
ITypeComp_Release(typecomp2);
wcscpy(str, L"not_found");
hr = ITypeComp_Bind(typecomp, NULL, 0, 0, &typeinfo2, &desckind, &bindptr);
ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr);
hr = ITypeComp_Bind(typecomp, str, 0, 0, NULL, &desckind, &bindptr);
ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr);
hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, NULL, &bindptr);
ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr);
hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, NULL);
ok(hr == E_INVALIDARG, "Bind returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "Bind returned: %08lx\n", hr);
hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, &bindptr);
ok(hr == S_OK, "Bind failed: %08x\n", hr);
ok(hr == S_OK, "Bind failed: %08lx\n", hr);
ok(desckind == DESCKIND_NONE, "Unexpected desckind %u\n", desckind);
wcscpy(str, L"addRef");
hr = ITypeComp_Bind(typecomp, str, 0, 0, &typeinfo2, &desckind, &bindptr);
ok(hr == S_OK, "Bind failed: %08x\n", hr);
ok(hr == S_OK, "Bind failed: %08lx\n", hr);
ok(desckind == DESCKIND_FUNCDESC, "Unexpected desckind %u\n", desckind);
ok(!lstrcmpW(str, L"addRef"), "Unexpected string %s\n", wine_dbgstr_w(str));
ITypeInfo_ReleaseFuncDesc(typeinfo2, bindptr.lpfuncdesc);
......@@ -2213,7 +2213,7 @@ static void test_typeinfo(const WCHAR *parse_func_name)
{
wcscpy(str, var[i].name);
hr = ITypeComp_Bind(typecomp, str, 0, INVOKE_PROPERTYGET, &typeinfo2, &desckind, &bindptr);
ok(hr == S_OK, "Bind failed: %08x\n", hr);
ok(hr == S_OK, "Bind failed: %08lx\n", hr);
ok(desckind == DESCKIND_VARDESC, "Unexpected desckind %u\n", desckind);
ITypeInfo_ReleaseVarDesc(typeinfo2, bindptr.lpvardesc);
ITypeInfo_Release(typeinfo2);
......@@ -2222,30 +2222,30 @@ static void test_typeinfo(const WCHAR *parse_func_name)
{
wcscpy(str, func[i].name);
hr = ITypeComp_Bind(typecomp, str, 0, INVOKE_FUNC, &typeinfo2, &desckind, &bindptr);
ok(hr == S_OK, "Bind failed: %08x\n", hr);
ok(hr == S_OK, "Bind failed: %08lx\n", hr);
ok(desckind == DESCKIND_FUNCDESC, "Unexpected desckind %u\n", desckind);
ITypeInfo_ReleaseFuncDesc(typeinfo2, bindptr.lpfuncdesc);
ITypeInfo_Release(typeinfo2);
}
wcscpy(str, L"JScriptTypeInfo");
hr = ITypeComp_BindType(typecomp, NULL, 0, &typeinfo2, &typecomp2);
ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr);
hr = ITypeComp_BindType(typecomp, str, 0, NULL, &typecomp2);
ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr);
hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, NULL);
ok(hr == E_INVALIDARG, "BindType returned: %08x\n", hr);
ok(hr == E_INVALIDARG, "BindType returned: %08lx\n", hr);
hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2);
ok(hr == S_OK, "BindType failed: %08x\n", hr);
ok(hr == S_OK, "BindType failed: %08lx\n", hr);
ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2);
ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2);
wcscpy(str, L"C");
hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2);
ok(hr == S_OK, "BindType failed: %08x\n", hr);
ok(hr == S_OK, "BindType failed: %08lx\n", hr);
ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2);
ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2);
wcscpy(str, L"IDispatch");
hr = ITypeComp_BindType(typecomp, str, 0, &typeinfo2, &typecomp2);
ok(hr == S_OK, "BindType failed: %08x\n", hr);
ok(hr == S_OK, "BindType failed: %08lx\n", hr);
ok(!typeinfo2, "Unexpected TypeInfo %p (expected null)\n", typeinfo2);
ok(!typecomp2, "Unexpected TypeComp %p (expected null)\n", typecomp2);
ITypeComp_Release(typecomp);
......@@ -2259,14 +2259,14 @@ static void test_typeinfo(const WCHAR *parse_func_name)
"function new_func() { }\n");
hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2);
ok(hr == S_OK, "GetTypeInfo failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeInfo failed: %08lx\n", hr);
hr = ITypeInfo_GetTypeAttr(typeinfo, &attr);
ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr);
ok(attr->cFuncs == expected_funcs_cnt, "Unexpected cFuncs %u\n", attr->cFuncs);
ok(attr->cVars == expected_vars_cnt, "Unexpected cVars %u\n", attr->cVars);
ITypeInfo_ReleaseTypeAttr(typeinfo, attr);
hr = ITypeInfo_GetTypeAttr(typeinfo2, &attr);
ok(hr == S_OK, "GetTypeAttr failed: %08x\n", hr);
ok(hr == S_OK, "GetTypeAttr failed: %08lx\n", hr);
ok(attr->cFuncs == expected_funcs_cnt + 1, "Unexpected cFuncs %u\n", attr->cFuncs);
ok(attr->cVars == expected_vars_cnt + 1, "Unexpected cVars %u\n", attr->cVars);
ITypeInfo_ReleaseTypeAttr(typeinfo2, attr);
......@@ -2276,7 +2276,7 @@ static void test_typeinfo(const WCHAR *parse_func_name)
when retrieving the TypeInfo, even though it is valid jscript. */
parse_script(parser, L"var NEW_FUNC;\n");
hr = IDispatchEx_GetTypeInfo(disp, 0, LOCALE_USER_DEFAULT, &typeinfo2);
ok(hr == TYPE_E_AMBIGUOUSNAME, "GetTypeInfo returned: %08x\n", hr);
ok(hr == TYPE_E_AMBIGUOUSNAME, "GetTypeInfo returned: %08lx\n", hr);
}
ITypeInfo_Release(typeinfo);
......@@ -2287,7 +2287,7 @@ static void test_typeinfo(const WCHAR *parse_func_name)
SET_EXPECT(OnStateChange_INITIALIZED);
SET_EXPECT(OnStateChange_CLOSED);
hr = IActiveScript_Close(script);
ok(hr == S_OK, "Close failed: %08x\n", hr);
ok(hr == S_OK, "Close failed: %08lx\n", hr);
CHECK_CALLED(OnStateChange_DISCONNECTED);
CHECK_CALLED(OnStateChange_INITIALIZED);
CHECK_CALLED(OnStateChange_CLOSED);
......
......@@ -217,7 +217,7 @@ static BOOL is_lang_english(void)
static void _test_grfdex(unsigned line, DWORD grfdex, DWORD expect)
{
expect |= invoke_version << 28;
ok_(__FILE__,line)(grfdex == expect, "grfdex = %x, expected %x\n", grfdex, expect);
ok_(__FILE__,line)(grfdex == expect, "grfdex = %lx, expected %lx\n", grfdex, expect);
}
static void close_script(IActiveScript *script)
......@@ -226,10 +226,10 @@ static void close_script(IActiveScript *script)
ULONG ref;
hres = IActiveScript_Close(script);
ok(hres == S_OK, "Close failed: %08x\n", hres);
ok(hres == S_OK, "Close failed: %08lx\n", hres);
ref = IActiveScript_Release(script);
ok(!ref, "ref=%u\n", ref);
ok(!ref, "ref=%lu\n", ref);
}
static HRESULT WINAPI EnumVARIANT_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv)
......@@ -263,7 +263,7 @@ static HRESULT WINAPI EnumVARIANT_Next(
ULONG *pCeltFetched)
{
ok(rgVar != NULL, "rgVar is NULL\n");
ok(celt == 1, "celt = %d\n", celt);
ok(celt == 1, "celt = %ld\n", celt);
ok(pCeltFetched == NULL, "pCeltFetched is not NULL\n");
if (!rgVar)
......@@ -394,7 +394,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
{
ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
ok(0, "unexpected call %s %lx\n", wine_dbgstr_w(bstrName), grfdex);
return E_NOTIMPL;
}
......@@ -446,7 +446,7 @@ static HRESULT WINAPI testObj_Invoke(IDispatchEx *iface, DISPID id,
return S_OK;
}
ok(0, "unexpected call %x\n", id);
ok(0, "unexpected call %lx\n", id);
return DISP_E_MEMBERNOTFOUND;
}
......@@ -559,7 +559,7 @@ static HRESULT WINAPI testObj_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
return S_OK;
}
ok(0, "unexpected call %x\n", id);
ok(0, "unexpected call %lx\n", id);
return DISP_E_MEMBERNOTFOUND;
}
......@@ -612,7 +612,7 @@ static HRESULT WINAPI dispexFunc_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
ok(pdp != NULL, "pdp == NULL\n");
ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs != NULL\n");
ok(*pdp->rgdispidNamedArgs == DISPID_THIS, "*rgdispidNamedArgs = %d\n", *pdp->rgdispidNamedArgs);
ok(*pdp->rgdispidNamedArgs == DISPID_THIS, "*rgdispidNamedArgs = %ld\n", *pdp->rgdispidNamedArgs);
ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(res != NULL, "res == NULL\n");
......@@ -633,7 +633,7 @@ static HRESULT WINAPI dispexFunc_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
V_VT(res) = VT_NULL;
return S_OK;
default:
ok(0, "unexpected call %x\n", id);
ok(0, "unexpected call %lx\n", id);
return DISP_E_MEMBERNOTFOUND;
}
}
......@@ -1145,11 +1145,11 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]);
ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%d\n", V_I4(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg)=%ld\n", V_I4(pdp->rgvarg));
return S_OK;
case DISPID_GLOBAL_TESTPROPPUTREF:
......@@ -1161,7 +1161,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]);
ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(pdp->rgvarg)=%d\n", V_VT(pdp->rgvarg));
......@@ -1418,7 +1418,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
HRESULT hres;
hres = IActiveScript_GetScriptState(script_engine, &state);
ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptState failed: %08lx\n", hres);
V_VT(pvarRes) = VT_I4;
V_I4(pvarRes) = state;
......@@ -1438,18 +1438,18 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]);
ok(!pvarRes, "pvarRes != NULL\n");
ok(pei != NULL, "pei == NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 2, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2));
return S_OK;
case DISPID_GLOBAL_PROPARGPUTOP:
......@@ -1468,10 +1468,10 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(pvarRes != NULL, "pvarRes = NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 1, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 0, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
V_VT(pvarRes) = VT_I4;
V_I4(pvarRes) = 6;
......@@ -1480,20 +1480,20 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
CHECK_EXPECT(global_propargputop_put_i);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
ok(pdp->rgdispidNamedArgs[0] == DISPID_PROPERTYPUT, "pdp->rgdispidNamedArgs[0] = %ld\n", pdp->rgdispidNamedArgs[0]);
ok(pdp->rgdispidNamedArgs != NULL, "rgdispidNamedArgs == NULL\n");
ok(pdp->cArgs == 3, "cArgs = %d\n", pdp->cArgs);
ok(pdp->cNamedArgs == 1, "cNamedArgs = %d\n", pdp->cNamedArgs);
ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg) == VT_I4, "V_VT(pdp->rgvarg) = %d\n", V_VT(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %d\n", V_I4(pdp->rgvarg));
ok(V_I4(pdp->rgvarg) == 8, "V_I4(pdp->rgvarg) = %ld\n", V_I4(pdp->rgvarg));
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 1, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 0, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2));
break;
default:
ok(0, "wFlags = %x\n", wFlags);
......@@ -1507,41 +1507,41 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
HRESULT hres;
hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&dispex);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
str = SysAllocString(L"Object");
hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseSensitive, &id);
SysFreeString(str);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, NULL, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD, pdp, pvarRes, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
VariantClear(pvarRes);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_METHOD|DISPATCH_PROPERTYGET, pdp, NULL, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, pvarRes, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
VariantClear(pvarRes);
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT, pdp, NULL, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, id, lcid, DISPATCH_CONSTRUCT|DISPATCH_PROPERTYGET, pdp, pvarRes, pei, pspCaller);
ok(hres == E_INVALIDARG, "hres = %x\n", hres);
ok(hres == E_INVALIDARG, "hres = %lx\n", hres);
V_VT(pvarRes) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
ok(hres == S_OK, "hres = %x\n", hres);
ok(hres == S_OK, "hres = %lx\n", hres);
ok(V_VT(pvarRes) == VT_DISPATCH, "V_VT(pvarRes) = %d\n", V_VT(pvarRes));
IDispatchEx_Release(dispex);
return S_OK;
......@@ -1615,16 +1615,16 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(!pvarRes, "pvarRes != NULL\n");
ok(V_VT(pdp->rgvarg+1) == VT_I4, "V_VT(pdp->rgvarg+1) = %d\n", V_VT(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %d\n", V_I4(pdp->rgvarg+1));
ok(V_I4(pdp->rgvarg+1) == 10, "V_I4(pdp->rgvarg+1) = %ld\n", V_I4(pdp->rgvarg+1));
ok(V_VT(pdp->rgvarg+2) == VT_I4, "V_VT(pdp->rgvarg+2) = %d\n", V_VT(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %d\n", V_I4(pdp->rgvarg+2));
ok(V_I4(pdp->rgvarg+2) == 10, "V_I4(pdp->rgvarg+2) = %ld\n", V_I4(pdp->rgvarg+2));
ok(V_VT(pdp->rgvarg+3) == VT_I4, "V_VT(pdp->rgvarg+3) = %d\n", V_VT(pdp->rgvarg+3));
ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %d\n", V_I4(pdp->rgvarg+3));
ok(V_I4(pdp->rgvarg+3) == 22, "V_I4(pdp->rgvarg+3) = %ld\n", V_I4(pdp->rgvarg+3));
ok(V_VT(pdp->rgvarg+4) == VT_I4, "V_VT(pdp->rgvarg+4) = %d\n", V_VT(pdp->rgvarg+4));
ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %d\n", V_I4(pdp->rgvarg+4));
ok(V_I4(pdp->rgvarg+4) == 22, "V_I4(pdp->rgvarg+4) = %ld\n", V_I4(pdp->rgvarg+4));
ok(V_VT(pdp->rgvarg+5) == VT_DISPATCH, "V_VT(pdp->rgvarg+5) = %d\n", V_VT(pdp->rgvarg+5));
ok(V_DISPATCH(pdp->rgvarg+5) == (IDispatch*)&testObj, "V_DISPATCH(pdp->rgvarg+5) != testObj\n");
......@@ -1654,7 +1654,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_VT(&v) = VT_I4;
V_I4(&v) = 2;
hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
return S_OK;
}
......@@ -1677,7 +1677,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(arg) = %d\n", V_VT(pdp->rgvarg));
hres = IDispatch_QueryInterface(V_DISPATCH(pdp->rgvarg), &IID_IDispatchEx, (void**)&eval_func);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
params.rgvarg = &arg;
params.rgdispidNamedArgs = NULL;
......@@ -1688,9 +1688,9 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
V_BSTR(&arg) = SysAllocString(L"var x = 5; v");
V_VT(&res) = VT_ERROR;
hres = IDispatchEx_InvokeEx(eval_func, DISPID_VALUE, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
ok(V_I4(&res) == 2, "eval returned %d\n", V_I4(&res));
ok(V_I4(&res) == 2, "eval returned %ld\n", V_I4(&res));
SysFreeString(V_BSTR(&arg));
IDispatchEx_Release(eval_func);
return S_OK;
......@@ -1764,7 +1764,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
}
}
ok(0, "unexpected call %x\n", id);
ok(0, "unexpected call %lx\n", id);
return DISP_E_MEMBERNOTFOUND;
}
......@@ -1781,7 +1781,7 @@ static HRESULT WINAPI Global_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
CHECK_EXPECT(DeleteMemberByDispID_error);
return E_FAIL;
default:
ok(0, "id = %d\n", id);
ok(0, "id = %ld\n", id);
}
return E_FAIL;
......@@ -1841,7 +1841,7 @@ static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *p
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName,
DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
{
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %x\n", dwReturnMask);
ok(dwReturnMask == SCRIPTINFO_IUNKNOWN, "unexpected dwReturnMask %lx\n", dwReturnMask);
ok(!ppti, "ppti != NULL\n");
if(!lstrcmpW(pstrName, L"testVal"))
......@@ -1935,7 +1935,7 @@ static HRESULT set_script_prop(IActiveScript *engine, DWORD property, VARIANT *v
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptProperty,
(void**)&script_prop);
ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptProperty iface: %08lx\n", hres);
hres = IActiveScriptProperty_SetProperty(script_prop, property, NULL, val);
IActiveScriptProperty_Release(script_prop);
......@@ -1951,12 +1951,12 @@ static IActiveScript *create_script(void)
hres = CoCreateInstance(engine_clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IActiveScript, (void**)&script);
ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
ok(hres == S_OK, "CoCreateInstance failed: %08lx\n", hres);
V_VT(&v) = VT_I4;
V_I4(&v) = invoke_version;
hres = set_script_prop(script, SCRIPTPROP_INVOKEVERSIONING, &v);
ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08x\n", hres);
ok(hres == S_OK || broken(hres == E_NOTIMPL), "SetProperty(SCRIPTPROP_INVOKEVERSIONING) failed: %08lx\n", hres);
if(invoke_version && FAILED(hres)) {
IActiveScript_Release(script);
return NULL;
......@@ -1976,7 +1976,7 @@ static HRESULT parse_script(DWORD flags, const WCHAR *script_str)
return S_OK;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
if (FAILED(hres))
{
IActiveScript_Release(engine);
......@@ -1984,20 +1984,20 @@ static HRESULT parse_script(DWORD flags, const WCHAR *script_str)
}
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|flags);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres);
ok(script_disp != NULL, "script_disp == NULL\n");
ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
......@@ -2026,32 +2026,32 @@ static HRESULT invoke_procedure(const WCHAR *args, const WCHAR *source, DISPPARA
return S_OK;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParseProcedure2, (void**)&parse_proc);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParseProcedure2_ParseProcedureText(parse_proc, source, args, L"", NULL, NULL, NULL, 0, 0,
SCRIPTPROC_HOSTMANAGESSOURCE|SCRIPTPROC_IMPLICIT_THIS|SCRIPTPROC_IMPLICIT_PARENTS, &disp);
ok(hres == S_OK, "ParseProcedureText failed: %08x\n", hres);
ok(hres == S_OK, "ParseProcedureText failed: %08lx\n", hres);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
IDispatch_Release(disp);
V_VT(&res) = VT_EMPTY;
hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, 0, DISPATCH_METHOD, dp, &res, &ei, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%x)\n", V_VT(&res), V_I4(&res));
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&res) == VT_BOOL && V_BOOL(&res), "InvokeEx returned vt %d (%lx)\n", V_VT(&res), V_I4(&res));
IDispatchEx_Release(dispex);
IActiveScriptParseProcedure2_Release(parse_proc);
......@@ -2072,7 +2072,7 @@ static HRESULT parse_htmlscript(const WCHAR *script_str)
return E_FAIL;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
if (FAILED(hres))
{
IActiveScript_Release(engine);
......@@ -2080,17 +2080,17 @@ static HRESULT parse_htmlscript(const WCHAR *script_str)
}
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScriptParse_ParseScriptText(parser, script_str, NULL, NULL, L"</SCRIPT>", 0, 0, 0, NULL, NULL);
......@@ -2334,23 +2334,23 @@ static void test_error_reports(void)
engine = create_script();
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite_CheckError);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres);
ok(script_disp != NULL, "script_disp == NULL\n");
ok(script_disp != (IDispatch*)&Global, "script_disp == Global\n");
......@@ -2359,7 +2359,7 @@ static void test_error_reports(void)
hres = IActiveScriptParse_ParseScriptText(parser, tests[i].script, NULL, NULL, NULL, 10, 0, 0, NULL, NULL);
todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE)
ok(hres == SCRIPT_E_REPORTED || (tests[i].error == JS_E_EXCEPTION_THROWN && hres == SCRIPT_E_PROPAGATE),
"[%u] got: 0x%08x for %s\n", i, hres, wine_dbgstr_w(tests[i].script));
"[%u] got: 0x%08lx for %s\n", i, hres, wine_dbgstr_w(tests[i].script));
todo_wine_if(tests[i].todo_flags & ERROR_TODO_PARSE)
CHECK_CALLED(ActiveScriptSite_OnScriptError);
......@@ -2372,43 +2372,43 @@ static void test_error_reports(void)
EXCEPINFO ei;
hres = IActiveScriptError_GetSourcePosition(script_error, NULL, NULL, NULL);
ok(hres == S_OK, "GetSourcePosition failed %08x\n", hres);
ok(hres == S_OK, "GetSourcePosition failed %08lx\n", hres);
source_context = 0xdeadbeef;
hres = IActiveScriptError_GetSourcePosition(script_error, &source_context, NULL, NULL);
ok(hres == S_OK, "GetSourcePosition failed0x%08x\n", hres);
ok(source_context == 10, "source_context = %x\n", source_context);
ok(hres == S_OK, "GetSourcePosition failed0x%08lx\n", hres);
ok(source_context == 10, "source_context = %lx\n", source_context);
line_number = 0xdeadbeef;
hres = IActiveScriptError_GetSourcePosition(script_error, NULL, &line_number, NULL);
ok(hres == S_OK, "GetSourcePosition failed%08x\n", hres);
ok(line_number == tests[i].line, "[%u] line = %u expected %u\n", i, line_number, tests[i].line);
ok(hres == S_OK, "GetSourcePosition failed%08lx\n", hres);
ok(line_number == tests[i].line, "[%u] line = %lu expected %u\n", i, line_number, tests[i].line);
character = 0xdeadbeef;
hres = IActiveScriptError_GetSourcePosition(script_error, NULL, NULL, &character);
ok(hres == S_OK, "GetSourcePosition failed: %08x\n", hres);
ok(character == tests[i].character, "[%u] character = %u expected %u\n", i, character, tests[i].character);
ok(hres == S_OK, "GetSourcePosition failed: %08lx\n", hres);
ok(character == tests[i].character, "[%u] character = %lu expected %u\n", i, character, tests[i].character);
hres = IActiveScriptError_GetSourceLineText(script_error, NULL);
ok(hres == E_POINTER, "GetSourceLineText returned %08x\n", hres);
ok(hres == E_POINTER, "GetSourceLineText returned %08lx\n", hres);
line_text = (BSTR)0xdeadbeef;
hres = IActiveScriptError_GetSourceLineText(script_error, &line_text);
if (tests[i].line_text)
{
ok(hres == S_OK, "GetSourceLineText failed: %08x\n", hres);
ok(hres == S_OK, "GetSourceLineText failed: %08lx\n", hres);
ok(line_text != NULL && !lstrcmpW(line_text, tests[i].line_text), "[%u] GetSourceLineText returned %s expected %s\n",
i, wine_dbgstr_w(line_text), wine_dbgstr_w(tests[i].line_text));
}
else
{
ok(hres == E_FAIL, "GetSourceLineText failed: %08x\n", hres);
ok(hres == E_FAIL, "GetSourceLineText failed: %08lx\n", hres);
}
if (SUCCEEDED(hres))
SysFreeString(line_text);
hres = IActiveScriptError_GetExceptionInfo(script_error, NULL);
ok(hres == E_POINTER, "GetExceptionInfo failed: %08x\n", hres);
ok(hres == E_POINTER, "GetExceptionInfo failed: %08lx\n", hres);
ei.wCode = 0xdead;
ei.wReserved = 0xdead;
......@@ -2421,13 +2421,13 @@ static void test_error_reports(void)
ei.scode = 0xdeadbeef;
hres = IActiveScriptError_GetExceptionInfo(script_error, &ei);
ok(hres == S_OK, "GetExceptionInfo failed: %08x\n", hres);
ok(hres == S_OK, "GetExceptionInfo failed: %08lx\n", hres);
todo_wine_if(tests[i].todo_flags & ERROR_TODO_SCODE)
ok(ei.scode == tests[i].error, "[%u] scode = %08x, expected %08x\n", i, ei.scode, tests[i].error);
ok(ei.scode == tests[i].error, "[%u] scode = %08lx, expected %08lx\n", i, ei.scode, tests[i].error);
ok(ei.wCode == 0, "wCode = %x\n", ei.wCode);
todo_wine_if(tests[i].reserved_lcid)
ok(ei.wReserved == (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0), "[%u] wReserved = %x expected %x\n",
ok(ei.wReserved == (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0), "[%u] wReserved = %x expected %lx\n",
i, ei.wReserved, (tests[i].reserved_lcid ? GetUserDefaultLCID() : 0));
if (is_lang_english())
{
......@@ -2444,7 +2444,7 @@ static void test_error_reports(void)
ok(!ei.bstrDescription, "[%u] bstrDescription = %s expected NULL\n", i, wine_dbgstr_w(ei.bstrDescription));
}
ok(!ei.bstrHelpFile, "bstrHelpFile = %s\n", wine_dbgstr_w(ei.bstrHelpFile));
ok(!ei.dwHelpContext, "dwHelpContext = %d\n", ei.dwHelpContext);
ok(!ei.dwHelpContext, "dwHelpContext = %ld\n", ei.dwHelpContext);
ok(!ei.pvReserved, "pvReserved = %p\n", ei.pvReserved);
ok(!ei.pfnDeferredFillIn, "pfnDeferredFillIn = %p\n", ei.pfnDeferredFillIn);
......@@ -2467,7 +2467,7 @@ static void _run_script(unsigned line, const WCHAR *src)
HRESULT hres;
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
ok_(__FILE__,line)(hres == S_OK, "script %s failed: %08x\n", wine_dbgstr_w(src), hres);
ok_(__FILE__,line)(hres == S_OK, "script %s failed: %08lx\n", wine_dbgstr_w(src), hres);
}
static BSTR get_script_from_file(const char *filename)
......@@ -2479,7 +2479,7 @@ static BSTR get_script_from_file(const char *filename)
file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
if(file == INVALID_HANDLE_VALUE) {
trace("Could not open file: %u\n", GetLastError());
trace("Could not open file: %lu\n", GetLastError());
return NULL;
}
......@@ -2488,14 +2488,14 @@ static BSTR get_script_from_file(const char *filename)
map = CreateFileMappingW(file, NULL, PAGE_READONLY, 0, 0, NULL);
CloseHandle(file);
if(map == INVALID_HANDLE_VALUE) {
trace("Could not create file mapping: %u\n", GetLastError());
trace("Could not create file mapping: %lu\n", GetLastError());
return NULL;
}
file_map = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
CloseHandle(map);
if(!file_map) {
trace("MapViewOfFile failed: %u\n", GetLastError());
trace("MapViewOfFile failed: %lu\n", GetLastError());
return NULL;
}
......@@ -2520,7 +2520,7 @@ static void run_from_file(const char *filename)
strict_dispid_check = FALSE;
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, script_str);
SysFreeString(script_str);
ok(hres == S_OK, "parse_script failed: %08x\n", hres);
ok(hres == S_OK, "parse_script failed: %08lx\n", hres);
}
static BSTR load_res(const char *name)
......@@ -2559,7 +2559,7 @@ static void run_from_res(const char *name)
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
ok(hres == S_OK, "parse_script failed: %08x\n", hres);
ok(hres == S_OK, "parse_script failed: %08lx\n", hres);
SysFreeString(str);
}
......@@ -2574,7 +2574,7 @@ static void test_isvisible(BOOL global_members)
return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
if (FAILED(hres))
{
IActiveScript_Release(engine);
......@@ -2582,32 +2582,32 @@ static void test_isvisible(BOOL global_members)
}
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
if(global_members)
SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScript_AddNamedItem(engine, L"testVal",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|
(global_members ? SCRIPTITEM_GLOBALMEMBERS : 0));
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
if(global_members)
CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
if(!global_members)
SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
if(!global_members)
CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScriptParse_ParseScriptText(parser, L"var v = testVal;", NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
IActiveScript_Release(engine);
IActiveScriptParse_Release(parser);
......@@ -2625,27 +2625,27 @@ static void test_start(void)
return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
str = SysAllocString(L"ok(getScriptState() === 5, \"getScriptState = \" + getScriptState());\n"
L"reportSuccess();");
hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
SysFreeString(str);
SET_EXPECT(global_success_d);
SET_EXPECT(global_success_i);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
......@@ -2666,28 +2666,28 @@ static void test_automagic(void)
return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test", SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
str = SysAllocString(L"function bindEventHandler::eventName() {}\n"
L"reportSuccess();");
hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
SysFreeString(str);
SET_EXPECT(BindHandler);
SET_EXPECT(global_success_d);
SET_EXPECT(global_success_i);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
CHECK_CALLED(BindHandler);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
......@@ -2708,22 +2708,22 @@ static HRESULT parse_script_expr(const WCHAR *expr, VARIANT *res, IActiveScript
return E_FAIL;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScript_AddNamedItem(engine, L"testVal",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScriptParse_ParseScriptText(parser, expr, NULL, NULL, NULL, 0, 0, SCRIPTTEXT_ISEXPRESSION, res, NULL);
IActiveScriptParse_Release(parser);
......@@ -2750,18 +2750,18 @@ static void test_retval(void)
return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScript_AddNamedItem(engine, L"testVal",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
CHECK_CALLED(GetItemInfo_testVal);
str = SysAllocString(L"reportSuccess(), true");
......@@ -2771,16 +2771,16 @@ static void test_retval(void)
hres = IActiveScriptParse_ParseScriptText(parser, str, NULL, NULL, NULL, 0, 0, 0, &res, NULL);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
ok(V_VT(&res) == VT_EMPTY, "V_VT(&res) = %d\n", V_VT(&res));
SysFreeString(str);
hres = IActiveScript_GetScriptState(engine, &state);
ok(hres == S_OK, "GetScriptState failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptState failed: %08lx\n", hres);
ok(state == SCRIPTSTATE_INITIALIZED, "state = %d\n", state);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
IActiveScriptParse_Release(parser);
......@@ -2797,13 +2797,13 @@ static void test_default_value(void)
HRESULT hres;
hres = parse_script_expr(L"new Date()", &v, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08x\n", hres);
ok(hres == S_OK || broken(hres == 0x8000ffff), "Invoke failed: %08lx\n", hres);
if(hres == S_OK)
{
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
......@@ -2812,26 +2812,26 @@ static void test_default_value(void)
IDispatch_Release(disp);
hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return \"foo\";}; arr.valueOf = function() {return 42;}; arr", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 42, "V_I4(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
IDispatch_Release(disp);
close_script(script);
hres = parse_script_expr(L"var arr = [5]; arr.toString = function() {return \"foo\";}; arr", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!lstrcmpW(V_BSTR(&v), L"foo"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
......@@ -2839,13 +2839,13 @@ static void test_default_value(void)
close_script(script);
hres = parse_script_expr(L"var arr = [5]; arr", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!lstrcmpW(V_BSTR(&v), L"5"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
......@@ -2853,13 +2853,13 @@ static void test_default_value(void)
close_script(script);
hres = parse_script_expr(L"var obj = Object.prototype; delete obj.valueOf; obj", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "Invoke failed: %08x\n", hres);
ok(hres == S_OK, "Invoke failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!lstrcmpW(V_BSTR(&v), L"[object Object]"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
VariantClear(&v);
......@@ -2867,18 +2867,18 @@ static void test_default_value(void)
close_script(script);
hres = parse_script_expr(L"var obj = Object.prototype; delete obj.toString; obj", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres);
IDispatch_Release(disp);
close_script(script);
hres = parse_script_expr(L"Object.prototype", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
......@@ -2887,18 +2887,18 @@ static void test_default_value(void)
dp.rgvarg = &v;
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres);
IDispatch_Release(disp);
close_script(script);
hres = parse_script_expr(L"var f = function() {return 42;}; f", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
disp = V_DISPATCH(&v);
V_VT(&v) = VT_EMPTY;
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_PROPERTYPUT, &dp, NULL, NULL, NULL);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08x\n", hres);
ok(hres == DISP_E_MEMBERNOTFOUND, "Invoke failed: %08lx\n", hres);
IDispatch_Release(disp);
close_script(script);
}
......@@ -2911,38 +2911,38 @@ static void test_script_exprs(void)
testing_expr = TRUE;
hres = parse_script_expr(L"true", &v, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
hres = parse_script_expr(L"false, true", &v, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
SET_EXPECT(global_success_d);
SET_EXPECT(global_success_i);
hres = parse_script_expr(L"reportSuccess(); true", &v, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
hres = parse_script_expr(L"if(false) true", &v, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v));
hres = parse_script_expr(L"return testPropGet", &v, NULL);
ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
ok(hres == 0x800a03fa, "parse_script_expr failed: %08lx\n", hres);
hres = parse_script_expr(L"reportSuccess(); return true", &v, NULL);
ok(hres == 0x800a03fa, "parse_script_expr failed: %08x\n", hres);
ok(hres == 0x800a03fa, "parse_script_expr failed: %08lx\n", hres);
SET_EXPECT(global_success_d);
SET_EXPECT(global_success_i);
hres = parse_script_expr(L"reportSuccess(); true", NULL, NULL);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
......@@ -2963,65 +2963,65 @@ static void test_invokeex(void)
HRESULT hres;
hres = parse_script_expr(L"var o = {func: function() {return 3;}, prop: 6}; o", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
VariantClear(&v);
str = SysAllocString(L"func");
hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
str = SysAllocString(L"prop");
hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 3, "V_I4(v) = %d\n", V_I4(&v));
ok(V_I4(&v) == 3, "V_I4(v) = %ld\n", V_I4(&v));
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
hres = IActiveScript_SetScriptState(script, SCRIPTSTATE_UNINITIALIZED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
str = SysAllocString(L"func");
hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08x\n", hres);
ok(hres == E_UNEXPECTED || broken(hres == 0x800a1393), "InvokeEx failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
IDispatchEx_Release(dispex);
IActiveScript_Release(script);
/* test InvokeEx following prototype chain of builtin object (PROP_PROTREF) */
hres = parse_script_expr(L"o = new Array(); o.push(\"foo\"); o", &v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
VariantClear(&v);
str = SysAllocString(L"push");
hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
dp.rgvarg = &arg;
dp.cArgs = 1;
......@@ -3029,17 +3029,17 @@ static void test_invokeex(void)
V_BSTR(&arg) = SysAllocString(L"bar");
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
SysFreeString(V_BSTR(&arg));
str = SysAllocString(L"join");
hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
V_BSTR(&arg) = SysAllocString(L";");
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
SysFreeString(V_BSTR(&arg));
ok(V_VT(&v) == VT_BSTR, "V_VT(v) = %d\n", V_VT(&v));
ok(!lstrcmpW(V_BSTR(&v), L"foo;bar"), "V_BSTR(v) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
......@@ -3056,40 +3056,40 @@ static void test_invokeex(void)
hres = parse_script_expr(L"function c() { this.func = function() { return this.prop1 * this.prop2 };"
L"this.prop1 = 6; this.prop2 = 9; }; var o = new c(); o.prop2 = 7; o",
&v, &script);
ok(hres == S_OK, "parse_script_expr failed: %08x\n", hres);
ok(hres == S_OK, "parse_script_expr failed: %08lx\n", hres);
ok(V_VT(&v) == VT_DISPATCH, "V_VT(v) = %d\n", V_VT(&v));
hres = IDispatch_QueryInterface(V_DISPATCH(&v), &IID_IDispatchEx, (void**)&dispex);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
VariantClear(&v);
str = SysAllocString(L"prop1");
hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %d\n", V_I4(&v));
ok(V_I4(&v) == 6, "V_I4(v) = %ld\n", V_I4(&v));
str = SysAllocString(L"prop2");
hres = IDispatchEx_GetDispID(dispex, str, 0, &prop_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 7, "V_I4(v) = %d\n", V_I4(&v));
ok(V_I4(&v) == 7, "V_I4(v) = %ld\n", V_I4(&v));
str = SysAllocString(L"func");
hres = IDispatchEx_GetDispID(dispex, str, 0, &func_id);
SysFreeString(str);
ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
ok(hres == S_OK, "GetDispID failed: %08lx\n", hres);
hres = IDispatchEx_InvokeEx(dispex, func_id, 0, DISPATCH_METHOD, &dp, &v, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
ok(V_I4(&v) == 42, "V_I4(v) = %s\n", wine_dbgstr_variant(&v));
......@@ -3112,34 +3112,34 @@ static void test_eval(void)
engine = create_script();
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
SET_EXPECT(GetItemInfo_testVal);
hres = IActiveScript_AddNamedItem(engine, L"testVal",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
CHECK_CALLED(GetItemInfo_testVal);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
hres = IActiveScript_GetScriptDispatch(engine, NULL, &script_disp);
ok(hres == S_OK, "GetScriptDispatch failed: %08x\n", hres);
ok(hres == S_OK, "GetScriptDispatch failed: %08lx\n", hres);
ok(script_disp != NULL, "script_disp == NULL\n");
hres = IDispatch_QueryInterface(script_disp, &IID_IDispatchEx, (void**)&script_dispex);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
ok(hres == S_OK, "Could not get IDispatchEx iface: %08lx\n", hres);
IDispatch_Release(script_disp);
str = SysAllocString(L"eval");
hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id);
ok(hres == S_OK, "Could not get eval dispid: %08x\n", hres);
ok(hres == S_OK, "Could not get eval dispid: %08lx\n", hres);
SysFreeString(str);
params.rgvarg = &arg;
......@@ -3151,30 +3151,30 @@ static void test_eval(void)
V_BSTR(&arg) = SysAllocString(L"var v = 1;");
V_VT(&res) = VT_ERROR;
hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&res) == VT_EMPTY, "eval returned type %u\n", V_VT(&res));
SysFreeString(V_BSTR(&arg));
V_BSTR(&arg) = SysAllocString(L"v");
V_VT(&res) = VT_ERROR;
hres = IDispatchEx_InvokeEx(script_dispex, id, 0, DISPATCH_METHOD, &params, &res, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res));
ok(V_I4(&res) == 1, "eval returned %ld\n", V_I4(&res));
SysFreeString(V_BSTR(&arg));
str = SysAllocString(L"v");
hres = IDispatchEx_GetDispID(script_dispex, str, 0, &v_id);
ok(hres == S_OK, "Could not get v dispid: %08x\n", hres);
ok(hres == S_OK, "Could not get v dispid: %08lx\n", hres);
SysFreeString(str);
params.rgvarg = NULL;
params.cArgs = 0;
V_VT(&res) = VT_ERROR;
hres = IDispatchEx_InvokeEx(script_dispex, v_id, 0, DISPATCH_PROPERTYGET, &params, &res, NULL, NULL);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
ok(hres == S_OK, "InvokeEx failed: %08lx\n", hres);
ok(V_VT(&res) == VT_I4, "eval returned type %u\n", V_VT(&res));
ok(V_I4(&res) == 1, "eval returned %d\n", V_I4(&res));
ok(V_I4(&res) == 1, "eval returned %ld\n", V_I4(&res));
SET_EXPECT(global_calleval_i);
hres = IActiveScriptParse_ParseScriptText(parser,
......@@ -3184,12 +3184,12 @@ static void test_eval(void)
L" ok(x === 5, 'x = ' + x);"
L"})();",
NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
CHECK_CALLED(global_calleval_i);
str = SysAllocString(L"x");
hres = IDispatchEx_GetDispID(script_dispex, str, 0, &id);
ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(x) returned %08x\n", hres);
ok(hres == DISP_E_UNKNOWNNAME, "GetDispID(x) returned %08lx\n", hres);
SysFreeString(str);
IDispatchEx_Release(script_dispex);
......@@ -3232,7 +3232,7 @@ static void run_bom_tests(void)
SET_EXPECT(global_success_i);
src = SysAllocString(bom_tests[i].str);
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
ok(hres == S_OK, "test %s failed with %08x\n", wine_dbgstr_w(src), hres);
ok(hres == S_OK, "test %s failed with %08lx\n", wine_dbgstr_w(src), hres);
SysFreeString(src);
CHECK_CALLED(global_success_d);
CHECK_CALLED(global_success_i);
......@@ -3241,7 +3241,7 @@ static void run_bom_tests(void)
{
src = SysAllocString(bom_tests[i].str);
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
todo_wine ok(hres == bom_tests[i].hres, "test %s returned with %08x\n", wine_dbgstr_w(src), hres);
todo_wine ok(hres == bom_tests[i].hres, "test %s returned with %08lx\n", wine_dbgstr_w(src), hres);
SysFreeString(src);
}
}
......@@ -3320,7 +3320,7 @@ static BOOL run_tests(void)
SET_EXPECT(global_propdeleteerror_d);
SET_EXPECT(DeleteMemberByDispID_error);
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"delete testPropDeleteError;");
ok(hres == E_FAIL, "unexpected result %08x\n", hres);
ok(hres == E_FAIL, "unexpected result %08lx\n", hres);
CHECK_CALLED(global_propdeleteerror_d);
CHECK_CALLED(DeleteMemberByDispID_error);
......@@ -3473,14 +3473,14 @@ static BOOL run_tests(void)
SET_EXPECT(testobj_getidfail_d);
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"testObj.notExists = testObj.getIDFail;");
ok(hres == E_FAIL, "parse_script returned %08x\n", hres);
ok(hres == E_FAIL, "parse_script returned %08lx\n", hres);
CHECK_CALLED(testobj_getidfail_d);
SET_EXPECT(global_propget_d);
SET_EXPECT(global_propget_i);
SET_EXPECT(testobj_getidfail_d);
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, L"testObj.getIDFail = testPropGet;");
ok(hres == E_FAIL, "parse_script returned %08x\n", hres);
ok(hres == E_FAIL, "parse_script returned %08lx\n", hres);
CHECK_CALLED(global_propget_d);
CHECK_CALLED(global_propget_i);
CHECK_CALLED(testobj_getidfail_d);
......@@ -3600,20 +3600,20 @@ static BOOL run_tests(void)
test_automagic();
hres = parse_script(0, L"test.testThis2(this);");
ok(hres == S_OK, "unexpected result %08x\n", hres);
ok(hres == S_OK, "unexpected result %08lx\n", hres);
hres = parse_script(0, L"(function () { test.testThis2(this); })();");
ok(hres == S_OK, "unexpected result %08x\n", hres);
ok(hres == S_OK, "unexpected result %08lx\n", hres);
hres = parse_htmlscript(L"<!--");
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = parse_htmlscript(L"-->");
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = parse_htmlscript(L"<!--\nvar a=1;\n-->\n");
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = parse_htmlscript(L"<!--\n<!-- ignore this\n-->\n");
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = parse_htmlscript(L"var a=1;\nif(a-->0) a=5;\n");
ok(hres == S_OK, "ParseScriptText failed: %08x\n", hres);
ok(hres == S_OK, "ParseScriptText failed: %08lx\n", hres);
hres = parse_htmlscript(L"var a=1;\nif(a\n-->0) a=5;\n");
ok(hres != S_OK, "ParseScriptText have not failed\n");
......@@ -3689,31 +3689,31 @@ static void run_encoded_tests(void)
src = SysAllocString(L"#@~^EAA*AA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
SysFreeString(src);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* vv */
src = SysAllocString(L"#@~^EAAAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
SysFreeString(src);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* v */
src = SysAllocString(L"#@~^EAAAAA^=.\x7fwGMYUEm1+kd`*iAQYAAA==^#~@");
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
SysFreeString(src);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* v */
src = SysAllocString(L"#@~^EAAAAA==.\x7fwGMYUEm1ekd`*iAQYAAA==^#~@");
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
SysFreeString(src);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
/* vv */
src = SysAllocString(L"#@~^EAAAAA==.\x7fwGMYUEm1+kd`*iAQYAAA==^~#@");
hres = parse_script(SCRIPTITEM_GLOBALMEMBERS, src);
SysFreeString(src);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08x\n", hres);
ok(hres == JS_E_INVALID_CHAR, "parse_script failed %08lx\n", hres);
}
static void run_benchmark(const char *script_name)
......@@ -3729,33 +3729,33 @@ static void run_benchmark(const char *script_name)
return;
hres = IActiveScript_QueryInterface(engine, &IID_IActiveScriptParse, (void**)&parser);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08x\n", hres);
ok(hres == S_OK, "Could not get IActiveScriptParse: %08lx\n", hres);
if (FAILED(hres)) {
IActiveScript_Release(engine);
return;
}
hres = IActiveScriptParse_InitNew(parser);
ok(hres == S_OK, "InitNew failed: %08x\n", hres);
ok(hres == S_OK, "InitNew failed: %08lx\n", hres);
hres = IActiveScript_SetScriptSite(engine, &ActiveScriptSite);
ok(hres == S_OK, "SetScriptSite failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptSite failed: %08lx\n", hres);
hres = IActiveScript_AddNamedItem(engine, L"test",
SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE);
ok(hres == S_OK, "AddNamedItem failed: %08x\n", hres);
ok(hres == S_OK, "AddNamedItem failed: %08lx\n", hres);
hres = IActiveScript_SetScriptState(engine, SCRIPTSTATE_STARTED);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n", hres);
ok(hres == S_OK, "SetScriptState(SCRIPTSTATE_STARTED) failed: %08lx\n", hres);
src = load_res(script_name);
start = GetTickCount();
hres = IActiveScriptParse_ParseScriptText(parser, src, NULL, NULL, NULL, 0, 0, 0, NULL, NULL);
end = GetTickCount();
ok(hres == S_OK, "%s: ParseScriptText failed: %08x\n", script_name, hres);
ok(hres == S_OK, "%s: ParseScriptText failed: %08lx\n", script_name, hres);
trace("%s ran in %u ms\n", script_name, end-start);
trace("%s ran in %lu ms\n", script_name, end-start);
IActiveScript_Release(engine);
IActiveScriptParse_Release(parser);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment