ReactOS  0.4.13-dev-73-gcfe54aa
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 IDispatchEx * window_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)
GLenum func
Definition: glext.h:6028

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)
GLenum func
Definition: glext.h:6028
#define broken(x)
Definition: _sntprintf.h:21

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)
GLenum func
Definition: glext.h:6028

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)
GLenum func
Definition: glext.h:6028
#define TRUE
Definition: types.h:120
#define expect_(expected, got, precision)
Definition: font.c:29

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)
GLenum func
Definition: glext.h:6028

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 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
#define ok_(x1, x2)
#define DWORD
Definition: nt_native.h:44
Definition: parser.c:48
HRESULT hres
Definition: protocol.c:465
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59

◆ _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 }
#define ok_(x1, x2)
short VARIANT_BOOL
Definition: compat.h:1931
static size_t elem
Definition: string.c:68
Definition: parser.c:48
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

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

Referenced by 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 }
disp
Definition: i386-dis.c:3181
static const WCHAR windowW[]
Definition: script.c:48
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CHECK_EXPECT(func)
Definition: script.c:57
static IActiveScriptSite * site
Definition: script.c:149
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
#define wine_dbgstr_w
Definition: kernel32.h:34
#define ok(value,...)
static IDispatchEx * window_dispex
Definition: script.c:140
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IDispatch
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ ActiveScript_Close()

static HRESULT WINAPI ActiveScript_Close ( IActiveScript iface)
static

Definition at line 2539 of file script.c.

2540 {
2542  return E_NOTIMPL;
2543 }
#define CHECK_EXPECT(func)
Definition: script.c:57
Definition: sacdrv.h:267
#define E_NOTIMPL
Definition: ddrawi.h:99

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

◆ 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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
#define wine_dbgstr_w
Definition: kernel32.h:34
static IDispatch * script_disp
Definition: script.c:142
#define ok(value,...)
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: script.c:152
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99

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

◆ 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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
#define S_OK
Definition: intsafe.h:59
static SCRIPTSTATE state
Definition: script.c:150

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

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

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

◆ 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)) {
2421  *ppv = &ActiveScriptParse;
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: kmt_test.h:217
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
static IActiveScriptParse ActiveScriptParse
Definition: script.c:2409
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static IActiveScriptProperty ActiveScriptProperty
Definition: script.c:1785
static IActiveScriptParseProcedure2 ActiveScriptParseProcedure
Definition: script.c:1820
static IObjectSafety ObjectSafety
Definition: script.c:1356

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CHECK_EXPECT(func)
Definition: script.c:57
#define IActiveScriptSiteDebug_Release
Definition: script.c:41
static IActiveScriptSite * site
Definition: script.c:149
DWORD LCID
Definition: nls.h:13
pass
Definition: typegen.h:24
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int poll(struct pollfd *ufds, int nfds, int timeout)
Definition: adnstest.c:68
#define S_OK
Definition: intsafe.h:59
static SCRIPTSTATE state
Definition: script.c:150
#define debug(msg)
Definition: key_call.c:71
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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) {
2511  case SCRIPTSTATE_STARTED:
2512  CHECK_EXPECT(SetScriptState_STARTED);
2513  break;
2514  case SCRIPTSTATE_CONNECTED:
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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
static IActiveScriptSite * site
Definition: script.c:149
#define ok(value,...)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
static SCRIPTSTATE state
Definition: script.c:150
#define ss
Definition: i386-dis.c:432

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

◆ 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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
#define S_OK
Definition: intsafe.h:59

◆ 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 
2392  test_script_run();
2393  return S_OK;
2394  }
2395 
2396  ok(0, "unexpected script %s\n", wine_dbgstr_w(pstrCode));
2397  return E_FAIL;
2398 }
Definition: compat.h:1939
#define CHECK_EXPECT(func)
Definition: script.c:57
#define wine_dbgstr_w
Definition: kernel32.h:34
#define E_FAIL
Definition: ddrawi.h:102
#define V_I4(A)
Definition: oleauto.h:247
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: script.c:152
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
static void test_script_run(void)
Definition: script.c:2141

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416

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

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416

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

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416

