35#define IActiveScriptParse_QueryInterface IActiveScriptParse64_QueryInterface
36#define IActiveScriptParse_Release IActiveScriptParse64_Release
37#define IActiveScriptParse_InitNew IActiveScriptParse64_InitNew
38#define IActiveScriptParse_ParseScriptText IActiveScriptParse64_ParseScriptText
39#define IActiveScriptParseProcedure2_Release \
40 IActiveScriptParseProcedure2_64_Release
41#define IActiveScriptParseProcedure2_ParseProcedureText \
42 IActiveScriptParseProcedure2_64_ParseProcedureText
46#define IActiveScriptParse_QueryInterface IActiveScriptParse32_QueryInterface
47#define IActiveScriptParse_Release IActiveScriptParse32_Release
48#define IActiveScriptParse_InitNew IActiveScriptParse32_InitNew
49#define IActiveScriptParse_ParseScriptText IActiveScriptParse32_ParseScriptText
50#define IActiveScriptParseProcedure2_Release \
51 IActiveScriptParseProcedure2_32_Release
52#define IActiveScriptParseProcedure2_ParseProcedureText \
53 IActiveScriptParseProcedure2_32_ParseProcedureText
58 {0xf414c260,0x6ac0,0x11cf,{0xb6,0xd1,0x00,0xaa,0x00,0xbb,0xbb,0x58}};
60#define DEFINE_EXPECT(func) \
61 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
63#define SET_EXPECT(func) \
64 expect_ ## func = TRUE
66#define CHECK_EXPECT2(func) \
68 ok(expect_ ##func, "unexpected call " #func "\n"); \
69 called_ ## func = TRUE; \
72#define CHECK_EXPECT(func) \
74 CHECK_EXPECT2(func); \
75 expect_ ## func = FALSE; \
78#define CHECK_CALLED(func) \
80 ok(called_ ## func, "expected " #func "\n"); \
81 expect_ ## func = called_ ## func = FALSE; \
106#define TESTOBJ_CLSID "{178fc163-f585-4e24-9c13-4bb7faf80646}"
109 {0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}};
113 {0x10200490,0xfa38,0x11d0,{0xac,0x0e,0x00,0xa0,0xc9,0xf,0xff,0xc0}};
115#define DISPID_TEST_REPORTSUCCESS 0x1000
117#define DISPID_GLOBAL_OK 0x2000
140 ok(0,
"unexpected call\n");
161 ok(pUnkSite !=
NULL,
"pUnkSite == NULL\n");
163 hres = IUnknown_QueryInterface(pUnkSite, &IID_IServiceProvider, (
void**)&
sp);
164 ok(
hres ==
S_OK,
"Could not get IServiceProvider iface: %08x\n",
hres);
165 IServiceProvider_Release(
sp);
172 ok(0,
"unexpected call\n");
202 ok(0,
"Unexpected IID_IObjectSafety query\n");
220 ok(0,
"unexpected call\n");
227 ok(0,
"unexpected call\n");
235 ok(0,
"unexpected call\n");
241 VARIANT *pVarResult, EXCEPINFO *pExcepInfo,
UINT *puArgErr)
243 ok(0,
"unexpected call\n");
255 ok(0,
"unexpected call\n");
261 ok(0,
"unexpected call\n");
267 ok(0,
"unexpected call\n");
273 ok(0,
"unexpected call\n");
279 ok(0,
"unexpected call\n");
285 if(!
strcmp_wa(bstrName,
"reportSuccess")) {
286 ok(grfdex == fdexNameCaseSensitive,
"grfdex = %x\n", grfdex);
303 ok(pdp !=
NULL,
"pdp == NULL\n");
304 ok(!pdp->rgdispidNamedArgs,
"rgdispidNamedArgs != NULL\n");
305 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
306 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
307 ok(!pvarRes,
"pvarRes != NULL\n");
308 ok(pei !=
NULL,
"pei == NULL\n");
312 ok(0,
"unexpected call\n");
342 ok(grfdex == fdexNameCaseSensitive,
"grfdex = %x\n", grfdex);
356 ok(
wFlags == INVOKE_FUNC ||
wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET),
"wFlags = %x\n",
wFlags);
357 ok(pdp !=
NULL,
"pdp == NULL\n");
358 ok(pdp->rgvarg !=
NULL,
"rgvarg == NULL\n");
359 ok(!pdp->rgdispidNamedArgs,
"rgdispidNamedArgs != NULL\n");
360 ok(pdp->cArgs == 2,
"cArgs = %d\n", pdp->cArgs);
361 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
362 ok(pei !=
NULL,
"pei == NULL\n");
364 ok(
V_VT(pdp->rgvarg) ==
VT_BSTR,
"V_VT(psp->rgvargs) = %d\n",
V_VT(pdp->rgvarg));
365 ok(
V_VT(pdp->rgvarg+1) ==
VT_BOOL,
"V_VT(psp->rgvargs+1) = %d\n",
V_VT(pdp->rgvarg));
370 ok(0,
"unexpected call\n");
423 ok(!outer,
"outer = %p\n", outer);
433 ok(0,
"unexpected call\n");
449 ok(0,
"unexpected call\n");
466 ok(0,
"unexpected call\n");
475 ok(dwAction == URLACTION_ACTIVEX_RUN,
"dwAction = %x\n", dwAction);
476 ok(pPolicy !=
NULL,
"pPolicy == NULL\n");
477 ok(cbPolicy ==
sizeof(
DWORD),
"cbPolicy = %d\n", cbPolicy);
478 ok(pContext !=
NULL,
"pContext == NULL\n");
479 ok(cbContext ==
sizeof(
GUID),
"cbContext = %d\n", cbContext);
499 ok(ppPolicy !=
NULL,
"ppPolicy == NULL\n");
500 ok(pcbPolicy !=
NULL,
"pcbPolicy == NULL\n");
501 ok(pContext !=
NULL,
"pContext == NULL\n");
502 ok(cbContext ==
sizeof(
struct CONFIRMSAFETY),
"cbContext = %d\n", cbContext);
506 ok(
cs->pUnk !=
NULL,
"cs->pUnk == NULL\n");
507 ok(!
cs->dwFlags,
"dwFlags = %x\n",
cs->dwFlags);
537 ok(0,
"unexpected call\n");
557 if(
IsEqualGUID(&SID_SInternetHostSecurityManager, guidService)) {
618 ok(dwReturnMask == SCRIPTINFO_IUNKNOWN,
"unexpected dwReturnMask %x\n", dwReturnMask);
619 ok(!ppti,
"ppti != NULL\n");
632 const VARIANT *pvarResult,
const EXCEPINFO *pexcepinfo)
657#undef ACTSCPSITE_THIS
681 hres = IUnknown_QueryInterface(unk, &IID_IObjectSafety, (
void**)&safety);
686 options_all = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER;
688 options_set = options_all;
690 options_set = INTERFACE_USES_DISPEX;
692 hres = IObjectSafety_SetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, options_all, options_set);
693 ok(
hres ==
S_OK,
"SetInterfaceSafetyOptions failed: %08x\n",
hres);
695 supported =
enabled = 0xdeadbeef;
696 hres = IObjectSafety_GetInterfaceSafetyOptions(safety, &IID_IActiveScriptParse, &supported, &
enabled);
697 ok(
hres ==
S_OK,
"GetInterfaceSafetyOptions failed: %08x\n",
hres);
698 ok(supported == options_all,
"supported=%x, expected %x\n", supported, options_all);
699 ok(
enabled == options_set,
"enabled=%x, expected %x\n",
enabled, options_set);
701 IObjectSafety_Release(safety);
704#define parse_script_a(p,s) _parse_script_a(__LINE__,p,s)
718 IActiveScriptParse *
parser;
734 &IID_IActiveScript, (
void**)&
script);
743 hres = IActiveScript_QueryInterface(
script, &IID_IActiveScriptParse, (
void**)&
parser);
744 ok(
hres ==
S_OK,
"Could not get IActiveScriptParse: %08x\n",
hres);
753 SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS);
757 ok(
hres ==
S_OK,
"SetScriptState(SCRIPTSTATE_STARTED) failed: %08x\n",
hres);
759 IActiveScript_Release(
script);
763 "function testException(func, type, number) {\n"
767 " ok(e.name === type, 'e.name = ' + e.name + ', expected ' + type)\n"
768 " ok(e.number === number, 'e.number = ' + e.number + ', expected ' + number);\n"
771 " ok(false, 'exception expected');\n"
780 IActiveScriptParseProcedure2 *parse_proc;
787 ok(
hres ==
S_OK,
"Could not get IActiveScriptParseProcedure2: %08x\n",
hres);
790 hres =
IActiveScriptParseProcedure2_ParseProcedureText(parse_proc,
str,
NULL,
NULL,
NULL,
NULL,
NULL, 0, 0, 0, &disp);
794 ok(disp !=
NULL,
"disp == NULL\n");
796 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (
void**)&dispex);
797 IDispatch_Release(disp);
798 ok(
hres ==
S_OK,
"Could not get IDispatchEx iface: %08x\n",
hres);
803#define call_procedure(p,c) _call_procedure(__LINE__,p,c)
817 IActiveScriptParse *
parser;
862 IDispatchEx_Release(
proc);
882 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.TestABC'); }, 'Error', -2146827859);");
884 IDispatchEx_Release(
proc);
891 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
901 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
912 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
924 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
938 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
972 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
983 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
994 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
1038 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
1068 parse_script_a(
parser,
"testException(function() { new ActiveXObject('Wine.Test'); }, 'Error', -2146827859);");
1112 ok(
hres ==
S_OK,
"Could not register script engine: %08x\n",
hres);
1120 IActiveScriptParse *
parser;
1128 str =
a2bstr(
"if(!('localeCompare' in String.prototype)) throw 1;");
1136 IActiveScriptProperty_Release(script_prop);
1150 skip(
"Could not register ActiveX object\n");
1153 win_skip(
"Broken engine, probably too old\n");
ACPI_SIZE strlen(const char *String)
enum tagSCRIPTSTATE SCRIPTSTATE
const GUID IID_IClassFactory
#define RegCloseKey(hKey)
static IActiveScriptParse * create_script(void)
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
#define WideCharToMultiByte
#define MultiByteToWideChar
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
LCID WINAPI GetUserDefaultLCID(void)
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLenum GLuint GLenum GLsizei const GLchar * buf
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
const IID IID_IObjectWithSite
static HRESULT WINAPI ServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
static BOOL check_jscript(void)
static ULONG WINAPI ActiveScriptSite_Release(IActiveScriptSite *iface)
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
static ULONG WINAPI ObjectWithSite_Release(IObjectWithSite *iface)
static HRESULT CreateInstance_hres
static HRESULT WINAPI ActiveScriptSite_OnLeaveScript(IActiveScriptSite *iface)
static IServiceProvider caller_sp
static void set_safety_options(IUnknown *unk, BOOL use_sec_mgr)
static IClassFactory activex_cf
static ULONG WINAPI ObjectWithSite_AddRef(IObjectWithSite *iface)
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
static ULONG WINAPI ServiceProvider_Release(IServiceProvider *iface)
static IDispatchExVtbl globalObjVtbl
static IInternetHostSecurityManager InternetHostSecurityManager
static const IObjectWithSiteVtbl ObjectWithSiteVtbl
static const GUID CLSID_TestObj
static HRESULT WINAPI ActiveScriptSite_OnStateChange(IActiveScriptSite *iface, SCRIPTSTATE ssScriptState)
#define parse_script_a(p, s)
static const IClassFactoryVtbl ClassFactoryVtbl
static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
static HRESULT WINAPI InternetHostSecurityManager_QueryInterface(IInternetHostSecurityManager *iface, REFIID riid, void **ppv)
static ULONG WINAPI InternetHostSecurityManager_AddRef(IInternetHostSecurityManager *iface)
static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
static const WCHAR testW[]
static DWORD ProcessUrlAction_policy
static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static BOOL init_registry(BOOL init)
static const CLSID CLSID_JScript
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
static HRESULT WINAPI InternetHostSecurityManager_GetSecurityId(IInternetHostSecurityManager *iface, BYTE *pbSecurityId, DWORD *pcbSecurityId, DWORD_PTR dwReserved)
static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
static IObjectWithSite ObjectWithSite
static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
#define IActiveScriptParseProcedure2_ParseProcedureText
static void test_ActiveXObject(void)
static void _parse_script_a(unsigned line, IActiveScriptParse *parser, const char *script)
#define CHECK_EXPECT(func)
#define call_procedure(p, c)
static HRESULT WINAPI ActiveScriptSite_GetDocVersionString(IActiveScriptSite *iface, BSTR *pbstrVersion)
static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHostSecurityManager *iface, REFGUID guidKey, BYTE **ppPolicy, DWORD *pcbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwReserved)
static HRESULT WINAPI ActiveScriptSite_GetItemInfo(IActiveScriptSite *iface, LPCOLESTR pstrName, DWORD dwReturnMask, IUnknown **ppiunkItem, ITypeInfo **ppti)
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
#define DEFINE_EXPECT(func)
static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
static DWORD QueryCustomPolicy_policy
#define IActiveScriptParse_InitNew
#define IActiveScriptParse_ParseScriptText
#define IActiveScriptParseProcedure2_Release
#define IActiveScriptParse_Release
static BSTR a2bstr(const char *str)
static int strcmp_wa(LPCWSTR strw, const char *stra)
static BOOL AllowIServiceProvider
static IServiceProvider ServiceProvider
static HRESULT WINAPI ObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppv)
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
static HRESULT WINAPI Test_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
#define IActiveScriptParse_QueryInterface
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
static void _call_procedure(unsigned line, IDispatchEx *proc, IServiceProvider *caller)
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
static IDispatchEx * parse_procedure_a(IActiveScriptParse *parser, const char *src)
static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface, REFIID riid, void **ppv)
static ULONG WINAPI InternetHostSecurityManager_Release(IInternetHostSecurityManager *iface)
static HRESULT QI_IDispatch_hres
static HRESULT WINAPI ActiveScriptSite_OnEnterScript(IActiveScriptSite *iface)
static HRESULT ProcessUrlAction_hres
static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
#define CHECK_CALLED(func)
static ULONG WINAPI ActiveScriptSite_AddRef(IActiveScriptSite *iface)
static HRESULT WINAPI ActiveScriptSite_OnScriptTerminate(IActiveScriptSite *iface, const VARIANT *pvarResult, const EXCEPINFO *pexcepinfo)
static HRESULT QS_SecMgr_hres
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite)
static const IInternetHostSecurityManagerVtbl InternetHostSecurityManagerVtbl
static DWORD QueryCustomPolicy_psize
static BOOL register_activex(void)
static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static IDispatchEx globalObj
static HRESULT WINAPI ServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
static IDispatchEx testObj
static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHostSecurityManager *iface, DWORD dwAction, BYTE *pPolicy, DWORD cbPolicy, BYTE *pContext, DWORD cbContext, DWORD dwFlags, DWORD dwReserved)
static const IActiveScriptSiteVtbl ActiveScriptSiteVtbl
static IServiceProviderVtbl ServiceProviderVtbl
static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
static ULONG WINAPI ServiceProvider_AddRef(IServiceProvider *iface)
static HRESULT QueryCustomPolicy_hres
static HRESULT WINAPI ActiveScriptSite_GetLCID(IActiveScriptSite *iface, LCID *plcid)
static IActiveScriptSite ActiveScriptSite
static HRESULT WINAPI ActiveScriptSite_OnScriptError(IActiveScriptSite *iface, IActiveScriptError *pscripterror)
static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
static IObjectWithSite * object_with_site
static IDispatchExVtbl testObjVtbl
#define DISPID_TEST_REPORTSUCCESS
static HRESULT WINAPI ObjectWithSite_GetSite(IObjectWithSite *iface, REFIID riid, void **ppvSite)
static HRESULT SetSite_hres
static HRESULT WINAPI Test_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
static const char * strw(LPCWSTR x)
static VARIANTARG static DISPID
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IsEqualGUID(rguid1, rguid2)
static __inline const char * wine_dbgstr_guid(const GUID *id)
_In_ DWORD _Out_ _In_ WORD wFlags
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
#define HKEY_CLASSES_ROOT