31#define CTXARG_T DWORDLONG
32#define IActiveScriptDebugVtbl IActiveScriptDebug64Vtbl
33#define IActiveScriptParseVtbl IActiveScriptParse64Vtbl
34#define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_64Vtbl
39#define IActiveScriptDebugVtbl IActiveScriptDebug32Vtbl
40#define IActiveScriptParseVtbl IActiveScriptParse32Vtbl
41#define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_32Vtbl
73 IActiveScriptSite_OnStateChange(
This->ctx->site,
state);
109 hres = IActiveScriptSite_GetItemInfo(
ctx->site,
item->name,
110 SCRIPTINFO_IUNKNOWN, &unk,
NULL);
112 WARN(
"GetItemInfo failed: %08x\n",
hres);
117 IUnknown_Release(unk);
119 WARN(
"object does not implement IDispatch\n");
146 IDispatch_Release(iter->
disp);
152 class_desc =
ctx->procs;
158 if(
ctx->host_global) {
159 IDispatch_Release(
ctx->host_global);
164 IInternetHostSecurityManager_Release(
ctx->secmgr);
169 IActiveScriptSite_Release(
ctx->site);
173 if(
ctx->script_obj) {
197 switch(
This->state) {
233 *
ppv = &
This->IActiveScriptError_iface;
235 TRACE(
"(%p)->(IID_IActiveScriptError %p)\n",
This,
ppv);
236 *
ppv = &
This->IActiveScriptError_iface;
288 FIXME(
"(%p)->(%p %p %p)\n",
This, source_context,
line, character);
329 hres = IActiveScriptSite_OnScriptError(
ctx->site, &
error->IActiveScriptError_iface);
330 IActiveScriptError_Release(&
error->IActiveScriptError_iface);
345 *
ppv = &
This->IActiveScript_iface;
348 *
ppv = &
This->IActiveScript_iface;
350 TRACE(
"(%p)->(IID_IActiveScriptDebug %p)\n",
This,
ppv);
351 *
ppv = &
This->IActiveScriptDebug_iface;
353 TRACE(
"(%p)->(IID_IActiveScriptParse %p)\n",
This,
ppv);
354 *
ppv = &
This->IActiveScriptParse_iface;
356 TRACE(
"(%p)->(IID_IActiveScriptParseProcedure2 %p)\n",
This,
ppv);
357 *
ppv = &
This->IActiveScriptParseProcedure2_iface;
360 *
ppv = &
This->IObjectSafety_iface;
419 IActiveScriptSite_AddRef(
This->ctx->site);
421 hres = IActiveScriptSite_GetLCID(
This->ctx->site, &lcid);
423 This->ctx->lcid = lcid;
425 if(
This->is_initialized)
455 if(!
This->is_initialized)
467 FIXME(
"unimplemented SCRIPTSTATE_INITIALIZED\n");
470 FIXME(
"unimplemented SCRIPTSTATE_DISCONNECTED\n");
473 FIXME(
"unimplemented state %d\n",
ss);
493 *pssState =
This->state;
522 if(
dwFlags & SCRIPTITEM_GLOBALMEMBERS) {
525 hres = IActiveScriptSite_GetItemInfo(
This->ctx->site, pstrName, SCRIPTINFO_IUNKNOWN, &unk,
NULL);
527 WARN(
"GetItemInfo failed: %08x\n",
hres);
532 IUnknown_Release(unk);
534 WARN(
"object does not implement IDispatch\n");
538 if(
This->ctx->host_global)
539 IDispatch_Release(
This->ctx->host_global);
540 IDispatch_AddRef(disp);
541 This->ctx->host_global = disp;
547 IDispatch_Release(disp);
556 IDispatch_Release(disp);
587 *ppdisp = (
IDispatch*)&
This->ctx->script_obj->IDispatchEx_iface;
588 IDispatch_AddRef(*ppdisp);
658 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
664 return IActiveScript_AddRef(&
This->IActiveScript_iface);
670 return IActiveScript_Release(&
This->IActiveScript_iface);
716 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
722 return IActiveScript_AddRef(&
This->IActiveScript_iface);
728 return IActiveScript_Release(&
This->IActiveScript_iface);
737 if(
This->is_initialized)
747 LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
748 LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName, LPCOLESTR pstrDelimiter,
750 BSTR *pbstrName, EXCEPINFO *pexcepinfo)
756 ulStartingLineNumber,
dwFlags, pbstrName, pexcepinfo);
761 LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
IUnknown *punkContext,
762 LPCOLESTR pstrDelimiter,
CTXARG_T dwSourceContextCookie,
ULONG ulStartingLine,
817 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
823 return IActiveScript_AddRef(&
This->IActiveScript_iface);
829 return IActiveScript_Release(&
This->IActiveScript_iface);
833 LPCOLESTR pstrCode, LPCOLESTR pstrFormalParams, LPCOLESTR pstrProcedureName,
834 LPCOLESTR pstrItemName,
IUnknown *punkContext, LPCOLESTR pstrDelimiter,
876 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
882 return IActiveScript_AddRef(&
This->IActiveScript_iface);
888 return IActiveScript_Release(&
This->IActiveScript_iface);
891#define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER)
894 DWORD *pdwSupportedOptions,
DWORD *pdwEnabledOptions)
900 if(!pdwSupportedOptions || !pdwEnabledOptions)
904 *pdwEnabledOptions =
This->ctx->safeopt;
909 DWORD dwOptionSetMask,
DWORD dwEnabledOptions)
918 This->ctx->safeopt = (dwEnabledOptions & dwOptionSetMask) | (
This->ctx->safeopt & ~dwOptionSetMask) | INTERFACE_USES_DISPEX;
938 ret = heap_alloc_zero(
sizeof(*
ret));
951 ctx =
ret->ctx = heap_alloc_zero(
sizeof(*
ctx));
957 ctx->safeopt = INTERFACE_USES_DISPEX;
965 IActiveScript_Release(&
ret->IActiveScript_iface);
969 hres = IActiveScript_QueryInterface(&
ret->IActiveScript_iface,
riid,
ppv);
970 IActiveScript_Release(&
ret->IActiveScript_iface);
993 *
ppv = &
This->IServiceProvider_iface;
996 *
ppv = &
This->IServiceProvider_iface;
1037 return IServiceProvider_QueryService(
This->sp, guidService,
riid,
ppv);
1053 hres = IActiveScriptSite_QueryInterface(
ctx->site, &IID_IServiceProvider, (
void**)&
sp);
1055 ERR(
"Could not get IServiceProvider iface: %08x\n",
hres);
1061 IServiceProvider_Release(
sp);
enum tagSCRIPTTHREADSTATE SCRIPTTHREADSTATE
@ SCRIPTSTATE_INITIALIZED
@ SCRIPTSTATE_DISCONNECTED
@ SCRIPTSTATE_UNINITIALIZED
enum tagSCRIPTSTATE SCRIPTSTATE
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
static WCHAR * heap_strdupW(const WCHAR *str)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
static HRESULT WINAPI VBScriptError_QueryInterface(IActiveScriptError *iface, REFIID riid, void **ppv)
static HRESULT WINAPI VBScriptDebug_GetScriptletTextAttributes(IActiveScriptDebug *iface, LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
static HRESULT WINAPI VBScriptParseProcedure_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 VBScript_Clone(IActiveScript *iface, IActiveScript **ppscript)
static ULONG WINAPI VBScriptDebug_AddRef(IActiveScriptDebug *iface)
static HRESULT WINAPI VBScriptParse_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 VBScriptSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
static HRESULT WINAPI VBScriptDebug_EnumCodeContextsOfPosition(IActiveScriptDebug *iface, CTXARG_T source, ULONG offset, ULONG len, IEnumDebugCodeContexts **ret)
static HRESULT WINAPI VBScriptError_GetExceptionInfo(IActiveScriptError *iface, EXCEPINFO *excepinfo)
static HRESULT WINAPI VBScript_GetCurrentScriptThreadID(IActiveScript *iface, SCRIPTTHREADID *pstridThread)
static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE ss)
HRESULT report_script_error(script_ctx_t *ctx)
static void exec_queued_code(script_ctx_t *ctx)
#define SUPPORTED_OPTIONS
static HRESULT WINAPI VBScript_GetScriptState(IActiveScript *iface, SCRIPTSTATE *pssState)
static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code, VARIANT *res)
static HRESULT WINAPI VBScriptDebug_QueryInterface(IActiveScriptDebug *iface, REFIID riid, void **ppv)
static HRESULT WINAPI VBScriptSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
static ULONG WINAPI VBScriptParse_Release(IActiveScriptParse *iface)
static HRESULT WINAPI VBScriptError_GetSourceLineText(IActiveScriptError *iface, BSTR *source)
static HRESULT WINAPI VBScript_QueryInterface(IActiveScript *iface, REFIID riid, void **ppv)
#define IActiveScriptParseProcedure2Vtbl
static ULONG WINAPI VBScriptParseProcedure_AddRef(IActiveScriptParseProcedure2 *iface)
static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass)
static const IActiveScriptParseProcedure2Vtbl VBScriptParseProcedureVtbl
static HRESULT WINAPI VBScript_GetScriptSite(IActiveScript *iface, REFIID riid, void **ppvObject)
static const IActiveScriptDebugVtbl VBScriptDebugVtbl
static ULONG WINAPI VBScriptError_AddRef(IActiveScriptError *iface)
static HRESULT WINAPI VBScript_InterruptScriptThread(IActiveScript *iface, SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
static HRESULT WINAPI VBScript_Close(IActiveScript *iface)
static HRESULT WINAPI VBScript_GetScriptThreadState(IActiveScript *iface, SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
static ULONG WINAPI AXSite_Release(IServiceProvider *iface)
static HRESULT WINAPI VBScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR pstrItemName, IDispatch **ppdisp)
static IServiceProviderVtbl AXSiteVtbl
#define IActiveScriptDebugVtbl
#define IActiveScriptParseVtbl
static HRESULT WINAPI VBScriptDebug_GetScriptTextAttributes(IActiveScriptDebug *iface, LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
static HRESULT WINAPI VBScriptParse_QueryInterface(IActiveScriptParse *iface, REFIID riid, void **ppv)
IUnknown * create_ax_site(script_ctx_t *ctx)
static const IObjectSafetyVtbl VBScriptSafetyVtbl
static ULONG WINAPI VBScriptDebug_Release(IActiveScriptDebug *iface)
static void destroy_script(script_ctx_t *ctx)
static void decrease_state(VBScript *This, SCRIPTSTATE state)
static AXSite * impl_from_IServiceProvider(IServiceProvider *iface)
static HRESULT WINAPI VBScript_AddNamedItem(IActiveScript *iface, LPCOLESTR pstrName, DWORD dwFlags)
static VBScript * impl_from_IActiveScriptParse(IActiveScriptParse *iface)
static ULONG WINAPI VBScriptParseProcedure_Release(IActiveScriptParseProcedure2 *iface)
static ULONG WINAPI VBScriptSafety_Release(IObjectSafety *iface)
static HRESULT WINAPI VBScriptParse_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 ULONG WINAPI AXSite_AddRef(IServiceProvider *iface)
static ULONG WINAPI VBScriptSafety_AddRef(IObjectSafety *iface)
static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface)
static HRESULT WINAPI VBScript_AddTypeLib(IActiveScript *iface, REFGUID rguidTypeLib, DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
static HRESULT WINAPI VBScriptParseProcedure_QueryInterface(IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
static const IActiveScriptParseVtbl VBScriptParseVtbl
static BOOL is_started(VBScript *This)
static VBScript * impl_from_IActiveScriptParseProcedure2(IActiveScriptParseProcedure2 *iface)
static ULONG WINAPI VBScript_Release(IActiveScript *iface)
static ULONG WINAPI VBScriptParse_AddRef(IActiveScriptParse *iface)
static VBScript * impl_from_IActiveScript(IActiveScript *iface)
static HRESULT WINAPI VBScript_GetScriptThreadID(IActiveScript *iface, DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
static ULONG WINAPI VBScript_AddRef(IActiveScript *iface)
static VBScript * impl_from_IActiveScriptDebug(IActiveScriptDebug *iface)
static void change_state(VBScript *This, SCRIPTSTATE state)
static ULONG WINAPI VBScriptError_Release(IActiveScriptError *iface)
static HRESULT WINAPI VBScriptSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
static HRESULT WINAPI AXSite_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
static HRESULT WINAPI VBScriptError_GetSourcePosition(IActiveScriptError *iface, DWORD *source_context, ULONG *line, LONG *character)
static const IActiveScriptVtbl VBScriptVtbl
static const IActiveScriptErrorVtbl VBScriptErrorVtbl
static HRESULT WINAPI AXSite_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
static void release_script(script_ctx_t *ctx)
IDispatch * lookup_named_item(script_ctx_t *ctx, const WCHAR *name, unsigned flags)
HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
static VBScriptError * impl_from_IActiveScriptError(IActiveScriptError *iface)
static VBScript * impl_from_IObjectSafety(IObjectSafety *iface)
void clear_ei(script_ctx_t *ctx)
HRESULT exec_script(HTMLInnerWindow *, const WCHAR *, const WCHAR *, VARIANT *) DECLSPEC_HIDDEN
#define InterlockedCompareExchange
void release_dynamic_vars(dynamic_var_t *var)
HRESULT compile_script(script_ctx_t *ctx, const WCHAR *code, const WCHAR *args, const WCHAR *delimiter, BOOL from_eval, BOOL use_decode, bytecode_t **ret)
HRESULT init_global(script_ctx_t *ctx)
void heap_pool_free(heap_pool_t *) DECLSPEC_HIDDEN
void heap_pool_init(heap_pool_t *) DECLSPEC_HIDDEN
static const WCHAR desc[]
static EXCEPINFO excepinfo
#define DEFAULT_UNREACHABLE
BSTR WINAPI SysAllocString(LPCOLESTR str)
#define IsEqualGUID(rguid1, rguid2)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
IDispatchEx IDispatchEx_iface
IActiveScriptError IActiveScriptError_iface
IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_iface
IActiveScriptDebug IActiveScriptDebug_iface
IActiveScriptParse IActiveScriptParse_iface
IActiveScript IActiveScript_iface
IObjectSafety IObjectSafety_iface
struct _class_desc_t * next
IDispatchEx IDispatchEx_iface
#define CONTAINING_RECORD(address, type, field)
HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
HRESULT create_script_disp(script_ctx_t *ctx, ScriptDisp **ret)
HRESULT compile_procedure(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, class_desc_t **ret)
void release_vbscode(vbscode_t *code)
void detach_global_objects(script_ctx_t *ctx)
DWORD WINAPI GetCurrentThreadId(void)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject