ReactOS 0.4.16-dev-91-g764881a
script.c File Reference
#include "precomp.h"
#include <activdbg.h>
Include dependency graph for script.c:

Go to the source code of this file.

Macros

#define CTXARG_T   DWORD
 
#define IActiveScriptParseVtbl   IActiveScriptParse32Vtbl
 
#define IActiveScriptParseProcedure2Vtbl   IActiveScriptParseProcedure2_32Vtbl
 
#define IActiveScriptSiteDebug_Release   IActiveScriptSiteDebug32_Release
 
#define DEFINE_EXPECT(func)    static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
 
#define SET_EXPECT(func)    do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)
 
#define CHECK_EXPECT2(func)
 
#define CHECK_EXPECT(func)
 
#define CHECK_CALLED(func)
 
#define CHECK_CALLED_BROKEN(func)
 
#define CHECK_NOT_CALLED(func)
 
#define CLEAR_CALLED(func)    expect_ ## func = called_ ## func = FALSE
 
#define TESTSCRIPT_CLSID   "{178fc163-f585-4e24-9c13-4bb7faf80746}"
 
#define TESTACTIVEX_CLSID   "{178fc163-f585-4e24-9c13-4bb7faf80646}"
 
#define DISPID_SCRIPT_TESTPROP   0x100000
 
#define DISPID_SCRIPT_TESTPROP2   0x100001
 
#define DISPID_EXTERNAL_OK   0x300000
 
#define DISPID_EXTERNAL_TRACE   0x300001
 
#define DISPID_EXTERNAL_REPORTSUCCESS   0x300002
 
#define DISPID_EXTERNAL_TODO_WINE_OK   0x300003
 
#define DISPID_EXTERNAL_BROKEN   0x300004
 
#define check_custom_policy(a, b, c, d)   _check_custom_policy(__LINE__,a,b,c,d)
 
#define test_elem_disabled(a, b)   _test_elem_disabled(__LINE__,a,b)
 

Typedefs

typedef void(* domtest_t) (IHTMLDocument2 *)
 

Functions

 DEFINE_GUID (CLSID_IdentityUnmarshal, 0x0000001b, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)
 
 DEFINE_EXPECT (CreateInstance)
 
 DEFINE_EXPECT (GetInterfaceSafetyOptions)
 
 DEFINE_EXPECT (SetInterfaceSafetyOptions)
 
 DEFINE_EXPECT (InitNew)
 
 DEFINE_EXPECT (Close)
 
 DEFINE_EXPECT (SetProperty_HACK_TRIDENTEVENTSINK)
 
 DEFINE_EXPECT (SetProperty_INVOKEVERSIONING)
 
 DEFINE_EXPECT (SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION)
 
 DEFINE_EXPECT (SetScriptSite)
 
 DEFINE_EXPECT (GetScriptState)
 
 DEFINE_EXPECT (SetScriptState_STARTED)
 
 DEFINE_EXPECT (SetScriptState_CONNECTED)
 
 DEFINE_EXPECT (SetScriptState_DISCONNECTED)
 
 DEFINE_EXPECT (AddNamedItem)
 
 DEFINE_EXPECT (ParseScriptText_script)
 
 DEFINE_EXPECT (ParseScriptText_execScript)
 
 DEFINE_EXPECT (GetScriptDispatch)
 
 DEFINE_EXPECT (funcDisp)
 
 DEFINE_EXPECT (script_divid_d)
 
 DEFINE_EXPECT (script_testprop_d)
 
 DEFINE_EXPECT (script_testprop_i)
 
 DEFINE_EXPECT (script_testprop2_d)
 
 DEFINE_EXPECT (AXQueryInterface_IActiveScript)
 
 DEFINE_EXPECT (AXQueryInterface_IObjectSafety)
 
 DEFINE_EXPECT (AXGetInterfaceSafetyOptions)
 
 DEFINE_EXPECT (AXSetInterfaceSafetyOptions_IDispatch_caller)
 
 DEFINE_EXPECT (AXSetInterfaceSafetyOptions_IDispatch_data)
 
 DEFINE_EXPECT (AXSetInterfaceSafetyOptions_IDispatchEx_caller_secmgr)
 
 DEFINE_EXPECT (AXSetInterfaceSafetyOptions_IDispatchEx_caller)
 
 DEFINE_EXPECT (external_success)
 
 DEFINE_EXPECT (QS_VariantConversion)
 
 DEFINE_EXPECT (QS_IActiveScriptSite)
 
 DEFINE_EXPECT (QS_GetCaller)
 
 DEFINE_EXPECT (ChangeType)
 
static int strcmp_wa (LPCWSTR strw, const char *stra)
 
static BSTR a2bstr (const char *str)
 
static BOOL init_key (const char *key_name, const char *def_value, BOOL init)
 
