31#define CTXARG_T DWORDLONG
32#define IActiveScriptParseVtbl IActiveScriptParse64Vtbl
33#define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_64Vtbl
38#define IActiveScriptParseVtbl IActiveScriptParse32Vtbl
39#define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_32Vtbl
83 IServiceProvider_Release(&
ctx->jscaller->IServiceProvider_iface);
95 IActiveScriptSite_OnStateChange(
This->site,
state);
109 IActiveScriptSite_OnEnterScript(
This->site);
112 hres =
exec_source(
This->ctx,
EXEC_GLOBAL,
code, &
code->global_code,
NULL,
NULL,
NULL,
This->ctx->global, 0,
NULL,
NULL);
114 IActiveScriptSite_OnLeaveScript(
This->site);
122 if(!
This->queue_head)
125 iter =
This->queue_head;
140 for(iter =
This->queue_head; iter; iter = iter->
next)
156 IActiveScriptSite_AddRef(
This->site);
166 switch(
This->ctx->state) {
182 if(
This->ctx->host_global) {
183 IDispatch_Release(
This->ctx->host_global);
187 if(
This->ctx->named_items) {
190 iter =
This->ctx->named_items;
195 IDispatch_Release(iter->
disp);
204 if(
This->ctx->secmgr) {
205 IInternetHostSecurityManager_Release(
This->ctx->secmgr);
209 if(
This->ctx->site) {
210 IActiveScriptSite_Release(
This->ctx->site);
214 if(
This->ctx->global) {
229 IActiveScriptSite_OnStateChange(
This->site,
state);
238 IActiveScriptSite_Release(
This->site);
262 *
ppv = &
This->IServiceProvider_iface;
265 *
ppv = &
This->IServiceProvider_iface;
296 IServiceProvider_Release(
This->sp);
314 return IServiceProvider_QueryService(
This->sp, guidService,
riid,
ppv);
330 hres = IActiveScriptSite_QueryInterface(
ctx->site, &IID_IServiceProvider, (
void**)&
sp);
332 TRACE(
"Could not get IServiceProvider iface: %08x\n",
hres);
337 IServiceProvider_Release(
sp);
361 *
ppv = &
This->IActiveScript_iface;
364 *
ppv = &
This->IActiveScript_iface;
366 TRACE(
"(%p)->(IID_IActiveScriptParse %p)\n",
This,
ppv);
367 *
ppv = &
This->IActiveScriptParse_iface;
369 TRACE(
"(%p)->(IID_IActiveScriptParseProcedure %p)\n",
This,
ppv);
370 *
ppv = &
This->IActiveScriptParseProcedure2_iface;
372 TRACE(
"(%p)->(IID_IActiveScriptParseProcedure2 %p)\n",
This,
ppv);
373 *
ppv = &
This->IActiveScriptParseProcedure2_iface;
375 TRACE(
"(%p)->(IID_IActiveScriptProperty %p)\n",
This,
ppv);
376 *
ppv = &
This->IActiveScriptProperty_iface;
379 *
ppv = &
This->IObjectSafety_iface;
381 TRACE(
"(%p)->(IID_IVariantChangeType %p)\n",
This,
ppv);
382 *
ppv = &
This->IVariantChangeType_iface;
413 IActiveScript_Close(&
This->IActiveScript_iface);
444 IActiveScriptSite_AddRef(
This->site);
446 hres = IActiveScriptSite_GetLCID(
This->site, &lcid);
490 FIXME(
"unimplemented SCRIPTSTATE_INITIALIZED\n");
493 FIXME(
"unimplemented state %d\n",
ss);
543 if(
dwFlags & SCRIPTITEM_GLOBALMEMBERS) {
546 hres = IActiveScriptSite_GetItemInfo(
This->site, pstrName, SCRIPTINFO_IUNKNOWN, &unk,
NULL);
548 WARN(
"GetItemInfo failed: %08x\n",
hres);
553 IUnknown_Release(unk);
555 WARN(
"object does not implement IDispatch\n");
559 if(
This->ctx->host_global)
560 IDispatch_Release(
This->ctx->host_global);
561 IDispatch_AddRef(disp);
562 This->ctx->host_global = disp;
568 IDispatch_Release(disp);
577 IDispatch_Release(disp);
582 item->next =
This->ctx->named_items;
612 IDispatch_AddRef(*ppdisp);
682 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
688 return IActiveScript_AddRef(&
This->IActiveScript_iface);
694 return IActiveScript_Release(&
This->IActiveScript_iface);
714 ctx->active_script = &
This->IActiveScript_iface;
717 ctx->html_mode =
This->html_mode;
740 LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
741 LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName, LPCOLESTR pstrDelimiter,
743 BSTR *pbstrName, EXCEPINFO *pexcepinfo)
749 ulStartingLineNumber,
dwFlags, pbstrName, pexcepinfo);
754 LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
IUnknown *punkContext,
755 LPCOLESTR pstrDelimiter,
CTXARG_T dwSourceContextCookie,
ULONG ulStartingLine,
774 if(
dwFlags & SCRIPTTEXT_ISEXPRESSION) {
777 IActiveScriptSite_OnEnterScript(
This->site);
780 hres =
exec_source(
This->ctx,
EXEC_GLOBAL,
code, &
code->global_code,
NULL,
NULL,
NULL,
This->ctx->global, 0,
NULL, &
r);
787 IActiveScriptSite_OnLeaveScript(
This->site);
830 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
836 return IActiveScript_AddRef(&
This->IActiveScript_iface);
842 return IActiveScript_Release(&
This->IActiveScript_iface);
846 LPCOLESTR pstrCode, LPCOLESTR pstrFormalParams, LPCOLESTR pstrProcedureName,
847 LPCOLESTR pstrItemName,
IUnknown *punkContext, LPCOLESTR pstrDelimiter,
892 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
898 return IActiveScript_AddRef(&
This->IActiveScript_iface);
904 return IActiveScript_Release(&
This->IActiveScript_iface);
911 FIXME(
"(%p)->(%x %p %p)\n",
This, dwProperty, pvarIndex, pvarValue);
923 FIXME(
"unsupported pvarIndex\n");
926 case SCRIPTPROP_INVOKEVERSIONING:
933 This->version =
V_I4(pvarValue) & 0x1ff;
937 FIXME(
"Unimplemented property %x\n", dwProperty);
960 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
966 return IActiveScript_AddRef(&
This->IActiveScript_iface);
972 return IActiveScript_Release(&
This->IActiveScript_iface);
975#define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER)
978 DWORD *pdwSupportedOptions,
DWORD *pdwEnabledOptions)
984 if(!pdwSupportedOptions || !pdwEnabledOptions)
988 *pdwEnabledOptions =
This->safeopt;
994 DWORD dwOptionSetMask,
DWORD dwEnabledOptions)
1003 This->safeopt = (dwEnabledOptions & dwOptionSetMask) | (
This->safeopt & ~dwOptionSetMask) | INTERFACE_USES_DISPEX;
1023 return IActiveScript_QueryInterface(&
This->IActiveScript_iface,
riid,
ppv);
1029 return IActiveScript_AddRef(&
This->IActiveScript_iface);
1035 return IActiveScript_Release(&
This->IActiveScript_iface);
1047 FIXME(
"Object uninitialized\n");
1077 ret = heap_alloc_zero(
sizeof(*
ret));
1090 ret->safeopt = INTERFACE_USES_DISPEX;
1091 ret->is_encode = is_encode;
1093 hres = IActiveScript_QueryInterface(&
ret->IActiveScript_iface,
riid,
ppv);
1094 IActiveScript_Release(&
ret->IActiveScript_iface);
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 WCHAR * heap_strdupW(const WCHAR *str)
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
static const IActiveScriptParseProcedure2Vtbl JScriptParseProcedureVtbl
static JScript * impl_from_IObjectSafety(IObjectSafety *iface)
static ULONG WINAPI JScriptParse_Release(IActiveScriptParse *iface)
static JScript * impl_from_IActiveScriptParse(IActiveScriptParse *iface)
static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE ss)
static void clear_script_queue(JScript *This)
static void change_state(JScript *This, SCRIPTSTATE state)
static HRESULT WINAPI JScript_GetCurrentScriptThreadID(IActiveScript *iface, SCRIPTTHREADID *pstridThread)
static const IActiveScriptParseVtbl JScriptParseVtbl
static ULONG WINAPI JScript_AddRef(IActiveScript *iface)
static HRESULT WINAPI JScriptParseProcedure_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 ULONG WINAPI JScript_Release(IActiveScript *iface)
#define SUPPORTED_OPTIONS
static ULONG WINAPI JScriptSafety_AddRef(IObjectSafety *iface)
static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface, LPCOLESTR pstrName, DWORD dwFlags)
static HRESULT WINAPI JScriptProperty_SetProperty(IActiveScriptProperty *iface, DWORD dwProperty, VARIANT *pvarIndex, VARIANT *pvarValue)
static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass)
static HRESULT WINAPI JScriptParseProcedure_QueryInterface(IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
#define IActiveScriptParseProcedure2Vtbl
static HRESULT WINAPI JScriptProperty_GetProperty(IActiveScriptProperty *iface, DWORD dwProperty, VARIANT *pvarIndex, VARIANT *pvarValue)
static ULONG WINAPI JScriptParseProcedure_AddRef(IActiveScriptParseProcedure2 *iface)
static HRESULT WINAPI JScriptParse_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 WINAPI JScript_Close(IActiveScript *iface)
static HRESULT WINAPI JScriptParse_QueryInterface(IActiveScriptParse *iface, REFIID riid, void **ppv)
static void decrease_state(JScript *This, SCRIPTSTATE state)
static ULONG WINAPI AXSite_Release(IServiceProvider *iface)
static IServiceProviderVtbl AXSiteVtbl
static JScript * impl_from_IActiveScript(IActiveScript *iface)
#define IActiveScriptParseVtbl
static HRESULT WINAPI VariantChangeType_ChangeType(IVariantChangeType *iface, VARIANT *dst, VARIANT *src, LCID lcid, VARTYPE vt)
static const IVariantChangeTypeVtbl VariantChangeTypeVtbl
static ULONG WINAPI JScriptProperty_AddRef(IActiveScriptProperty *iface)
IUnknown * create_ax_site(script_ctx_t *ctx)
static const IActiveScriptVtbl JScriptVtbl
static HRESULT WINAPI JScript_Clone(IActiveScript *iface, IActiveScript **ppscript)
static ULONG WINAPI VariantChangeType_Release(IVariantChangeType *iface)
static AXSite * impl_from_IServiceProvider(IServiceProvider *iface)
HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv)
static JScript * impl_from_IActiveScriptProperty(IActiveScriptProperty *iface)
static HRESULT WINAPI JScriptSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
static HRESULT WINAPI JScript_GetScriptThreadState(IActiveScript *iface, SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
static HRESULT WINAPI JScriptSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
static HRESULT WINAPI JScriptSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
static HRESULT WINAPI JScript_AddTypeLib(IActiveScript *iface, REFGUID rguidTypeLib, DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
static HRESULT WINAPI JScript_GetScriptState(IActiveScript *iface, SCRIPTSTATE *pssState)
static ULONG WINAPI JScriptSafety_Release(IObjectSafety *iface)
static ULONG WINAPI AXSite_AddRef(IServiceProvider *iface)
static HRESULT WINAPI JScriptProperty_QueryInterface(IActiveScriptProperty *iface, REFIID riid, void **ppv)
static ULONG WINAPI JScriptParse_AddRef(IActiveScriptParse *iface)
static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR pstrItemName, IDispatch **ppdisp)
static HRESULT WINAPI JScript_GetScriptSite(IActiveScript *iface, REFIID riid, void **ppvObject)
static JScript * impl_from_IVariantChangeType(IVariantChangeType *iface)
static const IObjectSafetyVtbl JScriptSafetyVtbl
static ULONG WINAPI JScriptParseProcedure_Release(IActiveScriptParseProcedure2 *iface)
static HRESULT WINAPI JScript_InterruptScriptThread(IActiveScript *iface, SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
static HRESULT set_ctx_site(JScript *This)
static void exec_queued_code(JScript *This)
static HRESULT WINAPI AXSite_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
void script_release(script_ctx_t *ctx)
static const IActiveScriptPropertyVtbl JScriptPropertyVtbl
static ULONG WINAPI VariantChangeType_AddRef(IVariantChangeType *iface)
static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface, LPCOLESTR pstrCode, LPCOLESTR pstrItemName, IUnknown *punkContext, LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLine, DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo)
static JScript * impl_from_IActiveScriptParseProcedure2(IActiveScriptParseProcedure2 *iface)
static HRESULT WINAPI VariantChangeType_QueryInterface(IVariantChangeType *iface, REFIID riid, void **ppv)
static HRESULT WINAPI JScript_GetScriptThreadID(IActiveScript *iface, DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
static HRESULT WINAPI JScript_QueryInterface(IActiveScript *iface, REFIID riid, void **ppv)
static HRESULT WINAPI AXSite_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
static BOOL is_started(script_ctx_t *ctx)
static HRESULT exec_global_code(JScript *This, bytecode_t *code)
static ULONG WINAPI JScriptProperty_Release(IActiveScriptProperty *iface)
static REFPROPVARIANT PROPVAR_CHANGE_FLAGS VARTYPE vt
void clear_ei(script_ctx_t *ctx)
HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, IDispatch *this_obj, jsdisp_t *function_instance, jsdisp_t *variable_obj, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_source_function(script_ctx_t *, bytecode_t *, function_code_t *, scope_chain_t *, jsdisp_t **) DECLSPEC_HIDDEN
GLdouble GLdouble GLdouble r
static void lock_module(void)
static void unlock_module(void)
#define InterlockedCompareExchangePointer
#define InterlockedCompareExchange
void release_bytecode(bytecode_t *code)
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
static void jsdisp_release(jsdisp_t *jsdisp)
#define SCRIPTLANGUAGEVERSION_HTML
static IDispatch * to_disp(jsdisp_t *jsdisp)
void heap_pool_init(heap_pool_t *) DECLSPEC_HIDDEN
HRESULT create_jscaller(script_ctx_t *) DECLSPEC_HIDDEN
void release_cc(cc_ctx_t *) DECLSPEC_HIDDEN
HRESULT variant_change_type(script_ctx_t *, VARIANT *, VARIANT *, VARTYPE) DECLSPEC_HIDDEN
jsstr_t * jsstr_empty(void)
static void jsstr_release(jsstr_t *str)
void jsval_release(jsval_t val)
HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
static jsval_t jsval_undefined(void)
static const char * debugstr_variant(const VARIANT *var)
#define IsEqualGUID(rguid1, rguid2)
IServiceProvider IServiceProvider_iface
IActiveScriptParse IActiveScriptParse_iface
IActiveScriptProperty IActiveScriptProperty_iface
IActiveScript IActiveScript_iface
IObjectSafety IObjectSafety_iface
IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_iface
IVariantChangeType IVariantChangeType_iface
struct _bytecode_t * next
struct named_item_t * next
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
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