◆ 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 }
Definition: compat.h:1939
#define CHECK_EXPECT(func)
Definition: script.c:57
#define V_I4(A)
Definition: oleauto.h:247
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 
1388  if(SUCCEEDED(ax_getopt_hres)) {
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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
static HRESULT ax_getopt_hres
Definition: script.c:145
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CHECK_EXPECT(func)
Definition: script.c:57
static BOOL ax_objsafe
Definition: script.c:143
#define CHECK_EXPECT2(func)
Definition: script.c:51
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ 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 
1415  if(IsEqualGUID(&IID_IDispatch, riid)) {
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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
#define CHECK_EXPECT(func)
Definition: script.c:57
REFIID riid
Definition: precomp.h:44
static HRESULT ax_setopt_disp_data_hres
Definition: script.c:146
const char * wine_dbgstr_guid(const GUID *guid)
static HRESULT ax_setopt_disp_caller_hres
Definition: script.c:146
#define E_FAIL
Definition: ddrawi.h:102
#define ok(value,...)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IDispatch
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
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 }
#define trace(...)
Definition: kmt_test.h:217
#define TRUE
Definition: types.h:120
static BOOL is_ie9plus
Definition: script.c:137
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define SUCCEEDED(hr)
Definition: intsafe.h:57
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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
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 }
#define ok(value,...)
#define S_OK
Definition: intsafe.h:59

◆ 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 CLSID CLSID_IdentityUnmarshal
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

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

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

◆ 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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
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 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

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

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

◆ 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 }
struct _WNDCLASSEXA WNDCLASSEXA
char CHAR
Definition: xmlstorage.h:175
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4184
#define CW_USEDEFAULT
Definition: winuser.h:225
static LRESULT WINAPI wnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: script.c:2894
smooth NULL
Definition: ftsmooth.c:416
ATOM WINAPI RegisterClassExA(_In_ CONST WNDCLASSEXA *)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637

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 }
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
#define SUCCEEDED(hr)
Definition: intsafe.h:57

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

◆ DEFINE_EXPECT() [1/34]

DEFINE_EXPECT ( CreateInstance  )

◆ DEFINE_EXPECT() [2/34]