static HRESULT WINAPI PropertyNotifySink_QueryInterface (IPropertyNotifySink *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI PropertyNotifySink_AddRef (IPropertyNotifySink *iface)
 
static ULONG WINAPI PropertyNotifySink_Release (IPropertyNotifySink *iface)
 
static HRESULT WINAPI PropertyNotifySink_OnChanged (IPropertyNotifySink *iface, DISPID dispID)
 
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit (IPropertyNotifySink *iface, DISPID dispID)
 
static HRESULT WINAPI VariantChangeType_QueryInterface (IVariantChangeType *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI VariantChangeType_AddRef (IVariantChangeType *iface)
 
static ULONG WINAPI VariantChangeType_Release (IVariantChangeType *iface)
 
static HRESULT WINAPI VariantChangeType_ChangeType (IVariantChangeType *iface, VARIANT *dst, VARIANT *src, LCID lcid, VARTYPE vt)
 
static HRESULT WINAPI ServiceProvider_QueryInterface (IServiceProvider *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ServiceProvider_AddRef (IServiceProvider *iface)
 
static ULONG WINAPI ServiceProvider_Release (IServiceProvider *iface)
 
static HRESULT WINAPI ServiceProvider_QueryService (IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
 
static HRESULT WINAPI DispatchEx_QueryInterface (IDispatchEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DispatchEx_AddRef (IDispatchEx *iface)
 
static ULONG WINAPI DispatchEx_Release (IDispatchEx *iface)
 
static HRESULT WINAPI DispatchEx_GetTypeInfoCount (IDispatchEx *iface, UINT *pctinfo)
 
static HRESULT WINAPI DispatchEx_GetTypeInfo (IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI DispatchEx_GetIDsOfNames (IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI DispatchEx_Invoke (IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByName (IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
 
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID (IDispatchEx *iface, DISPID id)
 
static HRESULT WINAPI DispatchEx_GetMemberProperties (IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
 
static HRESULT WINAPI DispatchEx_GetMemberName (IDispatchEx *iface, DISPID id, BSTR *pbstrName)
 
static HRESULT WINAPI DispatchEx_GetNextDispID (IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
 
static HRESULT WINAPI DispatchEx_GetNameSpaceParent (IDispatchEx *iface, IUnknown **ppunk)
 
static HRESULT WINAPI DispatchEx_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI funcDisp_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI scriptDisp_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI scriptDisp_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT WINAPI externalDisp_GetDispID (IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
 
static HRESULT WINAPI externalDisp_InvokeEx (IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
 
static HRESULT QueryInterface (REFIID, void **)
 
static HRESULT WINAPI DocHostUIHandler_QueryInterface (IDocHostUIHandler2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DocHostUIHandler_AddRef (IDocHostUIHandler2 *iface)
 
static ULONG WINAPI DocHostUIHandler_Release (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu (IDocHostUIHandler2 *iface, DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdicpReserved)
 
static HRESULT WINAPI DocHostUIHandler_GetHostInfo (IDocHostUIHandler2 *iface, DOCHOSTUIINFO *pInfo)
 
static HRESULT WINAPI DocHostUIHandler_ShowUI (IDocHostUIHandler2 *iface, DWORD dwID, IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
 
static HRESULT WINAPI DocHostUIHandler_HideUI (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_UpdateUI (IDocHostUIHandler2 *iface)
 
static HRESULT WINAPI DocHostUIHandler_EnableModeless (IDocHostUIHandler2 *iface, BOOL fEnable)
 
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate (IDocHostUIHandler2 *iface, BOOL fActivate)
 
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate (IDocHostUIHandler2 *iface, BOOL fActivate)
 
static HRESULT WINAPI DocHostUIHandler_ResizeBorder (IDocHostUIHandler2 *iface, LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
 
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator (IDocHostUIHandler2 *iface, LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
 
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath (IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
 
static HRESULT WINAPI DocHostUIHandler_GetDropTarget (IDocHostUIHandler2 *iface, IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
 
static HRESULT WINAPI DocHostUIHandler_GetExternal (IDocHostUIHandler2 *iface, IDispatch **ppDispatch)
 
static HRESULT WINAPI DocHostUIHandler_TranslateUrl (IDocHostUIHandler2 *iface, DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
 
static HRESULT WINAPI DocHostUIHandler_FilterDataObject (IDocHostUIHandler2 *iface, IDataObject *pDO, IDataObject **ppPORet)
 
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath (IDocHostUIHandler2 *iface, LPOLESTR *pchKey, DWORD dw)
 
static HRESULT WINAPI InPlaceFrame_QueryInterface (IOleInPlaceFrame *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InPlaceFrame_AddRef (IOleInPlaceFrame *iface)
 
static ULONG WINAPI InPlaceFrame_Release (IOleInPlaceFrame *iface)
 
static HRESULT WINAPI InPlaceFrame_GetWindow (IOleInPlaceFrame *iface, HWND *phwnd)
 
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp (IOleInPlaceFrame *iface, BOOL fEnterMode)
 
static HRESULT WINAPI InPlaceFrame_GetBorder (IOleInPlaceFrame *iface, LPRECT lprectBorder)
 
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace (IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
 
static HRESULT WINAPI InPlaceFrame_SetBorderSpace (IOleInPlaceFrame *iface, LPCBORDERWIDTHS pborderwidths)
 
static HRESULT WINAPI InPlaceFrame_SetActiveObject (IOleInPlaceFrame *iface, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
 
static HRESULT WINAPI InPlaceFrame_InsertMenus (IOleInPlaceFrame *iface, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
 
static HRESULT WINAPI InPlaceFrame_SetMenu (IOleInPlaceFrame *iface, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
 
static HRESULT WINAPI InPlaceFrame_RemoveMenus (IOleInPlaceFrame *iface, HMENU hmenuShared)
 
static HRESULT WINAPI InPlaceFrame_SetStatusText (IOleInPlaceFrame *iface, LPCOLESTR pszStatusText)
 
static HRESULT WINAPI InPlaceFrame_EnableModeless (IOleInPlaceFrame *iface, BOOL fEnable)
 
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator (IOleInPlaceFrame *iface, LPMSG lpmsg, WORD wID)
 
static HRESULT WINAPI InPlaceSite_QueryInterface (IOleInPlaceSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InPlaceSite_AddRef (IOleInPlaceSite *iface)
 
static ULONG WINAPI InPlaceSite_Release (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_GetWindow (IOleInPlaceSite *iface, HWND *phwnd)
 
static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp (IOleInPlaceSite *iface, BOOL fEnterMode)
 
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnUIActivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_GetWindowContext (IOleInPlaceSite *iface, IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 
static HRESULT WINAPI InPlaceSite_Scroll (IOleInPlaceSite *iface, SIZE scrollExtant)
 
static HRESULT WINAPI InPlaceSite_OnUIDeactivate (IOleInPlaceSite *iface, BOOL fUndoable)
 
static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_DiscardUndoState (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_DeactivateAndUndo (IOleInPlaceSite *iface)
 
static HRESULT WINAPI InPlaceSite_OnPosRectChange (IOleInPlaceSite *iface, LPCRECT lprcPosRect)
 
static HRESULT WINAPI ClientSite_QueryInterface (IOleClientSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClientSite_AddRef (IOleClientSite *iface)
 
static ULONG WINAPI ClientSite_Release (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_SaveObject (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_GetMoniker (IOleClientSite *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmon)
 
static HRESULT WINAPI ClientSite_GetContainer (IOleClientSite *iface, IOleContainer **ppContainer)
 
static HRESULT WINAPI ClientSite_ShowObject (IOleClientSite *iface)
 
static HRESULT WINAPI ClientSite_OnShowWindow (IOleClientSite *iface, BOOL fShow)
 
static HRESULT WINAPI ClientSite_RequestNewObjectLayout (IOleClientSite *iface)
 
static HRESULT WINAPI DocumentSite_QueryInterface (IOleDocumentSite *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI DocumentSite_AddRef (IOleDocumentSite *iface)
 
static ULONG WINAPI DocumentSite_Release (IOleDocumentSite *iface)
 
static HRESULT WINAPI DocumentSite_ActivateMe (IOleDocumentSite *iface, IOleDocumentView *pViewToActivate)
 
static IHTMLDocument2 * create_document (void)
 
static void load_string (IHTMLDocument2 *doc, const char *str)
 
static void do_advise (IHTMLDocument2 *doc, REFIID riid, IUnknown *unk_advise)
 
static void set_client_site (IHTMLDocument2 *doc, BOOL set)
 
static void load_doc (IHTMLDocument2 *doc, const char *str)
 
static HRESULT WINAPI ObjectSafety_QueryInterface (IObjectSafety *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ObjectSafety_AddRef (IObjectSafety *iface)
 
static ULONG WINAPI ObjectSafety_Release (IObjectSafety *iface)
 
static HRESULT WINAPI ObjectSafety_GetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
 
static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
 
static HRESULT WINAPI AXObjectSafety_QueryInterface (IObjectSafety *iface, REFIID riid, void **ppv)
 
static HRESULT WINAPI AXObjectSafety_GetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
 
static HRESULT WINAPI AXObjectSafety_SetInterfaceSafetyOptions (IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
 
static BOOL set_safe_reg (BOOL safe_call, BOOL safe_data)
 
static void _check_custom_policy (unsigned line, HRESULT hres, BYTE *ppolicy, DWORD policy_size, DWORD expolicy)
 
static void test_security_reg (IInternetHostSecurityManager *sec_mgr, DWORD policy_caller, DWORD policy_load)
 
static void test_security (void)
 
static HRESULT WINAPI ActiveScriptProperty_QueryInterface (IActiveScriptProperty *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptProperty_AddRef (IActiveScriptProperty *iface)
 
static ULONG WINAPI ActiveScriptProperty_Release (IActiveScriptProperty *iface)
 
static HRESULT WINAPI ActiveScriptProperty_GetProperty (IActiveScriptProperty *iface, DWORD dwProperty, VARIANT *pvarIndex, VARIANT *pvarValue)
 
static HRESULT WINAPI ActiveScriptProperty_SetProperty (IActiveScriptProperty *iface, DWORD dwProperty, VARIANT *pvarIndex, VARIANT *pvarValue)
 
static HRESULT WINAPI ActiveScriptParseProcedure_QueryInterface (IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptParseProcedure_AddRef (IActiveScriptParseProcedure2 *iface)
 
static ULONG WINAPI ActiveScriptParseProcedure_Release (IActiveScriptParseProcedure2 *iface)
 
static HRESULT WINAPI ActiveScriptParseProcedure_ParseProcedureText (IActiveScriptParseProcedure2 *iface, LPCOLESTR pstrCode, LPCOLESTR pstrFormalParams, LPCOLESTR pstrProcedureName, LPCOLESTR pstrItemName, IUnknown *punkContext, LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, IDispatch **ppdisp)
 
static HRESULT WINAPI ActiveScriptParse_QueryInterface (IActiveScriptParse *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScriptParse_AddRef (IActiveScriptParse *iface)
 
static ULONG WINAPI ActiveScriptParse_Release (IActiveScriptParse *iface)
 
static HRESULT WINAPI ActiveScriptParse_InitNew (IActiveScriptParse *iface)
 
static HRESULT WINAPI ActiveScriptParse_AddScriptlet (IActiveScriptParse *iface, LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode, LPCOLESTR pstrItemName, LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName, LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, BSTR *pbstrName, EXCEPINFO *pexcepinfo)
 
static HRESULT dispex_propput (IDispatchEx *obj, DISPID id, DWORD flags, VARIANT *var, IServiceProvider *caller_sp)
 
static HRESULT dispex_propget (IDispatchEx *obj, DISPID id, VARIANT *res, IServiceProvider *caller_sp)
 
static void test_func (IDispatchEx *obj)
 
static void test_nextdispid (IDispatchEx *dispex)
 
static void test_global_id (void)
 
static void test_arg_conv (IHTMLWindow2 *window)
 
static void _test_elem_disabled (unsigned line, IHTMLElement *elem, VARIANT_BOOL exb)
 
static void test_default_arg_conv (IHTMLWindow2 *window)
 
static void test_ui (void)
 
static void test_sp (void)
 
static void test_script_run (void)
 
static HRESULT WINAPI ActiveScriptParse_ParseScriptText (IActiveScriptParse *iface, LPCOLESTR pstrCode, LPCOLESTR pstrItemName, IUnknown *punkContext, LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLine, DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo)
 
static HRESULT WINAPI ActiveScript_QueryInterface (IActiveScript *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ActiveScript_AddRef (IActiveScript *iface)
 
static ULONG WINAPI ActiveScript_Release (IActiveScript *iface)
 
static HRESULT WINAPI ActiveScript_SetScriptSite (IActiveScript *iface, IActiveScriptSite *pass)
 
static HRESULT WINAPI ActiveScript_GetScriptSite (IActiveScript *iface, REFIID riid, void **ppvObject)
 
static HRESULT WINAPI ActiveScript_SetScriptState (IActiveScript *iface, SCRIPTSTATE ss)
 
static HRESULT WINAPI ActiveScript_GetScriptState (IActiveScript *iface, SCRIPTSTATE *pssState)
 
static HRESULT WINAPI ActiveScript_Close (IActiveScript *iface)
 
static HRESULT WINAPI ActiveScript_AddNamedItem (IActiveScript *iface, LPCOLESTR pstrName, DWORD dwFlags)
 
static HRESULT WINAPI ActiveScript_AddTypeLib (IActiveScript *iface, REFGUID rguidTypeLib, DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
 
static HRESULT WINAPI ActiveScript_GetScriptDispatch (IActiveScript *iface, LPCOLESTR pstrItemName, IDispatch **ppdisp)
 
static HRESULT WINAPI ActiveScript_GetCurrentScriptThreadID (IActiveScript *iface, SCRIPTTHREADID *pstridThread)
 
static HRESULT WINAPI ActiveScript_GetScriptThreadID (IActiveScript *iface, DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
 
static HRESULT WINAPI ActiveScript_GetScriptThreadState (IActiveScript *iface, SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
 
static HRESULT WINAPI ActiveScript_InterruptScriptThread (IActiveScript *iface, SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
 
static HRESULT WINAPI ActiveScript_Clone (IActiveScript *iface, IActiveScript **ppscript)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static void test_exec_script (IHTMLDocument2 *doc, const char *codea, const char *langa)
 
static void test_simple_script (void)
 
static void run_js_script (const char *test_name)
 
static void run_js_tests (void)
 
static BOOL init_registry (BOOL init)
 
static BOOL register_script_engine (void)
 
static LRESULT WINAPI wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
static HWND create_container_window (void)
 
static BOOL check_ie (void)
 
 START_TEST (script)
 

Variables

const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY
 
static const GUID CLSID_TestScript
 
static const GUID CLSID_TestActiveX
 
static BOOL is_ie9plus
 
static IHTMLDocument2 * notif_doc
 
static IOleDocumentViewview
 
static IDispatchExwindow_dispex
 
static BOOL doc_complete
 
static IDispatchscript_disp
 
static BOOL ax_objsafe
 
static HWND container_hwnd
 
static HRESULT ax_getopt_hres = S_OK
 
static HRESULT ax_setopt_dispex_hres = S_OK
 
static HRESULT ax_setopt_disp_caller_hres = S_OK
 
static HRESULT ax_setopt_disp_data_hres = S_OK
 
static BOOL skip_loadobject_tests
 
static IActiveScriptSitesite
 
static SCRIPTSTATE state
 
static IPropertyNotifySinkVtbl PropertyNotifySinkVtbl
 
static IPropertyNotifySink PropertyNotifySink = { &PropertyNotifySinkVtbl }
 
static const IVariantChangeTypeVtbl VariantChangeTypeVtbl
 
static IVariantChangeType VChangeType = { &VariantChangeTypeVtbl }
 
static const IServiceProviderVtbl ServiceProviderVtbl
 
static IServiceProvider caller_sp = { &ServiceProviderVtbl }
 
static IDispatchExVtbl testObjVtbl
 
static IDispatchEx funcDisp = { &testObjVtbl }
 
static IDispatchExVtbl scriptDispVtbl
 
static IDispatchEx scriptDisp = { &scriptDispVtbl }
 
static IDispatchExVtbl externalDispVtbl
 
static IDispatchEx externalDisp = { &externalDispVtbl }
 
static const IDocHostUIHandler2Vtbl DocHostUIHandlerVtbl
 
static IDocHostUIHandler2 DocHostUIHandler = { &DocHostUIHandlerVtbl }
 
static const IOleInPlaceFrameVtbl InPlaceFrameVtbl
 
static IOleInPlaceFrame InPlaceFrame = { &InPlaceFrameVtbl }
 
static const IOleInPlaceSiteVtbl InPlaceSiteVtbl
 
static IOleInPlaceSite InPlaceSite = { &InPlaceSiteVtbl }
 
static const IOleClientSiteVtbl ClientSiteVtbl
 
static IOleClientSite ClientSite = { &ClientSiteVtbl }
 
static const IOleDocumentSiteVtbl DocumentSiteVtbl
 
static IOleDocumentSite DocumentSite = { &DocumentSiteVtbl }
 
static const IObjectSafetyVtbl ObjectSafetyVtbl
 
static IObjectSafety ObjectSafety = { &ObjectSafetyVtbl }
 
static const IObjectSafetyVtbl AXObjectSafetyVtbl
 
static IObjectSafety AXObjectSafety = { &AXObjectSafetyVtbl }
 
static const IActiveScriptPropertyVtbl ActiveScriptPropertyVtbl
 
static IActiveScriptProperty ActiveScriptProperty = { &ActiveScriptPropertyVtbl }
 
static const IActiveScriptParseProcedure2Vtbl ActiveScriptParseProcedureVtbl
 
static IActiveScriptParseProcedure2 ActiveScriptParseProcedure = { &ActiveScriptParseProcedureVtbl }
 
static const IActiveScriptParseVtbl ActiveScriptParseVtbl
 
static IActiveScriptParse ActiveScriptParse = { &ActiveScriptParseVtbl }
 
static const IActiveScriptVtbl ActiveScriptVtbl
 
static IActiveScript ActiveScript = { &ActiveScriptVtbl }
 
static const IClassFactoryVtbl ClassFactoryVtbl
 
static IClassFactory script_cf = { &ClassFactoryVtbl }
 
static const char simple_script_str []
 

Macro Definition Documentation

◆ CHECK_CALLED

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

Definition at line 63 of file script.c.

◆ CHECK_CALLED_BROKEN

#define CHECK_CALLED_BROKEN (   func)
Value:
do { \
ok(called_ ## func || broken(!called_ ## func), "expected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)
#define broken(x)
Definition: atltest.h:178

Definition at line 69 of file script.c.

◆ check_custom_policy

#define check_custom_policy (   a,
  b,
  c,
  d 
)    _check_custom_policy(__LINE__,a,b,c,d)

Definition at line 1457 of file script.c.

◆ CHECK_EXPECT

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

Definition at line 57 of file script.c.

◆ CHECK_EXPECT2

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

Definition at line 51 of file script.c.

◆ CHECK_NOT_CALLED

#define CHECK_NOT_CALLED (   func)
Value:
do { \
ok(!called_ ## func, "unexpected " #func "\n"); \
expect_ ## func = called_ ## func = FALSE; \
}while(0)

Definition at line 75 of file script.c.

◆ CLEAR_CALLED

#define CLEAR_CALLED (   func)     expect_ ## func = called_ ## func = FALSE

Definition at line 81 of file script.c.

◆ CTXARG_T

#define CTXARG_T   DWORD

Definition at line 38 of file script.c.

◆ DEFINE_EXPECT

#define DEFINE_EXPECT (   func)     static BOOL expect_ ## func = FALSE, called_ ## func = FALSE

Definition at line 45 of file script.c.

◆ DISPID_EXTERNAL_BROKEN

#define DISPID_EXTERNAL_BROKEN   0x300004

Definition at line 130 of file script.c.

◆ DISPID_EXTERNAL_OK

#define DISPID_EXTERNAL_OK   0x300000

Definition at line 126 of file script.c.

◆ DISPID_EXTERNAL_REPORTSUCCESS

#define DISPID_EXTERNAL_REPORTSUCCESS   0x300002

Definition at line 128 of file script.c.

◆ DISPID_EXTERNAL_TODO_WINE_OK

#define DISPID_EXTERNAL_TODO_WINE_OK   0x300003

Definition at line 129 of file script.c.

◆ DISPID_EXTERNAL_TRACE

#define DISPID_EXTERNAL_TRACE   0x300001

Definition at line 127 of file script.c.

◆ DISPID_SCRIPT_TESTPROP

#define DISPID_SCRIPT_TESTPROP   0x100000

Definition at line 123 of file script.c.

◆ DISPID_SCRIPT_TESTPROP2

#define DISPID_SCRIPT_TESTPROP2   0x100001

Definition at line 124 of file script.c.

◆ IActiveScriptParseProcedure2Vtbl

#define IActiveScriptParseProcedure2Vtbl   IActiveScriptParseProcedure2_32Vtbl

Definition at line 40 of file script.c.

◆ IActiveScriptParseVtbl

#define IActiveScriptParseVtbl   IActiveScriptParse32Vtbl

Definition at line 39 of file script.c.

◆ IActiveScriptSiteDebug_Release

#define IActiveScriptSiteDebug_Release   IActiveScriptSiteDebug32_Release

Definition at line 41 of file script.c.

◆ SET_EXPECT

#define SET_EXPECT (   func)     do { called_ ## func = FALSE; expect_ ## func = TRUE; } while(0)

Definition at line 48 of file script.c.

◆ test_elem_disabled

#define test_elem_disabled (   a,
  b 
)    _test_elem_disabled(__LINE__,a,b)

Definition at line 2042 of file script.c.

◆ TESTACTIVEX_CLSID

#define TESTACTIVEX_CLSID   "{178fc163-f585-4e24-9c13-4bb7faf80646}"

Definition at line 121 of file script.c.

◆ TESTSCRIPT_CLSID

#define TESTSCRIPT_CLSID   "{178fc163-f585-4e24-9c13-4bb7faf80746}"

Definition at line 120 of file script.c.

Typedef Documentation

◆ domtest_t

typedef void(* domtest_t) (IHTMLDocument2 *)

Definition at line 1270 of file script.c.

Function Documentation

◆ _check_custom_policy()

static void _check_custom_policy ( unsigned  line,
HRESULT  hres,
BYTE ppolicy,
DWORD  policy_size,
DWORD  expolicy 
)
static

Definition at line 1458 of file script.c.

1459{
1460 ok_(__FILE__,line)(hres == S_OK, "QueryCusromPolicy failed: %08x\n", hres);
1461 ok_(__FILE__,line)(policy_size == sizeof(DWORD), "policy_size = %d\n", policy_size);
1462 ok_(__FILE__,line)(*(DWORD*)ppolicy == expolicy, "policy = %x, expected %x\n", *(DWORD*)ppolicy, expolicy);
1463 CoTaskMemFree(ppolicy);
1464}
#define ok_(x1, x2)
Definition: atltest.h:61
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define S_OK
Definition: intsafe.h:52
HRESULT hres
Definition: protocol.c:465
#define DWORD
Definition: nt_native.h:44
Definition: parser.c:49

◆ _test_elem_disabled()

static void _test_elem_disabled ( unsigned  line,
IHTMLElement *  elem,
VARIANT_BOOL  exb 
)
static

Definition at line 2043 of file script.c.

2044{
2045 IHTMLElement3 *elem3;
2046 VARIANT_BOOL b = 100;
2047 HRESULT hres;
2048
2049 hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLElement3, (void**)&elem3);
2050 ok_(__FILE__,line)(hres == S_OK, "Could not get IHTMLElement3 iface: %08x\n", hres);
2051
2052 hres = IHTMLElement3_get_disabled(elem3, &b);
2053 ok_(__FILE__,line)(hres == S_OK, "get_disabled failed: %08x\n", hres);
2054 ok_(__FILE__,line)(b == exb, "disabled = %x, expected %x\n", b, exb);
2055
2056 IHTMLElement3_Release(elem3);
2057}
short VARIANT_BOOL
Definition: compat.h:2290
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define b
Definition: ke_i.h:79
static size_t elem
Definition: string.c:68

◆ a2bstr()

static BSTR a2bstr ( const char str)
static

Definition at line 159 of file script.c.

160{
161 BSTR ret;
162 int len;
163
164 if(!str)
165 return NULL;
166
167 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
170
171 return ret;
172}
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
OLECHAR * BSTR
Definition: compat.h:2293
#define MultiByteToWideChar
Definition: compat.h:110
GLenum GLsizei len
Definition: glext.h:6722
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
const WCHAR * str
int ret

Referenced by test_default_arg_conv(), test_exec_script(), test_func(), test_global_id(), test_nextdispid(), test_script_run(), and VariantChangeType_ChangeType().

◆ ActiveScript_AddNamedItem()

static HRESULT WINAPI ActiveScript_AddNamedItem ( IActiveScript iface,
LPCOLESTR  pstrName,
DWORD  dwFlags 
)
static

Definition at line 2545 of file script.c.

2547{
2548 IDispatch *disp;
2549 IUnknown *unk = NULL, *unk2;
2550 HRESULT hres;
2551
2552 static const WCHAR windowW[] = {'w','i','n','d','o','w',0};
2553
2554 static const IID unknown_iid = {0x719C3050,0xF9D3,0x11CF,{0xA4,0x93,0x00,0x40,0x05,0x23,0xA8,0xA0}};
2555
2556 CHECK_EXPECT(AddNamedItem);
2557
2558 ok(!lstrcmpW(pstrName, windowW), "pstrName=%s\n", wine_dbgstr_w(pstrName));
2559 ok(dwFlags == (SCRIPTITEM_ISVISIBLE|SCRIPTITEM_ISSOURCE|SCRIPTITEM_GLOBALMEMBERS), "dwFlags=%x\n", dwFlags);
2560
2561 hres = IActiveScriptSite_GetItemInfo(site, windowW, SCRIPTINFO_IUNKNOWN, &unk, NULL);
2562 ok(hres == S_OK, "GetItemInfo failed: %08x\n", hres);
2563 ok(unk != NULL, "unk == NULL\n");
2564
2565 hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
2566 ok(hres == S_OK, "Could not get IDispatch interface: %08x\n", hres);
2567 if(SUCCEEDED(hres))
2568 IDispatch_Release(disp);
2569
2570 hres = IUnknown_QueryInterface(unk, &unknown_iid, (void**)&unk2);
2571 ok(hres == E_NOINTERFACE, "Got ?? interface: %p\n", unk2);
2572 if(SUCCEEDED(hres))
2573 IUnknown_Release(unk2);
2574
2575 hres = IUnknown_QueryInterface(unk, &IID_IDispatchEx, (void**)&window_dispex);
2576 ok(hres == S_OK, "Could not get IDispatchEx interface: %08x\n", hres);
2577
2578 IUnknown_Release(unk);
2579 return S_OK;
2580}
#define ok(value,...)
Definition: atltest.h:57
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
static const WCHAR windowW[]
Definition: script.c:48
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define wine_dbgstr_w
Definition: kernel32.h:34
#define CHECK_EXPECT(func)
Definition: script.c:57
static IDispatchEx * window_dispex
Definition: script.c:140
static IActiveScriptSite * site
Definition: script.c:149
const GUID IID_IDispatch
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
#define E_NOINTERFACE
Definition: winerror.h:2364
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ActiveScript_AddRef()

static ULONG WINAPI ActiveScript_AddRef ( IActiveScript iface)
static

Definition at line 2447 of file script.c.

2448{
2449 return 2;
2450}

◆ ActiveScript_AddTypeLib()

static HRESULT WINAPI ActiveScript_AddTypeLib ( IActiveScript iface,
REFGUID  rguidTypeLib,
DWORD  dwMajor,
DWORD  dwMinor,
DWORD  dwFlags 
)
static

Definition at line 2582 of file script.c.

2584{
2585 ok(0, "unexpected call\n");
2586 return E_NOTIMPL;
2587}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ActiveScript_Clone()

static HRESULT WINAPI ActiveScript_Clone ( IActiveScript iface,
IActiveScript **  ppscript 
)
static

Definition at line 2631 of file script.c.

2632{
2633 ok(0, "unexpected call\n");
2634 return E_NOTIMPL;
2635}

◆ ActiveScript_Close()

static HRESULT WINAPI ActiveScript_Close ( IActiveScript iface)
static

Definition at line 2539 of file script.c.

2540{
2542 return E_NOTIMPL;
2543}
@ Close
Definition: sacdrv.h:268

◆ ActiveScript_GetCurrentScriptThreadID()

static HRESULT WINAPI ActiveScript_GetCurrentScriptThreadID ( IActiveScript iface,
SCRIPTTHREADID pstridThread 
)
static

Definition at line 2603 of file script.c.

2605{
2606 ok(0, "unexpected call\n");
2607 return E_NOTIMPL;
2608}

◆ ActiveScript_GetScriptDispatch()

static HRESULT WINAPI ActiveScript_GetScriptDispatch ( IActiveScript iface,
LPCOLESTR  pstrItemName,
IDispatch **  ppdisp 
)
static

Definition at line 2589 of file script.c.

2591{
2592 CHECK_EXPECT(GetScriptDispatch);
2593
2594 ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
2595
2596 if(!script_disp)
2597 return E_NOTIMPL;
2598
2599 *ppdisp = script_disp;
2600 return S_OK;
2601}
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: script.c:152
static IDispatch * script_disp
Definition: script.c:142

◆ ActiveScript_GetScriptSite()

static HRESULT WINAPI ActiveScript_GetScriptSite ( IActiveScript iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 2499 of file script.c.

2501{
2502 ok(0, "unexpected call\n");
2503 return E_NOTIMPL;
2504}

◆ ActiveScript_GetScriptState()

static HRESULT WINAPI ActiveScript_GetScriptState ( IActiveScript iface,
SCRIPTSTATE pssState 
)
static

Definition at line 2531 of file script.c.

2532{
2533 CHECK_EXPECT(GetScriptState);
2534
2535 *pssState = state;
2536 return S_OK;
2537}
static int state
Definition: maze.c:121

◆ ActiveScript_GetScriptThreadID()

static HRESULT WINAPI ActiveScript_GetScriptThreadID ( IActiveScript iface,
DWORD  dwWin32ThreadId,
SCRIPTTHREADID pstidThread 
)
static

Definition at line 2610 of file script.c.

2612{
2613 ok(0, "unexpected call\n");
2614 return E_NOTIMPL;
2615}

◆ ActiveScript_GetScriptThreadState()

static HRESULT WINAPI ActiveScript_GetScriptThreadState ( IActiveScript iface,
SCRIPTTHREADID  stidThread,
SCRIPTTHREADSTATE pstsState 
)
static

Definition at line 2617 of file script.c.

2619{
2620 ok(0, "unexpected call\n");
2621 return E_NOTIMPL;
2622}

◆ ActiveScript_InterruptScriptThread()

static HRESULT WINAPI ActiveScript_InterruptScriptThread ( IActiveScript iface,
SCRIPTTHREADID  stidThread,
const EXCEPINFO *  pexcepinfo,
DWORD  dwFlags 
)
static

Definition at line 2624 of file script.c.

2626{
2627 ok(0, "unexpected call\n");
2628 return E_NOTIMPL;
2629}

◆ ActiveScript_QueryInterface()

static HRESULT WINAPI ActiveScript_QueryInterface ( IActiveScript iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2411 of file script.c.

2412{
2413 *ppv = NULL;
2414
2415 if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IActiveScript, riid)) {
2416 *ppv = iface;
2417 return S_OK;
2418 }
2419
2420 if(IsEqualGUID(&IID_IActiveScriptParse, riid)) {
2422 return S_OK;
2423 }
2424
2425 if(IsEqualGUID(&IID_IActiveScriptParseProcedure2, riid)) {
2427 return S_OK;
2428 }
2429
2430 if(IsEqualGUID(&IID_IActiveScriptProperty, riid)) {
2432 return S_OK;
2433 }
2434
2435 if(IsEqualGUID(&IID_IObjectSafety, riid)) {
2436 *ppv = &ObjectSafety;
2437 return S_OK;
2438 }
2439
2440 if(IsEqualGUID(&IID_IActiveScriptDebug, riid))
2441 return E_NOINTERFACE;
2442
2443 trace("QI(%s)\n", wine_dbgstr_guid(riid));
2444 return E_NOINTERFACE;
2445}
#define trace
Definition: atltest.h:70
const GUID IID_IUnknown
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IActiveScriptProperty ActiveScriptProperty
Definition: script.c:1785
static IObjectSafety ObjectSafety
Definition: script.c:1356
static IActiveScriptParse ActiveScriptParse
Definition: script.c:2409
static IActiveScriptParseProcedure2 ActiveScriptParseProcedure
Definition: script.c:1820
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

◆ ActiveScript_Release()

static ULONG WINAPI ActiveScript_Release ( IActiveScript iface)
static

Definition at line 2452 of file script.c.

2453{
2454 return 1;
2455}

◆ ActiveScript_SetScriptSite()

static HRESULT WINAPI ActiveScript_SetScriptSite ( IActiveScript iface,
IActiveScriptSite pass 
)
static

Definition at line 2457 of file script.c.

2458{
2460 IActiveScriptSiteDebug *debug;
2461 IServiceProvider *service;
2462 ICanHandleException *canexpection;
2463 LCID lcid;
2464 HRESULT hres;
2465
2466 CHECK_EXPECT(SetScriptSite);
2467
2468 ok(pass != NULL, "pass == NULL\n");
2469
2470 hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteInterruptPoll, (void**)&poll);
2471 ok(hres == S_OK, "Could not get IActiveScriptSiteInterruptPoll interface: %08x\n", hres);
2472 if(FAILED(hres))
2473 IActiveScriptSiteInterruptPoll_Release(poll);
2474
2475 hres = IActiveScriptSite_GetLCID(pass, &lcid);
2476 ok(hres == S_OK, "GetLCID failed: %08x\n", hres);
2477
2478 hres = IActiveScriptSite_OnStateChange(pass, (state = SCRIPTSTATE_INITIALIZED));
2479 ok(hres == S_OK, "OnStateChange failed: %08x\n", hres);
2480
2481 hres = IActiveScriptSite_QueryInterface(pass, &IID_IActiveScriptSiteDebug, (void**)&debug);
2482 ok(hres == S_OK, "Could not get IActiveScriptSiteDebug interface: %08x\n", hres);
2483 if(SUCCEEDED(hres))
2485
2486 hres = IActiveScriptSite_QueryInterface(pass, &IID_ICanHandleException, (void**)&canexpection);
2487 ok(hres == E_NOINTERFACE, "Could not get IID_ICanHandleException interface: %08x\n", hres);
2488
2489 hres = IActiveScriptSite_QueryInterface(pass, &IID_IServiceProvider, (void**)&service);
2490 ok(hres == S_OK, "Could not get IServiceProvider interface: %08x\n", hres);
2491 if(SUCCEEDED(hres))
2492 IServiceProvider_Release(service);
2493
2494 site = pass;
2495 IActiveScriptSite_AddRef(site);
2496 return S_OK;
2497}
@ SCRIPTSTATE_INITIALIZED
Definition: activscp.idl:62
#define FAILED(hr)
Definition: intsafe.h:51
#define debug(msg)
Definition: key_call.c:71
#define IActiveScriptSiteDebug_Release
Definition: script.c:41
DWORD LCID
Definition: nls.h:13
pass
Definition: typegen.h:25
#define poll
Definition: wintirpc.h:59

◆ ActiveScript_SetScriptState()

static HRESULT WINAPI ActiveScript_SetScriptState ( IActiveScript iface,
SCRIPTSTATE  ss 
)
static

Definition at line 2506 of file script.c.

2507{
2508 HRESULT hres;
2509
2510 switch(ss) {
2512 CHECK_EXPECT(SetScriptState_STARTED);
2513 break;
2515 CHECK_EXPECT(SetScriptState_CONNECTED);
2516 break;
2518 CHECK_EXPECT(SetScriptState_DISCONNECTED);
2519 break;
2520 default:
2521 ok(0, "unexpected state %d\n", ss);
2522 return E_NOTIMPL;
2523 }
2524
2525 hres = IActiveScriptSite_OnStateChange(site, (state = ss));
2526 ok(hres == S_OK, "OnStateChange failed: %08x\n", hres);
2527
2528 return S_OK;
2529}
@ SCRIPTSTATE_DISCONNECTED
Definition: activscp.idl:60
@ SCRIPTSTATE_STARTED
Definition: activscp.idl:58
@ SCRIPTSTATE_CONNECTED
Definition: activscp.idl:59
#define ss
Definition: i386-dis.c:441

◆ ActiveScriptParse_AddRef()

static ULONG WINAPI ActiveScriptParse_AddRef ( IActiveScriptParse *  iface)
static

Definition at line 1829 of file script.c.

1830{
1831 return 2;
1832}

◆ ActiveScriptParse_AddScriptlet()

static HRESULT WINAPI ActiveScriptParse_AddScriptlet ( IActiveScriptParse *  iface,
LPCOLESTR  pstrDefaultName,
LPCOLESTR  pstrCode,
LPCOLESTR  pstrItemName,
LPCOLESTR  pstrSubItemName,
LPCOLESTR  pstrEventName,
LPCOLESTR  pstrDelimiter,
CTXARG_T  dwSourceContextCookie,
ULONG  ulStartingLineNumber,
DWORD  dwFlags,
BSTR pbstrName,
EXCEPINFO *  pexcepinfo 
)
static

Definition at line 1845 of file script.c.

1850{
1851 ok(0, "unexpected call\n");
1852 return E_NOTIMPL;
1853}

◆ ActiveScriptParse_InitNew()

static HRESULT WINAPI ActiveScriptParse_InitNew ( IActiveScriptParse *  iface)
static

Definition at line 1839 of file script.c.

1840{
1841 CHECK_EXPECT(InitNew);
1842 return S_OK;
1843}

◆ ActiveScriptParse_ParseScriptText()

static HRESULT WINAPI ActiveScriptParse_ParseScriptText ( IActiveScriptParse *  iface,
LPCOLESTR  pstrCode,
LPCOLESTR  pstrItemName,
IUnknown punkContext,
LPCOLESTR  pstrDelimiter,
CTXARG_T  dwSourceContextCookie,
ULONG  ulStartingLine,
DWORD  dwFlags,
VARIANT pvarResult,
EXCEPINFO *  pexcepinfo 
)
static

Definition at line 2369 of file script.c.

2373{
2374 ok(pvarResult != NULL, "pvarResult == NULL\n");
2375 ok(pexcepinfo != NULL, "pexcepinfo == NULL\n");
2376
2377 if(!strcmp_wa(pstrCode, "execScript call")) {
2378 CHECK_EXPECT(ParseScriptText_execScript);
2379 ok(!pstrItemName, "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
2380 ok(!strcmp_wa(pstrDelimiter, "\""), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter));
2381 ok(dwFlags == SCRIPTTEXT_ISVISIBLE, "dwFlags = %x\n", dwFlags);
2382
2383 V_VT(pvarResult) = VT_I4;
2384 V_I4(pvarResult) = 10;
2385 return S_OK;
2386 }else if(!strcmp_wa(pstrCode, "simple script")) {
2387 CHECK_EXPECT(ParseScriptText_script);
2388 ok(!strcmp_wa(pstrItemName, "window"), "pstrItemName = %s\n", wine_dbgstr_w(pstrItemName));
2389 ok(!strcmp_wa(pstrDelimiter, "</SCRIPT>"), "pstrDelimiter = %s\n", wine_dbgstr_w(pstrDelimiter));
2390 ok(dwFlags == (SCRIPTTEXT_ISVISIBLE|SCRIPTTEXT_HOSTMANAGESSOURCE), "dwFlags = %x\n", dwFlags);
2391
2393 return S_OK;
2394 }
2395
2396 ok(0, "unexpected script %s\n", wine_dbgstr_w(pstrCode));
2397 return E_FAIL;
2398}
#define E_FAIL
Definition: ddrawi.h:102
@ VT_I4
Definition: compat.h:2298
static void test_script_run(void)
Definition: script.c:2141
#define V_VT(A)
Definition: oleauto.h:211
#define V_I4(A)
Definition: oleauto.h:247

◆ ActiveScriptParse_QueryInterface()

static HRESULT WINAPI ActiveScriptParse_QueryInterface ( IActiveScriptParse *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1822 of file script.c.

1823{
1824 *ppv = NULL;
1825 ok(0, "unexpected call\n");
1826 return E_NOINTERFACE;
1827}

◆ ActiveScriptParse_Release()

static ULONG WINAPI ActiveScriptParse_Release ( IActiveScriptParse *  iface)
static

Definition at line 1834 of file script.c.

1835{
1836 return 1;
1837}

◆ ActiveScriptParseProcedure_AddRef()

static ULONG WINAPI ActiveScriptParseProcedure_AddRef ( IActiveScriptParseProcedure2 *  iface)
static

Definition at line 1794 of file script.c.

1795{
1796 return 2;
1797}

◆ ActiveScriptParseProcedure_ParseProcedureText()

static HRESULT WINAPI ActiveScriptParseProcedure_ParseProcedureText ( IActiveScriptParseProcedure2 *  iface,
LPCOLESTR  pstrCode,
LPCOLESTR  pstrFormalParams,
LPCOLESTR  pstrProcedureName,
LPCOLESTR  pstrItemName,
IUnknown punkContext,
LPCOLESTR  pstrDelimiter,
CTXARG_T  dwSourceContextCookie,
ULONG  ulStartingLineNumber,
DWORD  dwFlags,
IDispatch **  ppdisp 
)
static

Definition at line 1804 of file script.c.

1808{
1809 ok(0, "unexpected call\n");
1810 return E_NOTIMPL;
1811}

◆ ActiveScriptParseProcedure_QueryInterface()

static HRESULT WINAPI ActiveScriptParseProcedure_QueryInterface ( IActiveScriptParseProcedure2 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1787 of file script.c.

1788{
1789 *ppv = NULL;
1790 ok(0, "unexpected call\n");
1791 return E_NOINTERFACE;
1792}

◆ ActiveScriptParseProcedure_Release()

static ULONG WINAPI ActiveScriptParseProcedure_Release ( IActiveScriptParseProcedure2 *  iface)
static

Definition at line 1799 of file script.c.

1800{
1801 return 1;
1802}

◆ ActiveScriptProperty_AddRef()

static ULONG WINAPI ActiveScriptProperty_AddRef ( IActiveScriptProperty iface)
static

Definition at line 1728 of file script.c.

1729{
1730 return 2;
1731}

◆ ActiveScriptProperty_GetProperty()

static HRESULT WINAPI ActiveScriptProperty_GetProperty ( IActiveScriptProperty iface,
DWORD  dwProperty,
VARIANT pvarIndex,
VARIANT pvarValue 
)
static

Definition at line 1738 of file script.c.

1740{
1741 ok(0, "unexpected call\n");
1742 return E_NOTIMPL;
1743}

◆ ActiveScriptProperty_QueryInterface()

static HRESULT WINAPI ActiveScriptProperty_QueryInterface ( IActiveScriptProperty iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1721 of file script.c.

1722{
1723 *ppv = NULL;
1724 ok(0, "unexpected call\n");
1725 return E_NOINTERFACE;
1726}

◆ ActiveScriptProperty_Release()

static ULONG WINAPI ActiveScriptProperty_Release ( IActiveScriptProperty iface)
static

Definition at line 1733 of file script.c.

1734{
1735 return 1;
1736}

◆ ActiveScriptProperty_SetProperty()

static HRESULT WINAPI ActiveScriptProperty_SetProperty ( IActiveScriptProperty iface,
DWORD  dwProperty,
VARIANT pvarIndex,
VARIANT pvarValue 
)
static

Definition at line 1745 of file script.c.

1747{
1748 switch(dwProperty) {
1749 case SCRIPTPROP_HACK_TRIDENTEVENTSINK:
1750 CHECK_EXPECT(SetProperty_HACK_TRIDENTEVENTSINK);
1751 ok(V_VT(pvarValue) == VT_BOOL, "V_VT(pvarValue)=%d\n", V_VT(pvarValue));
1752 ok(V_BOOL(pvarValue) == VARIANT_TRUE, "V_BOOL(pvarValue)=%x\n", V_BOOL(pvarValue));
1753 break;
1754 case SCRIPTPROP_INVOKEVERSIONING:
1755 CHECK_EXPECT(SetProperty_INVOKEVERSIONING);
1756 ok(V_VT(pvarValue) == VT_I4, "V_VT(pvarValue)=%d\n", V_VT(pvarValue));
1757 ok(V_I4(pvarValue) == 1, "V_I4(pvarValue)=%d\n", V_I4(pvarValue));
1758 break;
1759 case SCRIPTPROP_ABBREVIATE_GLOBALNAME_RESOLUTION:
1760 CHECK_EXPECT(SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION);
1761 ok(V_VT(pvarValue) == VT_BOOL, "V_VT(pvarValue)=%d\n", V_VT(pvarValue));
1762 ok(V_BOOL(pvarValue) == VARIANT_TRUE, "V_BOOL(pvarValue)=%x\n", V_BOOL(pvarValue));
1763 break;
1764 case 0x70000003: /* Undocumented property set by IE10 */
1765 return E_NOTIMPL;
1766 default:
1767 ok(0, "unexpected property %x\n", dwProperty);
1768 return E_NOTIMPL;
1769 }
1770
1771 ok(!pvarIndex, "pvarIndex != NULL\n");
1772 ok(pvarValue != NULL, "pvarValue == NULL\n");
1773
1774 return S_OK;
1775}
@ VT_BOOL
Definition: compat.h:2306
#define V_BOOL(A)
Definition: oleauto.h:224

◆ AXObjectSafety_GetInterfaceSafetyOptions()

static HRESULT WINAPI AXObjectSafety_GetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD pdwSupportedOptions,
DWORD pdwEnabledOptions 
)
static

Definition at line 1379 of file script.c.

1381{
1382 CHECK_EXPECT(AXGetInterfaceSafetyOptions);
1383
1384 ok(IsEqualGUID(&IID_IDispatchEx, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
1385 ok(pdwSupportedOptions != NULL, "pdwSupportedOptions == NULL\n");
1386 ok(pdwEnabledOptions != NULL, "pdwEnabledOptions == NULL\n");
1387
1389 *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER;
1390 *pdwEnabledOptions = INTERFACE_USES_DISPEX;
1391 }
1392
1393 return ax_getopt_hres;
1394}
static HRESULT ax_getopt_hres
Definition: script.c:145

◆ AXObjectSafety_QueryInterface()

static HRESULT WINAPI AXObjectSafety_QueryInterface ( IObjectSafety iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1358 of file script.c.

1359{
1360 *ppv = NULL;
1361
1362 if(IsEqualGUID(&IID_IActiveScript, riid)) {
1363 CHECK_EXPECT(AXQueryInterface_IActiveScript);
1364 return E_NOINTERFACE;
1365 }
1366
1367 if(IsEqualGUID(&IID_IObjectSafety, riid)) {
1368 CHECK_EXPECT2(AXQueryInterface_IObjectSafety);
1369 if(!ax_objsafe)
1370 return E_NOINTERFACE;
1371 *ppv = iface;
1372 return S_OK;
1373 }
1374
1375 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
1376 return E_NOINTERFACE;
1377}
static BOOL ax_objsafe
Definition: script.c:143
#define CHECK_EXPECT2(func)
Definition: script.c:51

◆ AXObjectSafety_SetInterfaceSafetyOptions()

static HRESULT WINAPI AXObjectSafety_SetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD  dwOptionSetMask,
DWORD  dwEnabledOptions 
)
static

Definition at line 1396 of file script.c.

1398{
1399 if(IsEqualGUID(&IID_IDispatchEx, riid)) {
1400 switch(dwEnabledOptions) {
1401 case INTERFACESAFE_FOR_UNTRUSTED_CALLER|INTERFACE_USES_SECURITY_MANAGER:
1402 CHECK_EXPECT(AXSetInterfaceSafetyOptions_IDispatchEx_caller_secmgr);
1403 break;
1404 case INTERFACESAFE_FOR_UNTRUSTED_CALLER:
1405 CHECK_EXPECT(AXSetInterfaceSafetyOptions_IDispatchEx_caller);
1406 break;
1407 default:
1408 ok(0, "unexpected dwEnabledOptions %x\n", dwEnabledOptions);
1409 }
1410
1411 ok(dwOptionSetMask == dwEnabledOptions, "dwOptionSetMask=%x, expected %x\n", dwOptionSetMask, dwEnabledOptions);
1412 return ax_setopt_dispex_hres;
1413 }
1414
1416 HRESULT hres;
1417
1418 switch(dwEnabledOptions) {
1419 case INTERFACESAFE_FOR_UNTRUSTED_CALLER:
1420 CHECK_EXPECT(AXSetInterfaceSafetyOptions_IDispatch_caller);
1422 break;
1423 case INTERFACESAFE_FOR_UNTRUSTED_DATA:
1424 CHECK_EXPECT(AXSetInterfaceSafetyOptions_IDispatch_data);
1426 break;
1427 default:
1428 ok(0, "unexpected dwEnabledOptions %x\n", dwEnabledOptions);
1429 hres = E_FAIL;
1430 }
1431 ok(dwOptionSetMask == dwEnabledOptions, "dwOptionSetMask=%x, expected %x\n", dwOptionSetMask, dwEnabledOptions);
1432 return hres;
1433 }
1434
1435 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
1436 return E_NOINTERFACE;
1437}
static HRESULT ax_setopt_disp_data_hres
Definition: script.c:146
static HRESULT ax_setopt_disp_caller_hres
Definition: script.c:146
static HRESULT ax_setopt_dispex_hres
Definition: script.c:145

◆ check_ie()

static BOOL check_ie ( void  )
static

Definition at line 2917 of file script.c.

2918{
2919 IHTMLDocument2 *doc;
2920 IHTMLDocument5 *doc5;
2921 IHTMLDocument7 *doc7;
2922 HRESULT hres;
2923
2924 doc = create_document();
2925 if(!doc)
2926 return FALSE;
2927
2928 hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument7, (void**)&doc7);
2929 if(SUCCEEDED(hres)) {
2930 is_ie9plus = TRUE;
2931 IHTMLDocument7_Release(doc7);
2932 }
2933
2934 trace("is_ie9plus %x\n", is_ie9plus);
2935
2936 hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5);
2937 if(SUCCEEDED(hres))
2938 IHTMLDocument5_Release(doc5);
2939
2940 IHTMLDocument2_Release(doc);
2941 return SUCCEEDED(hres);
2942}
static BOOL is_ie9plus
Definition: script.c:137
static IHTMLDocument2 * create_document(void)
Definition: script.c:1184

Referenced by START_TEST().

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 2676 of file script.c.

2677{
2678 return 2;
2679}

◆ ClassFactory_CreateInstance()

static HRESULT WINAPI ClassFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2686 of file script.c.

2687{
2688 CHECK_EXPECT(CreateInstance);
2689
2690 ok(!outer, "outer = %p\n", outer);
2691 ok(IsEqualGUID(&IID_IActiveScript, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
2692 *ppv = &ActiveScript;
2693 return S_OK;
2694}
static IActiveScript ActiveScript
Definition: script.c:2656

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 2696 of file script.c.

2697{
2698 ok(0, "unexpected call\n");
2699 return S_OK;
2700}

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 2658 of file script.c.

2659{
2660 *ppv = NULL;
2661
2663 *ppv = iface;
2664 return S_OK;
2665 }
2666
2667 if(IsEqualGUID(&IID_IMarshal, riid))
2668 return E_NOINTERFACE;
2670 return E_NOINTERFACE;
2671
2672 ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid));
2673 return E_NOTIMPL;
2674}
const GUID IID_IClassFactory
const CLSID CLSID_IdentityUnmarshal

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 2681 of file script.c.

2682{
2683 return 1;
2684}

◆ ClientSite_AddRef()

static ULONG WINAPI ClientSite_AddRef ( IOleClientSite iface)
static

Definition at line 1056 of file script.c.

1057{
1058 return 2;
1059}

◆ ClientSite_GetContainer()

static HRESULT WINAPI ClientSite_GetContainer ( IOleClientSite iface,
IOleContainer **  ppContainer 
)
static

Definition at line 1079 of file script.c.

1080{
1081 return E_NOTIMPL;
1082}

◆ ClientSite_GetMoniker()

static HRESULT WINAPI ClientSite_GetMoniker ( IOleClientSite iface,
DWORD  dwAssign,
DWORD  dwWhichMoniker,
IMoniker **  ppmon 
)
static

Definition at line 1072 of file script.c.

1074{
1075 ok(0, "unexpected call\n");
1076 return E_NOTIMPL;
1077}

◆ ClientSite_OnShowWindow()

static HRESULT WINAPI ClientSite_OnShowWindow ( IOleClientSite iface,
BOOL  fShow 
)
static

Definition at line 1090 of file script.c.

1091{
1092 ok(0, "unexpected call\n");
1093 return E_NOTIMPL;
1094}

◆ ClientSite_QueryInterface()

static HRESULT WINAPI ClientSite_QueryInterface ( IOleClientSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1051 of file script.c.

1052{
1053 return QueryInterface(riid, ppv);
1054}
static HRESULT QueryInterface(REFIID, void **)
Definition: script.c:1168

◆ ClientSite_Release()

static ULONG WINAPI ClientSite_Release ( IOleClientSite iface)
static

Definition at line 1061 of file script.c.

1062{
1063 return 1;
1064}

◆ ClientSite_RequestNewObjectLayout()

static HRESULT WINAPI ClientSite_RequestNewObjectLayout ( IOleClientSite iface)
static

Definition at line 1096 of file script.c.

1097{
1098 ok(0, "unexpected call\n");
1099 return E_NOTIMPL;
1100}

◆ ClientSite_SaveObject()

static HRESULT WINAPI ClientSite_SaveObject ( IOleClientSite iface)
static

Definition at line 1066 of file script.c.

1067{
1068 ok(0, "unexpected call\n");
1069 return E_NOTIMPL;
1070}

◆ ClientSite_ShowObject()

static HRESULT WINAPI ClientSite_ShowObject ( IOleClientSite iface)
static

Definition at line 1084 of file script.c.

1085{
1086 ok(0, "unexpected call\n");
1087 return E_NOTIMPL;
1088}

◆ create_container_window()

static HWND create_container_window ( void  )
static

Definition at line 2899 of file script.c.

2900{
2901 static const CHAR szHTMLDocumentTest[] = "HTMLDocumentTest";
2902 static WNDCLASSEXA wndclass = {
2903 sizeof(WNDCLASSEXA),
2904 0,
2905 wnd_proc,
2906 0, 0, NULL, NULL, NULL, NULL, NULL,
2907 szHTMLDocumentTest,
2908 NULL
2909 };
2910
2911 RegisterClassExA(&wndclass);
2912 return CreateWindowA(szHTMLDocumentTest, szHTMLDocumentTest,
2914 300, 300, NULL, NULL, NULL, NULL);
2915}
static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: script.c:2894
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4318
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
#define CW_USEDEFAULT
Definition: winuser.h:225
struct _WNDCLASSEXA WNDCLASSEXA
char CHAR
Definition: xmlstorage.h:175

Referenced by START_TEST().

◆ create_document()

static IHTMLDocument2 * create_document ( void  )
static

Definition at line 1184 of file script.c.

1185{
1186 IHTMLDocument2 *doc;
1187 HRESULT hres;
1188
1189 hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
1190 &IID_IHTMLDocument2, (void**)&doc);
1191 ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres);
1192 return SUCCEEDED(hres) ? doc : NULL;
1193}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325

Referenced by check_ie(), run_js_script(), and test_simple_script().

◆ DEFINE_EXPECT() [1/34]

DEFINE_EXPECT ( AddNamedItem  )

◆ DEFINE_EXPECT() [2/34]

DEFINE_EXPECT ( AXGetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [3/34]

DEFINE_EXPECT ( AXQueryInterface_IActiveScript  )

◆ DEFINE_EXPECT() [4/34]

DEFINE_EXPECT ( AXQueryInterface_IObjectSafety  )

◆ DEFINE_EXPECT() [5/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatch_caller  )

◆ DEFINE_EXPECT() [6/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatch_data  )

◆ DEFINE_EXPECT() [7/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatchEx_caller  )

◆ DEFINE_EXPECT() [8/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatchEx_caller_secmgr  )

◆ DEFINE_EXPECT() [9/34]

DEFINE_EXPECT ( ChangeType  )

◆ DEFINE_EXPECT() [10/34]

DEFINE_EXPECT ( Close  )

◆ DEFINE_EXPECT() [11/34]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [12/34]

DEFINE_EXPECT ( external_success  )

◆ DEFINE_EXPECT() [13/34]

DEFINE_EXPECT ( funcDisp  )

◆ DEFINE_EXPECT() [14/34]

DEFINE_EXPECT ( GetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [15/34]

DEFINE_EXPECT ( GetScriptDispatch  )

◆ DEFINE_EXPECT() [16/34]

DEFINE_EXPECT ( GetScriptState  )

◆ DEFINE_EXPECT() [17/34]

DEFINE_EXPECT ( InitNew  )

◆ DEFINE_EXPECT() [18/34]

DEFINE_EXPECT ( ParseScriptText_execScript  )

◆ DEFINE_EXPECT() [19/34]

DEFINE_EXPECT ( ParseScriptText_script  )

◆ DEFINE_EXPECT() [20/34]

DEFINE_EXPECT ( QS_GetCaller  )

◆ DEFINE_EXPECT() [21/34]

DEFINE_EXPECT ( QS_IActiveScriptSite  )

◆ DEFINE_EXPECT() [22/34]

DEFINE_EXPECT ( QS_VariantConversion  )

◆ DEFINE_EXPECT() [23/34]

DEFINE_EXPECT ( script_divid_d  )

◆ DEFINE_EXPECT() [24/34]

DEFINE_EXPECT ( script_testprop2_d  )

◆ DEFINE_EXPECT() [25/34]

DEFINE_EXPECT ( script_testprop_d  )

◆ DEFINE_EXPECT() [26/34]

DEFINE_EXPECT ( script_testprop_i  )

◆ DEFINE_EXPECT() [27/34]

DEFINE_EXPECT ( SetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [28/34]

DEFINE_EXPECT ( SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION  )

◆ DEFINE_EXPECT() [29/34]

DEFINE_EXPECT ( SetProperty_HACK_TRIDENTEVENTSINK  )

◆ DEFINE_EXPECT() [30/34]

DEFINE_EXPECT ( SetProperty_INVOKEVERSIONING  )

◆ DEFINE_EXPECT() [31/34]

DEFINE_EXPECT ( SetScriptSite  )

◆ DEFINE_EXPECT() [32/34]

DEFINE_EXPECT ( SetScriptState_CONNECTED  )

◆ DEFINE_EXPECT() [33/34]

DEFINE_EXPECT ( SetScriptState_DISCONNECTED  )

◆ DEFINE_EXPECT() [34/34]

DEFINE_EXPECT ( SetScriptState_STARTED  )

◆ DEFINE_GUID()

DEFINE_GUID ( CLSID_IdentityUnmarshal  ,
0x0000001b  ,
0x0000  ,
0x0000  ,
0xc0  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x00  ,
0x46   
)

◆ DispatchEx_AddRef()

static ULONG WINAPI DispatchEx_AddRef ( IDispatchEx iface)
static

Definition at line 362 of file script.c.

363{
364 return 2;
365}

◆ DispatchEx_DeleteMemberByDispID()

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

Definition at line 407 of file script.c.

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

◆ DispatchEx_DeleteMemberByName()

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

Definition at line 401 of file script.c.

402{
403 ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex);
404 return E_NOTIMPL;
405}

◆ DispatchEx_GetDispID()

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

Definition at line 437 of file script.c.

438{
439 ok(0, "unexpected call\n");
440 return E_NOTIMPL;
441}

◆ DispatchEx_GetIDsOfNames()

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

Definition at line 385 of file script.c.

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

◆ DispatchEx_GetMemberName()

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

Definition at line 419 of file script.c.

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

◆ DispatchEx_GetMemberProperties()

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

Definition at line 413 of file script.c.

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

◆ DispatchEx_GetNameSpaceParent()

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

Definition at line 431 of file script.c.

432{
433 ok(0, "unexpected call\n");
434 return E_NOTIMPL;
435}

◆ DispatchEx_GetNextDispID()

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

Definition at line 425 of file script.c.

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

◆ DispatchEx_GetTypeInfo()

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

Definition at line 378 of file script.c.

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

◆ DispatchEx_GetTypeInfoCount()

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

Definition at line 372 of file script.c.

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

◆ DispatchEx_Invoke()

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

Definition at line 393 of file script.c.

396{
397 ok(0, "unexpected call\n");
398 return E_NOTIMPL;
399}

◆ DispatchEx_QueryInterface()

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

Definition at line 348 of file script.c.

349{
350 *ppv = NULL;
351
354 || IsEqualGUID(riid, &IID_IDispatchEx))
355 *ppv = iface;
356 else
357 return E_NOINTERFACE;
358
359 return S_OK;
360}

◆ DispatchEx_Release()

static ULONG WINAPI DispatchEx_Release ( IDispatchEx iface)
static

Definition at line 367 of file script.c.

368{
369 return 1;
370}

◆ dispex_propget()

static HRESULT dispex_propget ( IDispatchEx obj,
DISPID  id,
VARIANT res,
IServiceProvider caller_sp 
)
static

Definition at line 1864 of file script.c.

1865{
1866 DISPPARAMS dp = {NULL};
1867 EXCEPINFO ei = {0};
1868
1869 return IDispatchEx_InvokeEx(obj, id, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dp, res, &ei, caller_sp);
1870}
GLuint res
Definition: glext.h:9613
static IServiceProvider caller_sp
Definition: script.c:346
struct stdole::DISPPARAMS DISPPARAMS
struct stdole::EXCEPINFO EXCEPINFO
#define LOCALE_NEUTRAL
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007

Referenced by test_arg_conv(), and test_func().

◆ dispex_propput()

static HRESULT dispex_propput ( IDispatchEx obj,
DISPID  id,
DWORD  flags,
VARIANT var,
IServiceProvider caller_sp 
)
static

Definition at line 1855 of file script.c.

1856{
1857 DISPID propput_arg = DISPID_PROPERTYPUT;
1858 DISPPARAMS dp = {var, &propput_arg, 1, 1};
1859 EXCEPINFO ei = {0};
1860
1861 return IDispatchEx_InvokeEx(obj, id, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT|flags, &dp, NULL, &ei, caller_sp);
1862}
GLbitfield flags
Definition: glext.h:7161
const char * var
Definition: shader.c:5666
static VARIANTARG static DISPID
Definition: ordinal.c:52
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008

Referenced by test_arg_conv(), test_default_arg_conv(), test_func(), test_nextdispid(), and test_script_run().

◆ do_advise()

static void do_advise ( IHTMLDocument2 *  doc,
REFIID  riid,
IUnknown unk_advise 
)
static

Definition at line 1215 of file script.c.

1216{
1219 DWORD cookie;
1220 HRESULT hres;
1221
1222 hres = IHTMLDocument2_QueryInterface(doc, &IID_IConnectionPointContainer, (void**)&container);
1223 ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
1224
1225 hres = IConnectionPointContainer_FindConnectionPoint(container, riid, &cp);
1226 IConnectionPointContainer_Release(container);
1227 ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
1228
1229 notif_doc = doc;
1230
1231 hres = IConnectionPoint_Advise(cp, unk_advise, &cookie);
1232 IConnectionPoint_Release(cp);
1233 ok(hres == S_OK, "Advise failed: %08x\n", hres);
1234}
POINT cp
Definition: magnifier.c:59
static IHTMLDocument2 * notif_doc
Definition: script.c:138
const GUID IID_IConnectionPointContainer
Definition: cookie.c:34

Referenced by load_doc(), and run_js_script().

◆ DocHostUIHandler_AddRef()

static ULONG WINAPI DocHostUIHandler_AddRef ( IDocHostUIHandler2 iface)
static

Definition at line 711 of file script.c.

712{
713 return 2;
714}

◆ DocHostUIHandler_EnableModeless()

static HRESULT WINAPI DocHostUIHandler_EnableModeless ( IDocHostUIHandler2 iface,
BOOL  fEnable 
)
static

Definition at line 749 of file script.c.

750{
751 return E_NOTIMPL;
752}

◆ DocHostUIHandler_FilterDataObject()

static HRESULT WINAPI DocHostUIHandler_FilterDataObject ( IDocHostUIHandler2 iface,
IDataObject pDO,
IDataObject **  ppPORet 
)
static

Definition at line 800 of file script.c.

802{
803 return E_NOTIMPL;
804}

◆ DocHostUIHandler_GetDropTarget()

static HRESULT WINAPI DocHostUIHandler_GetDropTarget ( IDocHostUIHandler2 iface,
IDropTarget pDropTarget,
IDropTarget **  ppDropTarget 
)
static

Definition at line 782 of file script.c.

784{
785 return E_NOTIMPL;
786}

◆ DocHostUIHandler_GetExternal()

static HRESULT WINAPI DocHostUIHandler_GetExternal ( IDocHostUIHandler2 iface,
IDispatch **  ppDispatch 
)
static

Definition at line 788 of file script.c.

789{
790 *ppDispatch = (IDispatch*)&externalDisp;
791 return S_OK;
792}
static IDispatchEx externalDisp
Definition: script.c:702

◆ DocHostUIHandler_GetHostInfo()

static HRESULT WINAPI DocHostUIHandler_GetHostInfo ( IDocHostUIHandler2 iface,
DOCHOSTUIINFO *  pInfo 
)
static

Definition at line 727 of file script.c.

728{
729 return E_NOTIMPL;
730}

◆ DocHostUIHandler_GetOptionKeyPath()

static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath ( IDocHostUIHandler2 iface,
LPOLESTR pchKey,
DWORD  dw 
)
static

Definition at line 776 of file script.c.

778{
779 return S_OK;
780}

◆ DocHostUIHandler_GetOverrideKeyPath()

static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath ( IDocHostUIHandler2 iface,
LPOLESTR pchKey,
DWORD  dw 
)
static

Definition at line 806 of file script.c.

808{
809 return E_NOTIMPL;
810}

◆ DocHostUIHandler_HideUI()

static HRESULT WINAPI DocHostUIHandler_HideUI ( IDocHostUIHandler2 iface)
static

Definition at line 739 of file script.c.

740{
741 return S_OK;
742}

◆ DocHostUIHandler_OnDocWindowActivate()

static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate ( IDocHostUIHandler2 iface,
BOOL  fActivate 
)
static

Definition at line 754 of file script.c.

755{
756 return E_NOTIMPL;
757}

◆ DocHostUIHandler_OnFrameWindowActivate()

static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate ( IDocHostUIHandler2 iface,
BOOL  fActivate 
)
static

Definition at line 759 of file script.c.

760{
761 return S_OK;
762}

◆ DocHostUIHandler_QueryInterface()

static HRESULT WINAPI DocHostUIHandler_QueryInterface ( IDocHostUIHandler2 iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 706 of file script.c.

707{
708 return QueryInterface(riid, ppv);
709}

◆ DocHostUIHandler_Release()

static ULONG WINAPI DocHostUIHandler_Release ( IDocHostUIHandler2 iface)
static

Definition at line 716 of file script.c.

717{
718 return 1;
719}

◆ DocHostUIHandler_ResizeBorder()

static HRESULT WINAPI DocHostUIHandler_ResizeBorder ( IDocHostUIHandler2 iface,
LPCRECT  prcBorder,
IOleInPlaceUIWindow pUIWindow,
BOOL  fRameWindow 
)
static

Definition at line 764 of file script.c.

766{
767 return E_NOTIMPL;
768}

◆ DocHostUIHandler_ShowContextMenu()

static HRESULT WINAPI DocHostUIHandler_ShowContextMenu ( IDocHostUIHandler2 iface,
DWORD  dwID,
POINT ppt,
IUnknown pcmdtReserved,
IDispatch pdicpReserved 
)
static

Definition at line 721 of file script.c.

723{
724 return E_NOTIMPL;
725}

◆ DocHostUIHandler_ShowUI()

static HRESULT WINAPI DocHostUIHandler_ShowUI ( IDocHostUIHandler2 iface,
DWORD  dwID,
IOleInPlaceActiveObject pActiveObject,
IOleCommandTarget pCommandTarget,
IOleInPlaceFrame pFrame,
IOleInPlaceUIWindow pDoc 
)
static

Definition at line 732 of file script.c.

735{
736 return S_OK;
737}

◆ DocHostUIHandler_TranslateAccelerator()

static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator ( IDocHostUIHandler2 iface,
LPMSG  lpMsg,
const GUID pguidCmdGroup,
DWORD  nCmdID 
)
static

Definition at line 770 of file script.c.

772{
773 return E_NOTIMPL;
774}

◆ DocHostUIHandler_TranslateUrl()

static HRESULT WINAPI DocHostUIHandler_TranslateUrl ( IDocHostUIHandler2 iface,
DWORD  dwTranslate,
OLECHAR pchURLIn,
OLECHAR **  ppchURLOut 
)
static

Definition at line 794 of file script.c.

796{
797 return S_FALSE;
798}
#define S_FALSE
Definition: winerror.h:2357

◆ DocHostUIHandler_UpdateUI()

static HRESULT WINAPI DocHostUIHandler_UpdateUI ( IDocHostUIHandler2 iface)
static

Definition at line 744 of file script.c.

745{
746 return S_OK;
747}

◆ DocumentSite_ActivateMe()

static HRESULT WINAPI DocumentSite_ActivateMe ( IOleDocumentSite iface,
IOleDocumentView pViewToActivate 
)
static

Definition at line 1131 of file script.c.

1132{
1133 RECT rect = {0,0,300,300};
1134 IOleDocument *document;
1135 HRESULT hres;
1136
1137 hres = IOleDocumentView_QueryInterface(pViewToActivate, &IID_IOleDocument, (void**)&document);
1138 ok(hres == S_OK, "could not get IOleDocument: %08x\n", hres);
1139
1140 hres = IOleDocument_CreateView(document, &InPlaceSite, NULL, 0, &view);
1141 IOleDocument_Release(document);
1142 ok(hres == S_OK, "CreateView failed: %08x\n", hres);
1143
1144 hres = IOleDocumentView_SetInPlaceSite(view, &InPlaceSite);
1145 ok(hres == S_OK, "SetInPlaceSite failed: %08x\n", hres);
1146
1147 hres = IOleDocumentView_UIActivate(view, TRUE);
1148 ok(hres == S_OK, "UIActivate failed: %08x\n", hres);
1149
1150 hres = IOleDocumentView_SetRect(view, &rect);
1151 ok(hres == S_OK, "SetRect failed: %08x\n", hres);
1152
1153 hres = IOleDocumentView_Show(view, TRUE);
1154 ok(hres == S_OK, "Show failed: %08x\n", hres);
1155
1156 return S_OK;
1157}
static IOleInPlaceSite InPlaceSite
Definition: script.c:1049
& rect
Definition: startmenu.cpp:1413

◆ DocumentSite_AddRef()

static ULONG WINAPI DocumentSite_AddRef ( IOleDocumentSite iface)
static

Definition at line 1121 of file script.c.

1122{
1123 return 2;
1124}

◆ DocumentSite_QueryInterface()

static HRESULT WINAPI DocumentSite_QueryInterface ( IOleDocumentSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1116 of file script.c.

1117{
1118 return QueryInterface(riid, ppv);
1119}

◆ DocumentSite_Release()

static ULONG WINAPI DocumentSite_Release ( IOleDocumentSite iface)
static

Definition at line 1126 of file script.c.

1127{
1128 return 1;
1129}

◆ externalDisp_GetDispID()

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

Definition at line 561 of file script.c.

562{
563 if(!strcmp_wa(bstrName, "ok")) {
565 return S_OK;
566 }
567 if(!strcmp_wa(bstrName, "trace")) {
569 return S_OK;
570 }
571 if(!strcmp_wa(bstrName, "reportSuccess")) {
573 return S_OK;
574 }
575 if(!strcmp_wa(bstrName, "todo_wine_ok")) {
577 return S_OK;
578 }
579 if(!strcmp_wa(bstrName, "broken")) {
581 return S_OK;
582 }
583
584 ok(0, "unexpected name %s\n", wine_dbgstr_w(bstrName));
585 return DISP_E_UNKNOWNNAME;
586}
#define DISPID_EXTERNAL_TODO_WINE_OK
Definition: script.c:129
#define DISPID_EXTERNAL_REPORTSUCCESS
Definition: script.c:128
#define DISPID_EXTERNAL_OK
Definition: script.c:126
#define DISPID_EXTERNAL_TRACE
Definition: script.c:127
#define DISPID_EXTERNAL_BROKEN
Definition: script.c:130
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515

◆ externalDisp_InvokeEx()

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

Definition at line 588 of file script.c.

590{
591 switch(id) {
592 case DISPID_EXTERNAL_OK: {
593 VARIANT *b, *m;
594
595 ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
596 ok(pdp != NULL, "pdp == NULL\n");
597 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
598 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
599 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
600 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
601 ok(pei != NULL, "pei == NULL\n");
602
603 m = pdp->rgvarg;
604 if(V_VT(m) == (VT_BYREF|VT_VARIANT))
605 m = V_BYREF(m);
606 ok(V_VT(m) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
607
608 b = pdp->rgvarg+1;
609 if(V_VT(b) == (VT_BYREF|VT_VARIANT))
610 b = V_BYREF(b);
611 ok(V_VT(b) == VT_BOOL, "V_VT(b) = %d\n", V_VT(b));
612
613 ok(V_BOOL(b), "%s\n", wine_dbgstr_w(V_BSTR(m)));
614 return S_OK;
615 }
616
618 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
619 ok(pdp != NULL, "pdp == NULL\n");
620 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
621 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
622 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
623 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
624 ok(!pvarRes, "pvarRes != NULL\n");
625 ok(pei != NULL, "pei == NULL\n");
626
627 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
628 if(V_VT(pdp->rgvarg) == VT_BSTR)
629 trace("%s\n", wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
630
631 return S_OK;
632
634 CHECK_EXPECT(external_success);
635
636 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
637 ok(pdp != NULL, "pdp == NULL\n");
638 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
639 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
640 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
641 ok(!pvarRes, "pvarRes != NULL\n");
642 ok(pei != NULL, "pei == NULL\n");
643
644 return S_OK;
645
647 ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
648 ok(pdp != NULL, "pdp == NULL\n");
649 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
650 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
651 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
652 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
653 ok(pei != NULL, "pei == NULL\n");
654
655 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
656 ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(pdp->rgvarg));
658 ok(V_BOOL(pdp->rgvarg+1), "%s\n", wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
659
660 return S_OK;
661
663 ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags);
664 ok(pdp != NULL, "pdp == NULL\n");
665 ok(pdp->rgvarg != NULL, "rgvarg == NULL\n");
666 ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n");
667 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
668 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
669 ok(pei != NULL, "pei == NULL\n");
670
671 ok(V_VT(pdp->rgvarg) == VT_BOOL, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
672 V_VT(pvarRes) = VT_BOOL;
673 V_BOOL(pvarRes) = broken(V_BOOL(pdp->rgvarg)) ? VARIANT_TRUE : VARIANT_FALSE;
674 return S_OK;
675
676 default:
677 ok(0, "unexpected call\n");
678 return E_NOTIMPL;
679 }
680
681 return S_OK;
682}
@ VT_BSTR
Definition: compat.h:2303
@ VT_BYREF
Definition: compat.h:2342
@ VT_VARIANT
Definition: compat.h:2307
const GLfloat * m
Definition: glext.h:10848
#define todo_wine
Definition: custom.c:89
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_BYREF(A)
Definition: oleauto.h:228
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

◆ funcDisp_InvokeEx()

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

Definition at line 443 of file script.c.

445{
447
448 ok(id == DISPID_VALUE, "id = %d\n", id);
449 ok(lcid == 0, "lcid = %x\n", lcid);
450 ok(wFlags == DISPATCH_METHOD, "wFlags = %x\n", wFlags);
451 ok(pdp != NULL, "pdp == NULL\n");
452 ok(pdp->cArgs == 2, "pdp->cArgs = %d\n", pdp->cArgs);
453 ok(pdp->cNamedArgs == 1, "pdp->cNamedArgs = %d\n", pdp->cNamedArgs);
454 ok(pdp->rgdispidNamedArgs[0] == DISPID_THIS, "pdp->rgdispidNamedArgs[0] = %d\n", pdp->rgdispidNamedArgs[0]);
455 ok(V_VT(pdp->rgvarg) == VT_DISPATCH, "V_VT(rgvarg) = %d\n", V_VT(pdp->rgvarg));
456 ok(V_VT(pdp->rgvarg+1) == VT_BOOL, "V_VT(rgvarg[1]) = %d\n", V_VT(pdp->rgvarg));
457 ok(V_BOOL(pdp->rgvarg+1) == VARIANT_TRUE, "V_BOOL(rgvarg[1]) = %x\n", V_BOOL(pdp->rgvarg));
458 ok(pvarRes != NULL, "pvarRes == NULL\n");
459 ok(pei != NULL, "pei == NULL\n");
460 ok(!pspCaller, "pspCaller != NULL\n");
461
462 V_VT(pvarRes) = VT_I4;
463 V_I4(pvarRes) = 100;
464 return S_OK;
465}
@ VT_DISPATCH
Definition: compat.h:2304
static IDispatchEx funcDisp
Definition: script.c:485
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define DISPID_THIS
Definition: olectl.h:395

◆ init_key()

static BOOL init_key ( const char key_name,
const char def_value,
BOOL  init 
)
static

Definition at line 174 of file script.c.

175{
176 HKEY hkey;
177 DWORD res;
178
179 if(!init) {
181 return TRUE;
182 }
183
185 if(res != ERROR_SUCCESS)
186 return FALSE;
187
188 if(def_value)
189 res = RegSetValueA(hkey, NULL, REG_SZ, def_value, strlen(def_value));
190
191 RegCloseKey(hkey);
192
193 return res == ERROR_SUCCESS;
194}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define RegCloseKey(hKey)
Definition: registry.h:49
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
Definition: reg.c:4954
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
#define REG_SZ
Definition: layer.c:22
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
static int init
Definition: wintirpc.c:33

Referenced by init_registry(), and set_safe_reg().

◆ init_registry()

static BOOL init_registry ( BOOL  init)
static

Definition at line 2868 of file script.c.

2869{
2870 return init_key("TestScript\\CLSID", TESTSCRIPT_CLSID, init)
2871 && init_key("CLSID\\"TESTSCRIPT_CLSID"\\Implemented Categories\\{F0B7A1A1-9847-11CF-8F20-00805F2CD064}",
2872 NULL, init)
2873 && init_key("CLSID\\"TESTSCRIPT_CLSID"\\Implemented Categories\\{F0B7A1A2-9847-11CF-8F20-00805F2CD064}",
2874 NULL, init);
2875}
#define TESTSCRIPT_CLSID
Definition: script.c:120
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
Definition: script.c:174

Referenced by register_script_engine(), and START_TEST().

◆ InPlaceFrame_AddRef()

static ULONG WINAPI InPlaceFrame_AddRef ( IOleInPlaceFrame iface)
static

Definition at line 841 of file script.c.

842{
843 return 2;
844}

◆ InPlaceFrame_ContextSensitiveHelp()

static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp ( IOleInPlaceFrame iface,
BOOL  fEnterMode 
)
static

Definition at line 856 of file script.c.

857{
858 return E_NOTIMPL;
859}

◆ InPlaceFrame_EnableModeless()

static HRESULT WINAPI InPlaceFrame_EnableModeless ( IOleInPlaceFrame iface,
BOOL  fEnable 
)
static

Definition at line 908 of file script.c.

909{
910 return E_NOTIMPL;
911}

◆ InPlaceFrame_GetBorder()

static HRESULT WINAPI InPlaceFrame_GetBorder ( IOleInPlaceFrame iface,
LPRECT  lprectBorder 
)
static

Definition at line 861 of file script.c.

862{
863 return E_NOTIMPL;
864}

◆ InPlaceFrame_GetWindow()

static HRESULT WINAPI InPlaceFrame_GetWindow ( IOleInPlaceFrame iface,
HWND phwnd 
)
static

Definition at line 851 of file script.c.

852{
853 return E_NOTIMPL;
854}

◆ InPlaceFrame_InsertMenus()

static HRESULT WINAPI InPlaceFrame_InsertMenus ( IOleInPlaceFrame iface,
HMENU  hmenuShared,
LPOLEMENUGROUPWIDTHS  lpMenuWidths 
)
static

Definition at line 884 of file script.c.

886{
887 return E_NOTIMPL;
888}

◆ InPlaceFrame_QueryInterface()

static HRESULT WINAPI InPlaceFrame_QueryInterface ( IOleInPlaceFrame iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 836 of file script.c.

837{
838 return E_NOINTERFACE;
839}

◆ InPlaceFrame_Release()

static ULONG WINAPI InPlaceFrame_Release ( IOleInPlaceFrame iface)
static

Definition at line 846 of file script.c.

847{
848 return 1;
849}

◆ InPlaceFrame_RemoveMenus()

static HRESULT WINAPI InPlaceFrame_RemoveMenus ( IOleInPlaceFrame iface,
HMENU  hmenuShared 
)
static

Definition at line 897 of file script.c.

898{
899 ok(0, "unexpected call\n");
900 return E_NOTIMPL;
901}

◆ InPlaceFrame_RequestBorderSpace()

static HRESULT WINAPI InPlaceFrame_RequestBorderSpace ( IOleInPlaceFrame iface,
LPCBORDERWIDTHS  pborderwidths 
)
static

Definition at line 866 of file script.c.

868{
869 return E_NOTIMPL;
870}

◆ InPlaceFrame_SetActiveObject()

static HRESULT WINAPI InPlaceFrame_SetActiveObject ( IOleInPlaceFrame iface,
IOleInPlaceActiveObject pActiveObject,
LPCOLESTR  pszObjName 
)
static

Definition at line 878 of file script.c.

880{
881 return S_OK;
882}

◆ InPlaceFrame_SetBorderSpace()

static HRESULT WINAPI InPlaceFrame_SetBorderSpace ( IOleInPlaceFrame iface,
LPCBORDERWIDTHS  pborderwidths 
)
static

Definition at line 872 of file script.c.

874{
875 return S_OK;
876}

◆ InPlaceFrame_SetMenu()

static HRESULT WINAPI InPlaceFrame_SetMenu ( IOleInPlaceFrame iface,
HMENU  hmenuShared,
HOLEMENU  holemenu,
HWND  hwndActiveObject 
)
static

Definition at line 890 of file script.c.

892{
893 ok(0, "unexpected call\n");
894 return E_NOTIMPL;
895}

◆ InPlaceFrame_SetStatusText()

static HRESULT WINAPI InPlaceFrame_SetStatusText ( IOleInPlaceFrame iface,
LPCOLESTR  pszStatusText 
)
static

Definition at line 903 of file script.c.

904{
905 return S_OK;
906}

◆ InPlaceFrame_TranslateAccelerator()

static HRESULT WINAPI InPlaceFrame_TranslateAccelerator ( IOleInPlaceFrame iface,
LPMSG  lpmsg,
WORD  wID 
)
static

Definition at line 913 of file script.c.

914{
915 ok(0, "unexpected call\n");
916 return E_NOTIMPL;
917}

◆ InPlaceSite_AddRef()

static ULONG WINAPI InPlaceSite_AddRef ( IOleInPlaceSite iface)
static

Definition at line 944 of file script.c.

945{
946 return 2;
947}

◆ InPlaceSite_CanInPlaceActivate()

static HRESULT WINAPI InPlaceSite_CanInPlaceActivate ( IOleInPlaceSite iface)
static

Definition at line 966 of file script.c.

967{
968 return S_OK;
969}

◆ InPlaceSite_ContextSensitiveHelp()

static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp ( IOleInPlaceSite iface,
BOOL  fEnterMode 
)
static

Definition at line 960 of file script.c.

961{
962 ok(0, "unexpected call\n");
963 return E_NOTIMPL;
964}

◆ InPlaceSite_DeactivateAndUndo()

static HRESULT WINAPI InPlaceSite_DeactivateAndUndo ( IOleInPlaceSite iface)
static

Definition at line 1021 of file script.c.

1022{
1023 return E_NOTIMPL;
1024}

◆ InPlaceSite_DiscardUndoState()

static HRESULT WINAPI InPlaceSite_DiscardUndoState ( IOleInPlaceSite iface)
static

Definition at line 1016 of file script.c.

1017{
1018 return E_NOTIMPL;
1019}

◆ InPlaceSite_GetWindow()

static HRESULT WINAPI InPlaceSite_GetWindow ( IOleInPlaceSite iface,
HWND phwnd 
)
static

Definition at line 954 of file script.c.

955{
956 *phwnd = container_hwnd;
957 return S_OK;
958}
static HWND container_hwnd
Definition: script.c:144

◆ InPlaceSite_GetWindowContext()

static HRESULT WINAPI InPlaceSite_GetWindowContext ( IOleInPlaceSite iface,
IOleInPlaceFrame **  ppFrame,
IOleInPlaceUIWindow **  ppDoc,
LPRECT  lprcPosRect,
LPRECT  lprcClipRect,
LPOLEINPLACEFRAMEINFO  lpFrameInfo 
)
static

Definition at line 981 of file script.c.

984{
985 static const RECT rect = {0,0,300,300};
986
987 *ppFrame = &InPlaceFrame;
989 *lprcPosRect = rect;
990 *lprcClipRect = rect;
991
992 ok(lpFrameInfo->cb == sizeof(*lpFrameInfo), "lpFrameInfo->cb = %u, expected %u\n", lpFrameInfo->cb, (unsigned)sizeof(*lpFrameInfo));
993 lpFrameInfo->fMDIApp = FALSE;
994 lpFrameInfo->hwndFrame = container_hwnd;
995 lpFrameInfo->haccel = NULL;
996 lpFrameInfo->cAccelEntries = 0;
997
998 return S_OK;
999}
static IOleInPlaceFrame InPlaceFrame
Definition: script.c:937

◆ InPlaceSite_OnInPlaceActivate()

static HRESULT WINAPI InPlaceSite_OnInPlaceActivate ( IOleInPlaceSite iface)
static

Definition at line 971 of file script.c.

972{
973 return S_OK;
974}

◆ InPlaceSite_OnInPlaceDeactivate()

static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate ( IOleInPlaceSite iface)
static

Definition at line 1011 of file script.c.

1012{
1013 return S_OK;
1014}

◆ InPlaceSite_OnPosRectChange()

static HRESULT WINAPI InPlaceSite_OnPosRectChange ( IOleInPlaceSite iface,
LPCRECT  lprcPosRect 
)
static

Definition at line 1026 of file script.c.

1027{
1028 return E_NOTIMPL;
1029}

◆ InPlaceSite_OnUIActivate()

static HRESULT WINAPI InPlaceSite_OnUIActivate ( IOleInPlaceSite iface)
static

Definition at line 976 of file script.c.

977{
978 return S_OK;
979}

◆ InPlaceSite_OnUIDeactivate()

static HRESULT WINAPI InPlaceSite_OnUIDeactivate ( IOleInPlaceSite iface,
BOOL  fUndoable 
)
static

Definition at line 1006 of file script.c.

1007{
1008 return S_OK;
1009}

◆ InPlaceSite_QueryInterface()

static HRESULT WINAPI InPlaceSite_QueryInterface ( IOleInPlaceSite iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 939 of file script.c.

940{
941 return QueryInterface(riid, ppv);
942}

◆ InPlaceSite_Release()

static ULONG WINAPI InPlaceSite_Release ( IOleInPlaceSite iface)
static

Definition at line 949 of file script.c.

950{
951 return 1;
952}

◆ InPlaceSite_Scroll()

static HRESULT WINAPI InPlaceSite_Scroll ( IOleInPlaceSite iface,
SIZE  scrollExtant 
)
static

Definition at line 1001 of file script.c.

1002{
1003 return E_NOTIMPL;
1004}

◆ load_doc()

static void load_doc ( IHTMLDocument2 *  doc,
const char str 
)
static

Definition at line 1272 of file script.c.

1273{
1274 IHTMLElement *body = NULL;
1275 MSG msg;
1276 HRESULT hres;
1277 static const WCHAR ucPtr[] = {'b','a','c','k','g','r','o','u','n','d',0};
1278 DISPID dispID = -1;
1279 OLECHAR *name;
1280
1281 load_string(doc, str);
1283
1284 while(!doc_complete && GetMessageW(&msg, NULL, 0, 0)) {
1287 }
1288
1289 hres = IHTMLDocument2_get_body(doc, &body);
1290 ok(hres == S_OK, "get_body failed: %08x\n", hres);
1291
1292 /* Check we can query for function on the IHTMLElementBody interface */
1293 name = (WCHAR*)ucPtr;
1294 hres = IHTMLElement_GetIDsOfNames(body, &IID_NULL, &name, 1, LOCALE_USER_DEFAULT, &dispID);
1295 ok(hres == S_OK, "GetIDsOfNames(background) failed %08x\n", hres);
1296 ok(dispID == DISPID_IHTMLBODYELEMENT_BACKGROUND, "Incorrect dispID got (%d)\n", dispID);
1297
1298 IHTMLElement_Release(body);
1299}
#define msg(x)
Definition: auth_time.c:54
WCHAR OLECHAR
Definition: compat.h:2292
static void do_advise(IHTMLDocument2 *doc, REFIID riid, IUnknown *unk_advise)
Definition: script.c:1215
static BOOL doc_complete
Definition: script.c:141
static void load_string(IHTMLDocument2 *doc, const char *str)
Definition: script.c:1195
static IPropertyNotifySink PropertyNotifySink
Definition: script.c:251
#define DISPID_IHTMLBODYELEMENT_BACKGROUND
Definition: mshtmdid.h:2429
#define LOCALE_USER_DEFAULT
const GUID IID_IPropertyNotifySink
#define IID_NULL
Definition: guiddef.h:98
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
Definition: name.c:39
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by test_simple_script().

◆ load_string()

static void load_string ( IHTMLDocument2 *  doc,
const char str 
)
static

Definition at line 1195 of file script.c.

1196{
1198 IStream *stream;
1199 HGLOBAL mem;
1200 SIZE_T len;
1201
1203 len = strlen(str);
1204 mem = GlobalAlloc(0, len);
1205 memcpy(mem, str, len);
1207
1208 IHTMLDocument2_QueryInterface(doc, &IID_IPersistStreamInit, (void**)&init);
1209
1210 IPersistStreamInit_Load(init, stream);
1211 IPersistStreamInit_Release(init);
1212 IStream_Release(stream);
1213}
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
const GUID IID_IPersistStreamInit
Definition: mem.c:156
Definition: parse.h:23
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by load_doc().

◆ ObjectSafety_AddRef()

static ULONG WINAPI ObjectSafety_AddRef ( IObjectSafety iface)
static

Definition at line 1308 of file script.c.

1309{
1310 return 2;
1311}

◆ ObjectSafety_GetInterfaceSafetyOptions()

static HRESULT WINAPI ObjectSafety_GetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD pdwSupportedOptions,
DWORD pdwEnabledOptions 
)
static

Definition at line 1318 of file script.c.

1320{
1321 CHECK_EXPECT(GetInterfaceSafetyOptions);
1322
1323 ok(IsEqualGUID(&IID_IActiveScriptParse, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
1324 ok(pdwSupportedOptions != NULL, "pdwSupportedOptions == NULL\n");
1325 ok(pdwEnabledOptions != NULL, "pdwEnabledOptions == NULL\n");
1326
1327 *pdwSupportedOptions = INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER;
1328 *pdwEnabledOptions = INTERFACE_USES_DISPEX;
1329
1330 return S_OK;
1331}

◆ ObjectSafety_QueryInterface()

static HRESULT WINAPI ObjectSafety_QueryInterface ( IObjectSafety iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1301 of file script.c.

1302{
1303 *ppv = NULL;
1304 ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid));
1305 return E_NOINTERFACE;
1306}

◆ ObjectSafety_Release()

static ULONG WINAPI ObjectSafety_Release ( IObjectSafety iface)
static

Definition at line 1313 of file script.c.

1314{
1315 return 1;
1316}

◆ ObjectSafety_SetInterfaceSafetyOptions()

static HRESULT WINAPI ObjectSafety_SetInterfaceSafetyOptions ( IObjectSafety iface,
REFIID  riid,
DWORD  dwOptionSetMask,
DWORD  dwEnabledOptions 
)
static

Definition at line 1333 of file script.c.

1335{
1336 CHECK_EXPECT(SetInterfaceSafetyOptions);
1337
1338 ok(IsEqualGUID(&IID_IActiveScriptParse, riid), "unexpected riid %s\n", wine_dbgstr_guid(riid));
1339
1340 ok(dwOptionSetMask == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
1341 "dwOptionSetMask=%x\n", dwOptionSetMask);
1342 ok(dwEnabledOptions == (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER),
1343 "dwEnabledOptions=%x\n", dwOptionSetMask);
1344
1345 return S_OK;
1346}

◆ PropertyNotifySink_AddRef()

static ULONG WINAPI PropertyNotifySink_AddRef ( IPropertyNotifySink iface)
static

Definition at line 207 of file script.c.

208{
209 return 2;
210}

◆ PropertyNotifySink_OnChanged()

static HRESULT WINAPI PropertyNotifySink_OnChanged ( IPropertyNotifySink iface,
DISPID  dispID 
)
static

Definition at line 217 of file script.c.

218{
219 if(dispID == DISPID_READYSTATE){
220 BSTR state;
222
223 static const WCHAR completeW[] = {'c','o','m','p','l','e','t','e',0};
224
225 hres = IHTMLDocument2_get_readyState(notif_doc, &state);
226 ok(hres == S_OK, "get_readyState failed: %08x\n", hres);
227
228 if(!lstrcmpW(state, completeW))
230
232 }
233
234 return S_OK;
235}
#define DISPID_READYSTATE
Definition: idispids.h:22
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

◆ PropertyNotifySink_OnRequestEdit()

static HRESULT WINAPI PropertyNotifySink_OnRequestEdit ( IPropertyNotifySink iface,
DISPID  dispID 
)
static

Definition at line 237 of file script.c.

238{
239 ok(0, "unexpected call\n");
240 return E_NOTIMPL;
241}

◆ PropertyNotifySink_QueryInterface()

static HRESULT WINAPI PropertyNotifySink_QueryInterface ( IPropertyNotifySink iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 196 of file script.c.

198{
200 *ppv = iface;
201 return S_OK;
202 }
203
204 return E_NOINTERFACE;
205}

◆ PropertyNotifySink_Release()

static ULONG WINAPI PropertyNotifySink_Release ( IPropertyNotifySink iface)
static

Definition at line 212 of file script.c.

213{
214 return 1;
215}

◆ QueryInterface()

static HRESULT QueryInterface ( REFIID  riid,
void **  ppv 
)
static

Definition at line 1168 of file script.c.

1169{
1170 *ppv = NULL;
1171
1173 *ppv = &ClientSite;
1174 else if(IsEqualGUID(&IID_IOleDocumentSite, riid))
1175 *ppv = &DocumentSite;
1177 *ppv = &InPlaceSite;
1178 else if(IsEqualGUID(&IID_IDocHostUIHandler, riid) || IsEqualGUID(&IID_IDocHostUIHandler2, riid))
1180
1181 return *ppv ? S_OK : E_NOINTERFACE;
1182}
static IOleDocumentSite DocumentSite
Definition: script.c:1166
static IOleClientSite ClientSite
Definition: script.c:1114
static IDocHostUIHandler2 DocHostUIHandler
Definition: script.c:834
const GUID IID_IOleInPlaceSite
const GUID IID_IOleWindow
const GUID IID_IOleClientSite

Referenced by ClientSite_QueryInterface(), DocHostUIHandler_QueryInterface(), DocumentSite_QueryInterface(), and InPlaceSite_QueryInterface().

◆ register_script_engine()

static BOOL register_script_engine ( void  )
static

Definition at line 2877 of file script.c.

2878{
2879 DWORD regid;
2880 HRESULT hres;
2881
2882 if(!init_registry(TRUE)) {
2884 return FALSE;
2885 }
2886
2888 CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, &regid);
2889 ok(hres == S_OK, "Could not register script engine: %08x\n", hres);
2890
2891 return TRUE;
2892}
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
#define regid
Definition: ecma_167.h:64
static const GUID CLSID_TestScript
Definition: script.c:132
static BOOL init_registry(BOOL init)
Definition: script.c:2868
static IClassFactory script_cf
Definition: script.c:2710
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393

Referenced by START_TEST().

◆ run_js_script()

static void run_js_script ( const char test_name)
static

Definition at line 2804 of file script.c.

2805{
2807 char urlA[INTERNET_MAX_URL_LENGTH];
2808 IPersistMoniker *persist;
2809 IHTMLDocument2 *doc;
2810 IMoniker *mon;
2811 MSG msg;
2812 HRESULT hres;
2813
2814 static const char res[] = "res://";
2815
2816 trace("running %s...\n", test_name);
2817
2818 doc = create_document();
2819 if(!doc)
2820 return;
2821
2822 set_client_site(doc, TRUE);
2824
2825 lstrcpyA(urlA, res);
2826 GetModuleFileNameA(NULL, urlA + lstrlenA(res), sizeof(urlA) - lstrlenA(res));
2827 lstrcatA(urlA, "/");
2828 lstrcatA(urlA, test_name);
2829 MultiByteToWideChar(CP_ACP, 0, urlA, -1, url, sizeof(url)/sizeof(WCHAR));
2830
2831 hres = CreateURLMoniker(NULL, url, &mon);
2832 ok(hres == S_OK, "CreateURLMoniker failed: %08x\n", hres);
2833
2834 hres = IHTMLDocument2_QueryInterface(doc, &IID_IPersistMoniker, (void**)&persist);
2835 ok(hres == S_OK, "Could not get IPersistMoniker iface: %08x\n", hres);
2836
2837 hres = IPersistMoniker_Load(persist, FALSE, mon, NULL, 0);
2838 ok(hres == S_OK, "Load failed: %08x\n", hres);
2839
2840 IMoniker_Release(mon);
2841 IPersistMoniker_Release(persist);
2842
2843 SET_EXPECT(external_success);
2844
2845 while(!called_external_success && GetMessageW(&msg, NULL, 0, 0)) {
2848 }
2849
2850 CHECK_CALLED(external_success);
2851
2852 set_client_site(doc, FALSE);
2853 IHTMLDocument2_Release(doc);
2854}
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1418
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
int WINAPI lstrlenA(LPCSTR lpString)
Definition: lstring.c:145
static const WCHAR url[]
Definition: encode.c:1432
static const char * test_name
Definition: run.c:177
#define SET_EXPECT(func)
Definition: script.c:48
#define CHECK_CALLED(func)
Definition: script.c:63
static void set_client_site(IHTMLDocument2 *doc, BOOL set)
Definition: script.c:1236
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
Definition: umon.c:732

Referenced by run_js_tests().

◆ run_js_tests()

static void run_js_tests ( void  )
static

Definition at line 2856 of file script.c.

2857{
2858 run_js_script("jstest.html");
2859 run_js_script("exectest.html");
2860 run_js_script("vbtest.html");
2861 run_js_script("events.html");
2862 if(is_ie9plus)
2863 run_js_script("nav_test.html");
2864 else
2865 win_skip("Skipping nav_test.html on IE older than 9 (for broken ieframe onload).\n");
2866}
static void run_js_script(const char *test_name)
Definition: script.c:2804
#define win_skip
Definition: test.h:163

Referenced by START_TEST().

◆ scriptDisp_GetDispID()

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

Definition at line 487 of file script.c.

488{
489 if(!strcmp_wa(bstrName, "testProp")) {
490 CHECK_EXPECT(script_testprop_d);
491 ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
493 return S_OK;
494 }
495
496 if(!strcmp_wa(bstrName, "testProp2")) {
497 CHECK_EXPECT(script_testprop2_d);
498 ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
500 return S_OK;
501 }
502
503 if(!strcmp_wa(bstrName, "divid")) {
504 CHECK_EXPECT(script_divid_d);
505 ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex);
506 return E_FAIL;
507 }
508
509 ok(0, "unexpected call %s\n", wine_dbgstr_w(bstrName));
510 return E_NOTIMPL;
511}
#define DISPID_SCRIPT_TESTPROP
Definition: script.c:123
#define DISPID_SCRIPT_TESTPROP2
Definition: script.c:124

◆ scriptDisp_InvokeEx()

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

Definition at line 513 of file script.c.

515{
516 switch(id) {
518 CHECK_EXPECT(script_testprop_i);
519
520 ok(lcid == 0, "lcid = %x\n", lcid);
521 ok(wFlags == DISPATCH_PROPERTYGET, "wFlags = %x\n", wFlags);
522 ok(pdp != NULL, "pdp == NULL\n");
523 ok(pdp->cArgs == 0, "pdp->cArgs = %d\n", pdp->cArgs);
524 ok(pdp->cNamedArgs == 0, "pdp->cNamedArgs = %d\n", pdp->cNamedArgs);
525 ok(!pdp->rgdispidNamedArgs, "pdp->rgdispidNamedArgs != NULL\n");
526 ok(!pdp->rgvarg, "rgvarg != NULL\n");
527 ok(pvarRes != NULL, "pvarRes == NULL\n");
528 ok(pei != NULL, "pei == NULL\n");
529 ok(!pspCaller, "pspCaller != NULL\n");
530
531 V_VT(pvarRes) = VT_NULL;
532 break;
533 default:
534 ok(0, "unexpected call\n");
535 return E_NOTIMPL;
536 }
537
538 return S_OK;
539}
@ VT_NULL
Definition: compat.h:2296

◆ ServiceProvider_AddRef()

static ULONG WINAPI ServiceProvider_AddRef ( IServiceProvider iface)
static

Definition at line 302 of file script.c.

303{
304 return 2;
305}

◆ ServiceProvider_QueryInterface()

static HRESULT WINAPI ServiceProvider_QueryInterface ( IServiceProvider iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 296 of file script.c.

297{
298 ok(0, "unexpected call\n");
299 return E_NOINTERFACE;
300}

◆ ServiceProvider_QueryService()

static HRESULT WINAPI ServiceProvider_QueryService ( IServiceProvider iface,
REFGUID  guidService,
REFIID  riid,
void **  ppv 
)
static

Definition at line 312 of file script.c.

314{
315 if(IsEqualGUID(guidService, &SID_VariantConversion)) {
316 CHECK_EXPECT(QS_VariantConversion);
317 ok(IsEqualGUID(riid, &IID_IVariantChangeType), "unexpected riid %s\n", wine_dbgstr_guid(riid));
318 *ppv = &VChangeType;
319 return S_OK;
320 }
321
322 if(IsEqualGUID(guidService, &IID_IActiveScriptSite)) {
323 CHECK_EXPECT(QS_IActiveScriptSite);
324 ok(IsEqualGUID(riid, &IID_IOleCommandTarget), "unexpected riid %s\n", wine_dbgstr_guid(riid));
325 return IActiveScriptSite_QueryInterface(site, riid, ppv);
326 }
327
328 if(IsEqualGUID(guidService, &SID_GetCaller)) {
329 CHECK_EXPECT(QS_GetCaller);
330 ok(IsEqualGUID(riid, &IID_IServiceProvider), "unexpected riid %s\n", wine_dbgstr_guid(riid));
331 *ppv = NULL;
332 return E_NOINTERFACE;
333 }
334
335 ok(0, "unexpected service %s\n", wine_dbgstr_guid(guidService));
336 return E_NOINTERFACE;
337}
static IVariantChangeType VChangeType
Definition: script.c:294

◆ ServiceProvider_Release()

static ULONG WINAPI ServiceProvider_Release ( IServiceProvider iface)
static

Definition at line 307 of file script.c.

308{
309 return 1;
310}

◆ set_client_site()

static void set_client_site ( IHTMLDocument2 *  doc,
BOOL  set 
)
static

Definition at line 1236 of file script.c.

1237{
1238 IOleObject *oleobj;
1239 HRESULT hres;
1240
1241 if(!set && view) {
1242 IOleDocumentView_Show(view, FALSE);
1243 IOleDocumentView_CloseView(view, 0);
1244 IOleDocumentView_SetInPlaceSite(view, NULL);
1245 IOleDocumentView_Release(view);
1246 view = NULL;
1247 }
1248
1249 hres = IHTMLDocument2_QueryInterface(doc, &IID_IOleObject, (void**)&oleobj);
1250 ok(hres == S_OK, "Could not et IOleObject: %08x\n", hres);
1251
1252 hres = IOleObject_SetClientSite(oleobj, set ? &ClientSite : NULL);
1253 ok(hres == S_OK, "SetClientSite failed: %08x\n", hres);
1254
1255 if(set) {
1256 IHlinkTarget *hlink;
1257
1258 hres = IOleObject_QueryInterface(oleobj, &IID_IHlinkTarget, (void**)&hlink);
1259 ok(hres == S_OK, "Could not get IHlinkTarget iface: %08x\n", hres);
1260
1261 hres = IHlinkTarget_Navigate(hlink, 0, NULL);
1262 ok(hres == S_OK, "Navgate failed: %08x\n", hres);
1263
1264 IHlinkTarget_Release(hlink);
1265 }
1266
1267 IOleObject_Release(oleobj);
1268}
Definition: _set.h:50
const GUID IID_IOleObject

Referenced by run_js_script().

◆ set_safe_reg()

static BOOL set_safe_reg ( BOOL  safe_call,
BOOL  safe_data 
)
static

Definition at line 1449 of file script.c.

1450{
1451 return init_key("CLSID\\"TESTACTIVEX_CLSID"\\Implemented Categories\\{7dd95801-9882-11cf-9fa9-00aa006c42c4}",
1452 NULL, safe_call)
1453 && init_key("CLSID\\"TESTACTIVEX_CLSID"\\Implemented Categories\\{7dd95802-9882-11cf-9fa9-00aa006c42c4}",
1454 NULL, safe_data);
1455}
#define TESTACTIVEX_CLSID
Definition: script.c:121

Referenced by test_security().

◆ START_TEST()

START_TEST ( script  )

Definition at line 2944 of file script.c.

2945{
2948
2949 if(check_ie()) {
2954 }else {
2955 skip("Could not register TestScript engine\n");
2956 }
2957 run_js_tests();
2958 }else {
2959 skip("IE running in Enhanced Security Configuration\n");
2960 }
2961 }else {
2962 win_skip("Too old IE.\n");
2963 }
2964
2967}
#define skip(...)
Definition: atltest.h:64
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
static BOOL check_ie(void)
Definition: script.c:2917
static void test_simple_script(void)
Definition: script.c:2750
static void run_js_tests(void)
Definition: script.c:2856
static BOOL register_script_engine(void)
Definition: script.c:2877
static HWND create_container_window(void)
Definition: script.c:2899
static BOOL is_ie_hardened(void)
Definition: mshtml_test.h:23
int winetest_interactive
BOOL WINAPI DestroyWindow(_In_ HWND)

◆ strcmp_wa()

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

Definition at line 152 of file script.c.

153{
154 CHAR buf[512];
155 WideCharToMultiByte(CP_ACP, 0, strw, -1, buf, sizeof(buf), NULL, NULL);
156 return lstrcmpA(stra, buf);
157}
#define WideCharToMultiByte
Definition: compat.h:111
int WINAPI lstrcmpA(LPCSTR str1, LPCSTR str2)
Definition: locale.c:4194
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const char * strw(LPCWSTR x)
Definition: actctx.c:49

Referenced by ActiveScript_GetScriptDispatch(), ActiveScriptParse_ParseScriptText(), externalDisp_GetDispID(), scriptDisp_GetDispID(), test_func(), and test_nextdispid().

◆ test_arg_conv()

static void test_arg_conv ( IHTMLWindow2 window)
static

Definition at line 2005 of file script.c.

2006{
2007 IHTMLDocument2 *doc;
2008 IDispatchEx *dispex;
2009 IHTMLElement *elem;
2010 VARIANT v;
2011 HRESULT hres;
2012
2013 hres = IHTMLWindow2_get_document(window, &doc);
2014 ok(hres == S_OK, "get_document failed: %08x\n", hres);
2015
2016 hres = IHTMLDocument2_get_body(doc, &elem);
2017 IHTMLDocument2_Release(doc);
2018 ok(hres == S_OK, "get_body failed: %08x\n", hres);
2019
2020 hres = IHTMLElement_QueryInterface(elem, &IID_IDispatchEx, (void**)&dispex);
2021 IHTMLElement_Release(elem);
2022 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2023
2024 SET_EXPECT(QS_VariantConversion);
2025 SET_EXPECT(ChangeType);
2026 V_VT(&v) = VT_I4;
2027 V_I4(&v) = 0xf0f0f0;
2029 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2030 CHECK_CALLED(QS_VariantConversion);
2031 CHECK_CALLED(ChangeType);
2032
2033 V_VT(&v) = VT_EMPTY;
2035 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2036 ok(V_VT(&v) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&v));
2037 ok(!V_BSTR(&v), "V_BSTR(&var) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
2038
2039 IDispatchEx_Release(dispex);
2040}
@ VT_EMPTY
Definition: compat.h:2295
const GLdouble * v
Definition: gl.h:2040
static IHTMLWindow2 * window
Definition: events.c:77
static HRESULT dispex_propput(IDispatchEx *obj, DISPID id, DWORD flags, VARIANT *var, IServiceProvider *caller_sp)
Definition: script.c:1855
static HRESULT dispex_propget(IDispatchEx *obj, DISPID id, VARIANT *res, IServiceProvider *caller_sp)
Definition: script.c:1864
#define DISPID_IHTMLBODYELEMENT_BGCOLOR
Definition: mshtmdid.h:2436

Referenced by test_script_run().

◆ test_default_arg_conv()

static void test_default_arg_conv ( IHTMLWindow2 window)
static

Definition at line 2059 of file script.c.

2060{
2061 IHTMLDocument2 *doc;
2062 IDispatchEx *dispex;
2063 IHTMLElement *elem;
2064 VARIANT v;
2065 HRESULT hres;
2066
2067 hres = IHTMLWindow2_get_document(window, &doc);
2068 ok(hres == S_OK, "get_document failed: %08x\n", hres);
2069
2070 hres = IHTMLDocument2_get_body(doc, &elem);
2071 IHTMLDocument2_Release(doc);
2072 ok(hres == S_OK, "get_body failed: %08x\n", hres);
2073
2074 hres = IHTMLElement_QueryInterface(elem, &IID_IDispatchEx, (void**)&dispex);
2075 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
2076
2077 test_elem_disabled(elem, VARIANT_FALSE);
2078
2079 V_VT(&v) = VT_BSTR;
2080 V_BSTR(&v) = a2bstr("test");
2082 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2084
2085 test_elem_disabled(elem, VARIANT_TRUE);
2086
2087 V_VT(&v) = VT_I4;
2088 V_I4(&v) = 0;
2090 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2091
2092 test_elem_disabled(elem, VARIANT_FALSE);
2093
2094 V_VT(&v) = VT_I4;
2095 V_I4(&v) = 1;
2097 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2098
2099 test_elem_disabled(elem, VARIANT_TRUE);
2100
2101 IHTMLElement_Release(elem);
2102 IDispatchEx_Release(dispex);
2103}
#define test_elem_disabled(a, b)
Definition: script.c:2042
static BSTR a2bstr(const char *str)
Definition: script.c:159
#define DISPID_IHTMLELEMENT3_DISABLED
Definition: mshtmdid.h:1488
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009

Referenced by test_script_run().

◆ test_exec_script()

static void test_exec_script ( IHTMLDocument2 *  doc,
const char codea,
const char langa 
)
static

Definition at line 2718 of file script.c.

2719{
2721 BSTR code, lang;
2722 VARIANT v;
2723 HRESULT hres;
2724
2725 hres = IHTMLDocument2_get_parentWindow(doc, &window);
2726 ok(hres == S_OK, "get_parentWindow failed: %08x\n", hres);
2727
2728 code = a2bstr(codea);
2729 lang = a2bstr(langa);
2730
2731 SET_EXPECT(ParseScriptText_execScript);
2732 hres = IHTMLWindow2_execScript(window, code, lang, &v);
2733 ok(hres == S_OK, "execScript failed: %08x\n", hres);
2734 ok(V_VT(&v) == VT_I4, "V_VT(v) = %d\n", V_VT(&v));
2735 ok(V_I4(&v) == 10, "V_I4(v) = %d\n", V_I4(&v));
2736 CHECK_CALLED(ParseScriptText_execScript);
2738
2739 lang = a2bstr("invalid");
2740 V_VT(&v) = 100;
2741 hres = IHTMLWindow2_execScript(window, code, lang, &v);
2742 ok(hres == CO_E_CLASSSTRING, "execScript failed: %08x, expected CO_E_CLASSSTRING\n", hres);
2743 ok(V_VT(&v) == 100, "V_VT(v) = %d\n", V_VT(&v));
2746
2747 IHTMLWindow2_Release(window);
2748}
interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
Definition: inflate.c:139
static const WCHAR lang[]
Definition: wbemdisp.c:287
#define CO_E_CLASSSTRING
Definition: winerror.h:2806

Referenced by test_simple_script().

◆ test_func()

static void test_func ( IDispatchEx obj)
static

Definition at line 1872 of file script.c.

1873{
1874 DISPID id;
1875 IDispatchEx *dispex;
1876 IDispatch *disp;
1877 EXCEPINFO ei;
1878 DISPPARAMS dp;
1879 BSTR str;
1880 VARIANT var;
1881 HRESULT hres;
1882
1883 str = a2bstr("toString");
1884 hres = IDispatchEx_GetDispID(obj, str, fdexNameCaseSensitive, &id);
1886 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
1887 ok(id == DISPID_IOMNAVIGATOR_TOSTRING, "id = %x\n", id);
1888
1889 memset(&dp, 0, sizeof(dp));
1890 memset(&ei, 0, sizeof(ei));
1891 VariantInit(&var);
1892 hres = IDispatchEx_InvokeEx(obj, id, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dp, &var, &ei, NULL);
1893 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
1894 ok(V_VT(&var) == VT_DISPATCH, "V_VT(var)=%d\n", V_VT(&var));
1895 ok(V_DISPATCH(&var) != NULL, "V_DISPATCH(var) == NULL\n");
1896 disp = V_DISPATCH(&var);
1897
1898 hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1899 IDispatch_Release(disp);
1900 ok(hres == S_OK, "Could not get IDispatchEx iface: %08x\n", hres);
1901
1902 /* FIXME: Test InvokeEx(DISPATCH_METHOD) */
1903
1904 memset(&dp, 0, sizeof(dp));
1905 memset(&ei, 0, sizeof(ei));
1906 VariantInit(&var);
1907 hres = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dp, &var, &ei, NULL);
1908 ok(hres == S_OK || broken(E_ACCESSDENIED), "InvokeEx failed: %08x\n", hres);
1909 if(SUCCEEDED(hres)) {
1910 ok(V_VT(&var) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&var));
1911 ok(!strcmp_wa(V_BSTR(&var), "[object]"), "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
1912 VariantClear(&var);
1913 }
1914
1915 V_VT(&var) = VT_I4;
1916 V_I4(&var) = 100;
1917 hres = dispex_propput(obj, id, 0, &var, NULL);
1918 todo_wine ok(hres == E_NOTIMPL, "InvokeEx failed: %08x\n", hres);
1919
1920 hres = dispex_propget(dispex, DISPID_VALUE, &var, NULL);
1921 ok(hres == E_ACCESSDENIED, "InvokeEx returned: %08x, expected E_ACCESSDENIED\n", hres);
1922 if(SUCCEEDED(hres))
1923 VariantClear(&var);
1924
1925 SET_EXPECT(QS_IActiveScriptSite);
1926 SET_EXPECT(QS_GetCaller);
1927 hres = dispex_propget(dispex, DISPID_VALUE, &var, &caller_sp);
1928 ok(hres == S_OK, "InvokeEx returned: %08x, expected S_OK\n", hres);
1929 ok(V_VT(&var) == VT_BSTR, "V_VT(var) = %d\n", V_VT(&var));
1930 ok(!strcmp_wa(V_BSTR(&var), "\nfunction toString() {\n [native code]\n}\n"),
1931 "V_BSTR(var) = %s\n", wine_dbgstr_w(V_BSTR(&var)));
1932 VariantClear(&var);
1933 todo_wine CHECK_CALLED(QS_IActiveScriptSite);
1934 todo_wine CHECK_CALLED(QS_GetCaller);
1935
1936 IDispatchEx_Release(dispex);
1937}
GLuint id
Definition: glext.h:5910
#define DISPID_IOMNAVIGATOR_TOSTRING
Definition: mshtmdid.h:2000
#define V_DISPATCH(A)
Definition: oleauto.h:239
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
#define E_ACCESSDENIED
Definition: winerror.h:2849

Referenced by test_ResolveDelayLoadedAPI(), and test_script_run().

◆ test_global_id()

static void test_global_id ( void  )
static

Definition at line 1978 of file script.c.

1979{
1980 VARIANT var;
1981 DISPPARAMS dp;
1982 EXCEPINFO ei;
1983 BSTR tmp;
1984 DISPID id;
1985 HRESULT hres;
1986
1987 SET_EXPECT(GetScriptDispatch);
1988 SET_EXPECT(script_divid_d);
1989 tmp = a2bstr("divid");
1990 hres = IDispatchEx_GetDispID(window_dispex, tmp, fdexNameCaseSensitive, &id);
1991 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
1992 SysFreeString(tmp);
1993 CHECK_CALLED(GetScriptDispatch);
1994 CHECK_CALLED(script_divid_d);
1995
1996 VariantInit(&var);
1997 memset(&ei, 0, sizeof(ei));
1998 memset(&dp, 0, sizeof(dp));
1999 hres = IDispatchEx_InvokeEx(window_dispex, id, 0, DISPATCH_PROPERTYGET, &dp, &var, &ei, NULL);
2000 ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
2001 ok(V_VT(&var) == VT_DISPATCH, "V_VT(var) = %d\n", V_VT(&var));
2002 VariantClear(&var);
2003}

Referenced by test_script_run().

◆ test_nextdispid()

static void test_nextdispid ( IDispatchEx dispex)
static

Definition at line 1939 of file script.c.

1940{
1941 DISPID last_id = DISPID_STARTENUM, id, dyn_id;
1942 BSTR name;
1943 VARIANT var;
1944 HRESULT hres;
1945
1946 name = a2bstr("dynVal");
1947 hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseSensitive|fdexNameEnsure, &dyn_id);
1948 ok(hres == S_OK, "GetDispID failed: %08x\n", hres);
1950
1951 V_VT(&var) = VT_EMPTY;
1952 hres = dispex_propput(dispex, dyn_id, 0, &var, NULL);
1953 ok(hres ==