DEFINE_EXPECT ( GetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [3/34]

DEFINE_EXPECT ( SetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [4/34]

DEFINE_EXPECT ( InitNew  )

◆ DEFINE_EXPECT() [5/34]

DEFINE_EXPECT ( Close  )

◆ DEFINE_EXPECT() [6/34]

DEFINE_EXPECT ( SetProperty_HACK_TRIDENTEVENTSINK  )

◆ DEFINE_EXPECT() [7/34]

DEFINE_EXPECT ( SetProperty_INVOKEVERSIONING  )

◆ DEFINE_EXPECT() [8/34]

DEFINE_EXPECT ( SetProperty_ABBREVIATE_GLOBALNAME_RESOLUTION  )

◆ DEFINE_EXPECT() [9/34]

DEFINE_EXPECT ( SetScriptSite  )

◆ DEFINE_EXPECT() [10/34]

DEFINE_EXPECT ( GetScriptState  )

◆ DEFINE_EXPECT() [11/34]

DEFINE_EXPECT ( SetScriptState_STARTED  )

◆ DEFINE_EXPECT() [12/34]

DEFINE_EXPECT ( SetScriptState_CONNECTED  )

◆ DEFINE_EXPECT() [13/34]

DEFINE_EXPECT ( SetScriptState_DISCONNECTED  )

◆ DEFINE_EXPECT() [14/34]

DEFINE_EXPECT ( AddNamedItem  )

◆ DEFINE_EXPECT() [15/34]

DEFINE_EXPECT ( ParseScriptText_script  )

◆ DEFINE_EXPECT() [16/34]

DEFINE_EXPECT ( ParseScriptText_execScript  )

◆ DEFINE_EXPECT() [17/34]

DEFINE_EXPECT ( GetScriptDispatch  )

◆ DEFINE_EXPECT() [18/34]

DEFINE_EXPECT ( funcDisp  )

◆ DEFINE_EXPECT() [19/34]

DEFINE_EXPECT ( script_divid_d  )

◆ DEFINE_EXPECT() [20/34]

DEFINE_EXPECT ( script_testprop_d  )

◆ DEFINE_EXPECT() [21/34]

DEFINE_EXPECT ( script_testprop_i  )

◆ DEFINE_EXPECT() [22/34]

DEFINE_EXPECT ( script_testprop2_d  )

◆ DEFINE_EXPECT() [23/34]

DEFINE_EXPECT ( AXQueryInterface_IActiveScript  )

◆ DEFINE_EXPECT() [24/34]

DEFINE_EXPECT ( AXQueryInterface_IObjectSafety  )

◆ DEFINE_EXPECT() [25/34]

DEFINE_EXPECT ( AXGetInterfaceSafetyOptions  )

◆ DEFINE_EXPECT() [26/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatch_caller  )

◆ DEFINE_EXPECT() [27/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatch_data  )

◆ DEFINE_EXPECT() [28/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatchEx_caller_secmgr  )

◆ DEFINE_EXPECT() [29/34]

DEFINE_EXPECT ( AXSetInterfaceSafetyOptions_IDispatchEx_caller  )

◆ DEFINE_EXPECT() [30/34]

DEFINE_EXPECT ( external_success  )

◆ DEFINE_EXPECT() [31/34]

DEFINE_EXPECT ( QS_VariantConversion  )

◆ DEFINE_EXPECT() [32/34]

DEFINE_EXPECT ( QS_IActiveScriptSite  )

◆ DEFINE_EXPECT() [33/34]

DEFINE_EXPECT ( QS_GetCaller  )

◆ DEFINE_EXPECT() [34/34]

DEFINE_EXPECT ( ChangeType  )

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

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

◆ DispatchEx_GetDispID()

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

Definition at line 437 of file script.c.

438 {
439  ok(0, "unexpected call\n");
440  return E_NOTIMPL;
441 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DispatchEx_GetIDsOfNames()

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

Definition at line 385 of file script.c.

388 {
389  ok(0, "unexpected call\n");
390  return E_NOTIMPL;
391 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

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

◆ DispatchEx_GetMemberProperties()

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

Definition at line 413 of file script.c.

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

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

◆ DispatchEx_GetNextDispID()

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

Definition at line 425 of file script.c.

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

◆ DispatchEx_GetTypeInfo()

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

Definition at line 378 of file script.c.

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

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

◆ DispatchEx_Invoke()

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

Definition at line 393 of file script.c.

396 {
397  ok(0, "unexpected call\n");
398  return E_NOTIMPL;
399 }
#define ok(value,...)
#define E_NOTIMPL
Definition: ddrawi.h:99

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

◆ 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 }
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
smooth NULL
Definition: ftsmooth.c:416
struct stdole::EXCEPINFO EXCEPINFO
GLuint res
Definition: glext.h:9613
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
static IServiceProvider caller_sp
Definition: script.c:346

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 }
smooth NULL
Definition: ftsmooth.c:416
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
GLbitfield flags
Definition: glext.h:7161
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
struct stdole::DISPPARAMS DISPPARAMS
#define LOCALE_NEUTRAL
static IServiceProvider caller_sp
Definition: script.c:346

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 }
static IHTMLDocument2 * notif_doc
Definition: script.c:138
REFIID riid
Definition: precomp.h:44
const GUID IID_IConnectionPointContainer
struct container container
#define ok(value,...)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
POINT cp
Definition: magnifier.c:60

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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ DocHostUIHandler_HideUI()

static HRESULT WINAPI DocHostUIHandler_HideUI ( IDocHostUIHandler2 iface)
static

Definition at line 739 of file script.c.

740 {
741  return S_OK;
742 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT QueryInterface(REFIID, void **)
Definition: script.c:1168

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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
#define TRUE
Definition: types.h:120
& rect
Definition: startmenu.cpp:1413
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59

◆ 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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT QueryInterface(REFIID, void **)
Definition: script.c:1168

◆ 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 DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define DISPID_EXTERNAL_TODO_WINE_OK
Definition: script.c:129
#define DISPID_EXTERNAL_OK
Definition: script.c:126
#define wine_dbgstr_w
Definition: kernel32.h:34
#define ok(value,...)
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: script.c:152
#define DISPID_EXTERNAL_TRACE
Definition: script.c:127
#define DISPID_EXTERNAL_BROKEN
Definition: script.c:130
#define S_OK
Definition: intsafe.h:59
#define DISPID_EXTERNAL_REPORTSUCCESS
Definition: script.c:128

◆ 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));
657  todo_wine
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 }
#define trace(...)
Definition: kmt_test.h:217
#define DISPID_EXTERNAL_TODO_WINE_OK
Definition: script.c:129
#define CHECK_EXPECT(func)
Definition: script.c:57
#define DISPID_EXTERNAL_OK
Definition: script.c:126
#define wine_dbgstr_w
Definition: kernel32.h:34
const GLfloat * m
Definition: glext.h:10848
#define ok(value,...)
#define V_BYREF(A)
Definition: oleauto.h:228
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define V_BOOL(A)
Definition: oleauto.h:224
#define DISPID_EXTERNAL_TRACE
Definition: script.c:127
#define todo_wine
Definition: test.h:154
#define V_VT(A)
Definition: oleauto.h:211
#define DISPID_EXTERNAL_BROKEN
Definition: script.c:130
#define V_BSTR(A)
Definition: oleauto.h:226
#define broken(x)
Definition: _sntprintf.h:21
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DISPID_EXTERNAL_REPORTSUCCESS
Definition: script.c:128

◆ 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 }
static IDispatchEx funcDisp
Definition: script.c:485
Definition: compat.h:1939
#define CHECK_EXPECT(func)
Definition: script.c:57
#define V_I4(A)
Definition: oleauto.h:247
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
#define S_OK
Definition: intsafe.h:59
#define DISPID_THIS
Definition: olectl.h:395

◆ 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 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
Definition: reg.c:4990
static int init
Definition: wintirpc.c:33
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1180
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1225
GLuint res
Definition: glext.h:9613
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define REG_SZ
Definition: layer.c:22

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 }
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
Definition: script.c:174
static int init
Definition: wintirpc.c:33
smooth NULL
Definition: ftsmooth.c:416
#define TESTSCRIPT_CLSID
Definition: script.c:120

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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364

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

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define S_OK
Definition: intsafe.h:59

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

◆ 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 }
#define S_OK
Definition: intsafe.h:59

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

◆ 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 }
#define S_OK
Definition: intsafe.h:59

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

◆ InPlaceSite_DeactivateAndUndo()

static HRESULT WINAPI InPlaceSite_DeactivateAndUndo ( IOleInPlaceSite iface)
static

Definition at line 1021 of file script.c.

1022 {
1023  return E_NOTIMPL;
1024 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InPlaceSite_DiscardUndoState()

static HRESULT WINAPI InPlaceSite_DiscardUndoState ( IOleInPlaceSite iface)
static

Definition at line 1016 of file script.c.

1017 {
1018  return E_NOTIMPL;
1019 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
#define S_OK
Definition: intsafe.h:59
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;
988  *ppDoc = (IOleInPlaceUIWindow*)&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 }
& rect
Definition: startmenu.cpp:1413
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
static IOleInPlaceFrame InPlaceFrame
Definition: script.c:937
#define S_OK
Definition: intsafe.h:59
static HWND container_hwnd
Definition: script.c:144

◆ InPlaceSite_OnInPlaceActivate()

static HRESULT WINAPI InPlaceSite_OnInPlaceActivate ( IOleInPlaceSite iface)
static

Definition at line 971 of file script.c.

972 {
973  return S_OK;
974 }
#define S_OK
Definition: intsafe.h:59

◆ InPlaceSite_OnInPlaceDeactivate()

static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate ( IOleInPlaceSite iface)
static

Definition at line 1011 of file script.c.

1012 {
1013  return S_OK;
1014 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InPlaceSite_OnUIActivate()

static HRESULT WINAPI InPlaceSite_OnUIActivate ( IOleInPlaceSite iface)
static

Definition at line 976 of file script.c.

977 {
978  return S_OK;
979 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
#define S_OK
Definition: intsafe.h:59

◆ 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 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT QueryInterface(REFIID, void **)
Definition: script.c:1168

◆ 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 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ 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 }
WCHAR OLECHAR
Definition: compat.h:1933
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define LOCALE_USER_DEFAULT
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define ok(value,...)
const WCHAR * str
static BOOL doc_complete
Definition: script.c:141
smooth NULL
Definition: ftsmooth.c:416
static void load_string(IHTMLDocument2 *doc, const char *str)
Definition: script.c:1195
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:93
static void do_advise(IHTMLDocument2 *doc, REFIID riid, IUnknown *unk_advise)
Definition: script.c:1215
static IPropertyNotifySink PropertyNotifySink
Definition: script.c:251
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
Definition: md5.c:100
const GUID IID_IPropertyNotifySink
#define DISPID_IHTMLBODYELEMENT_BACKGROUND
Definition: mshtmdid.h:2429
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define msg(x)
Definition: auth_time.c:54
Definition: name.c:36
GLuint const GLchar * name
Definition: glext.h:6031

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 
1202  doc_complete = FALSE;
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 }
#define TRUE
Definition: types.h:120
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static int init
Definition: wintirpc.c:33
const WCHAR * str
static BOOL doc_complete
Definition: script.c:141
Definition: parse.h:22
const GUID IID_IPersistStreamInit
GLuint GLuint stream
Definition: glext.h:7522
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
ULONG_PTR SIZE_T
Definition: typedefs.h:78
Definition: mem.c:156

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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ 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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416

◆ 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 }
#define CHECK_EXPECT(func)
Definition: script.c:57
REFIID riid
Definition: precomp.h:44
const char * wine_dbgstr_guid(const GUID *guid)
#define ok(value,...)
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ 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;
221  HRESULT hres;
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))
229  doc_complete = TRUE;
230 
232  }
233 
234  return S_OK;
235 }
#define TRUE
Definition: types.h:120
static IHTMLDocument2 * notif_doc
Definition: script.c:138
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
OLECHAR * BSTR
Definition: compat.h:1934
#define ok(value,...)
static BOOL doc_complete
Definition: script.c:141
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define S_OK
Definition: intsafe.h:59
#define DISPID_READYSTATE
Definition: idispids.h:22
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static SCRIPTSTATE state
Definition: script.c:150

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

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

◆ 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))
1179  *ppv = &DocHostUIHandler;
1180 
1181  return *ppv ? S_OK : E_NOINTERFACE;
1182 }
static IOleInPlaceSite InPlaceSite
Definition: script.c:1049
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
const GUID IID_IOleInPlaceSite
const GUID IID_IOleClientSite
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
static IOleClientSite ClientSite
Definition: script.c:1114
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
static IDocHostUIHandler2 DocHostUIHandler
Definition: script.c:834
static IOleDocumentSite DocumentSite
Definition: script.c:1166
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IOleWindow

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 }
static IClassFactory script_cf
Definition: script.c:2710
#define TRUE
Definition: types.h:120
static const GUID CLSID_TestScript
Definition: script.c:132
#define regid
Definition: ecma_167.h:64
#define ok(value,...)
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL init_registry(BOOL init)
Definition: script.c:2868
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2806
#define S_OK
Definition: intsafe.h:59

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 }
#define trace(...)
Definition: kmt_test.h:217
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define TRUE
Definition: types.h:120
#define CP_ACP
Definition: compat.h:99
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:546
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define ok(value,...)
smooth NULL
Definition: ftsmooth.c:416
#define INTERNET_MAX_URL_LENGTH
Definition: session.c:1380
static void set_client_site(IHTMLDocument2 *doc, BOOL set)
Definition: script.c:1236
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:123
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
Definition: lstring.c:100
static void do_advise(IHTMLDocument2 *doc, REFIID riid, IUnknown *unk_advise)
Definition: script.c:1215
static IPropertyNotifySink PropertyNotifySink
Definition: script.c:251
static const char * test_name
Definition: run.c:166
#define S_OK
Definition: intsafe.h:59