2 * Copyright 2008 Jacek Caban for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(jscript);
28 const IActiveScriptVtbl *lpIActiveScriptVtbl;
29 const IActiveScriptParseVtbl *lpIActiveScriptParseVtbl;
30 const IActiveScriptParseProcedure2Vtbl *lpIActiveScriptParseProcedure2Vtbl;
31 const IActiveScriptPropertyVtbl *lpIActiveScriptPropertyVtbl;
32 const IObjectSafetyVtbl *lpIObjectSafetyVtbl;
40 IActiveScriptSite *site;
42 parser_ctx_t *queue_head;
43 parser_ctx_t *queue_tail;
46 #define ACTSCRIPT(x) ((IActiveScript*) &(x)->lpIActiveScriptVtbl)
47 #define ASPARSE(x) ((IActiveScriptParse*) &(x)->lpIActiveScriptParseVtbl)
48 #define ASPARSEPROC(x) ((IActiveScriptParseProcedure2*) &(x)->lpIActiveScriptParseProcedure2Vtbl)
49 #define ACTSCPPROP(x) ((IActiveScriptProperty*) &(x)->lpIActiveScriptPropertyVtbl)
50 #define OBJSAFETY(x) ((IObjectSafety*) &(x)->lpIObjectSafetyVtbl)
52 void script_release(script_ctx_t *ctx)
60 static void change_state(JScript *This, SCRIPTSTATE state)
62 if(This->ctx->state == state)
65 This->ctx->state = state;
66 IActiveScriptSite_OnStateChange(This->site, state);
69 static inline BOOL is_started(script_ctx_t *ctx)
71 return ctx->state == SCRIPTSTATE_STARTED
72 || ctx->state == SCRIPTSTATE_CONNECTED
73 || ctx->state == SCRIPTSTATE_DISCONNECTED;
76 static HRESULT exec_global_code(JScript *This, parser_ctx_t *parser_ctx)
83 hres = create_exec_ctx((IDispatch*)_IDispatchEx_(This->ctx->script_disp), This->ctx->script_disp, NULL, &exec_ctx);
87 IActiveScriptSite_OnEnterScript(This->site);
89 memset(&jsexcept, 0, sizeof(jsexcept));
90 hres = exec_source(exec_ctx, parser_ctx, parser_ctx->source, &jsexcept, &var);
91 VariantClear(&jsexcept.var);
92 exec_release(exec_ctx);
96 IActiveScriptSite_OnLeaveScript(This->site);
101 static void clear_script_queue(JScript *This)
103 parser_ctx_t *iter, *iter2;
105 if(!This->queue_head)
108 iter = This->queue_head;
112 parser_release(iter);
116 This->queue_head = This->queue_tail = NULL;
119 static void exec_queued_code(JScript *This)
123 for(iter = This->queue_head; iter; iter = iter->next)
124 exec_global_code(This, iter);
126 clear_script_queue(This);
129 #define ACTSCRIPT_THIS(iface) DEFINE_THIS(JScript, IActiveScript, iface)
131 static HRESULT WINAPI JScript_QueryInterface(IActiveScript *iface, REFIID riid, void **ppv)
133 JScript *This = ACTSCRIPT_THIS(iface);
137 if(IsEqualGUID(riid, &IID_IUnknown)) {
138 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
139 *ppv = ACTSCRIPT(This);
140 }else if(IsEqualGUID(riid, &IID_IActiveScript)) {
141 TRACE("(%p)->(IID_IActiveScript %p)\n", This, ppv);
142 *ppv = ACTSCRIPT(This);
143 }else if(IsEqualGUID(riid, &IID_IActiveScriptParse)) {
144 TRACE("(%p)->(IID_IActiveScriptParse %p)\n", This, ppv);
145 *ppv = ASPARSE(This);
146 }else if(IsEqualGUID(riid, &IID_IActiveScriptParseProcedure)) {
147 TRACE("(%p)->(IID_IActiveScriptParseProcedure %p)\n", This, ppv);
148 *ppv = ASPARSEPROC(This);
149 }else if(IsEqualGUID(riid, &IID_IActiveScriptParseProcedure2)) {
150 TRACE("(%p)->(IID_IActiveScriptParseProcedure2 %p)\n", This, ppv);
151 *ppv = ASPARSEPROC(This);
152 }else if(IsEqualGUID(riid, &IID_IActiveScriptProperty)) {
153 TRACE("(%p)->(IID_IActiveScriptProperty %p)\n", This, ppv);
154 *ppv = ACTSCPPROP(This);
155 }else if(IsEqualGUID(riid, &IID_IObjectSafety)) {
156 TRACE("(%p)->(IID_IObjectSafety %p)\n", This, ppv);
157 *ppv = OBJSAFETY(This);
161 IUnknown_AddRef((IUnknown*)*ppv);
165 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
166 return E_NOINTERFACE;
169 static ULONG WINAPI JScript_AddRef(IActiveScript *iface)
171 JScript *This = ACTSCRIPT_THIS(iface);
172 LONG ref = InterlockedIncrement(&This->ref);
174 TRACE("(%p) ref=%d\n", This, ref);
179 static ULONG WINAPI JScript_Release(IActiveScript *iface)
181 JScript *This = ACTSCRIPT_THIS(iface);
182 LONG ref = InterlockedDecrement(&This->ref);
184 TRACE("(%p) ref=%d\n", iface, ref);
187 if(This->ctx && This->ctx->state != SCRIPTSTATE_CLOSED)
188 IActiveScript_Close(ACTSCRIPT(This));
190 script_release(This->ctx);
198 static HRESULT WINAPI JScript_SetScriptSite(IActiveScript *iface,
199 IActiveScriptSite *pass)
201 JScript *This = ACTSCRIPT_THIS(iface);
205 TRACE("(%p)->(%p)\n", This, pass);
214 hres = IActiveScriptParse_InitNew(ASPARSE(This));
219 if(!This->ctx->script_disp) {
220 hres = create_dispex(This->ctx, NULL, NULL, &This->ctx->script_disp);
225 hres = init_global(This->ctx);
229 if(InterlockedCompareExchange(&This->thread_id, GetCurrentThreadId(), 0))
233 IActiveScriptSite_AddRef(This->site);
235 hres = IActiveScriptSite_GetLCID(This->site, &lcid);
237 This->ctx->lcid = lcid;
239 change_state(This, SCRIPTSTATE_INITIALIZED);
243 static HRESULT WINAPI JScript_GetScriptSite(IActiveScript *iface, REFIID riid,
246 JScript *This = ACTSCRIPT_THIS(iface);
247 FIXME("(%p)->()\n", This);
251 static HRESULT WINAPI JScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE ss)
253 JScript *This = ACTSCRIPT_THIS(iface);
255 TRACE("(%p)->(%d)\n", This, ss);
257 if(!This->ctx || GetCurrentThreadId() != This->thread_id)
261 case SCRIPTSTATE_STARTED:
262 if(This->ctx->state == SCRIPTSTATE_CLOSED)
265 exec_queued_code(This);
268 FIXME("unimplemented state %d\n", ss);
272 change_state(This, ss);
276 static HRESULT WINAPI JScript_GetScriptState(IActiveScript *iface, SCRIPTSTATE *pssState)
278 JScript *This = ACTSCRIPT_THIS(iface);
280 TRACE("(%p)->(%p)\n", This, pssState);
285 if(!This->thread_id) {
286 *pssState = SCRIPTSTATE_UNINITIALIZED;
290 if(This->thread_id != GetCurrentThreadId())
293 *pssState = This->ctx ? This->ctx->state : SCRIPTSTATE_UNINITIALIZED;
297 static HRESULT WINAPI JScript_Close(IActiveScript *iface)
299 JScript *This = ACTSCRIPT_THIS(iface);
301 TRACE("(%p)->()\n", This);
303 if(This->thread_id != GetCurrentThreadId())
306 clear_script_queue(This);
308 if(This->ctx->named_items) {
309 named_item_t *iter, *iter2;
311 iter = This->ctx->named_items;
315 IDispatch_Release(iter->disp);
320 This->ctx->named_items = NULL;
324 change_state(This, SCRIPTSTATE_CLOSED);
326 if(This->ctx->script_disp) {
327 IDispatchEx_Release(_IDispatchEx_(This->ctx->script_disp));
328 This->ctx->script_disp = NULL;
331 if(This->ctx->global) {
332 IDispatchEx_Release(_IDispatchEx_(This->ctx->global));
333 This->ctx->global = NULL;
338 IActiveScriptSite_Release(This->site);
345 static HRESULT WINAPI JScript_AddNamedItem(IActiveScript *iface,
346 LPCOLESTR pstrName, DWORD dwFlags)
348 JScript *This = ACTSCRIPT_THIS(iface);
354 TRACE("(%p)->(%s %x)\n", This, debugstr_w(pstrName), dwFlags);
356 if(This->thread_id != GetCurrentThreadId() || !This->ctx || This->ctx->state == SCRIPTSTATE_CLOSED)
359 hres = IActiveScriptSite_GetItemInfo(This->site, pstrName, SCRIPTINFO_IUNKNOWN, &unk, NULL);
361 WARN("GetItemInfo failed: %08x\n", hres);
365 hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
366 IUnknown_Release(unk);
368 WARN("object does not implement IDispatch\n");
372 item = heap_alloc(sizeof(*item));
374 IDispatch_Release(disp);
375 return E_OUTOFMEMORY;
379 item->flags = dwFlags;
380 item->next = This->ctx->named_items;
381 This->ctx->named_items = item;
386 static HRESULT WINAPI JScript_AddTypeLib(IActiveScript *iface, REFGUID rguidTypeLib,
387 DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
389 JScript *This = ACTSCRIPT_THIS(iface);
390 FIXME("(%p)->()\n", This);
394 static HRESULT WINAPI JScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR pstrItemName,
397 JScript *This = ACTSCRIPT_THIS(iface);
399 TRACE("(%p)->(%p)\n", This, ppdisp);
404 if(This->thread_id != GetCurrentThreadId() || !This->ctx->script_disp) {
409 *ppdisp = (IDispatch*)_IDispatchEx_(This->ctx->script_disp);
410 IDispatch_AddRef(*ppdisp);
414 static HRESULT WINAPI JScript_GetCurrentScriptThreadID(IActiveScript *iface,
415 SCRIPTTHREADID *pstridThread)
417 JScript *This = ACTSCRIPT_THIS(iface);
418 FIXME("(%p)->()\n", This);
422 static HRESULT WINAPI JScript_GetScriptThreadID(IActiveScript *iface,
423 DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
425 JScript *This = ACTSCRIPT_THIS(iface);
426 FIXME("(%p)->()\n", This);
430 static HRESULT WINAPI JScript_GetScriptThreadState(IActiveScript *iface,
431 SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
433 JScript *This = ACTSCRIPT_THIS(iface);
434 FIXME("(%p)->()\n", This);
438 static HRESULT WINAPI JScript_InterruptScriptThread(IActiveScript *iface,
439 SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
441 JScript *This = ACTSCRIPT_THIS(iface);
442 FIXME("(%p)->()\n", This);
446 static HRESULT WINAPI JScript_Clone(IActiveScript *iface, IActiveScript **ppscript)
448 JScript *This = ACTSCRIPT_THIS(iface);
449 FIXME("(%p)->()\n", This);
453 #undef ACTSCRIPT_THIS
455 static const IActiveScriptVtbl JScriptVtbl = {
456 JScript_QueryInterface,
459 JScript_SetScriptSite,
460 JScript_GetScriptSite,
461 JScript_SetScriptState,
462 JScript_GetScriptState,
464 JScript_AddNamedItem,
466 JScript_GetScriptDispatch,
467 JScript_GetCurrentScriptThreadID,
468 JScript_GetScriptThreadID,
469 JScript_GetScriptThreadState,
470 JScript_InterruptScriptThread,
474 #define ASPARSE_THIS(iface) DEFINE_THIS(JScript, IActiveScriptParse, iface)
476 static HRESULT WINAPI JScriptParse_QueryInterface(IActiveScriptParse *iface, REFIID riid, void **ppv)
478 JScript *This = ASPARSE_THIS(iface);
479 return IActiveScript_QueryInterface(ACTSCRIPT(This), riid, ppv);
482 static ULONG WINAPI JScriptParse_AddRef(IActiveScriptParse *iface)
484 JScript *This = ASPARSE_THIS(iface);
485 return IActiveScript_AddRef(ACTSCRIPT(This));
488 static ULONG WINAPI JScriptParse_Release(IActiveScriptParse *iface)
490 JScript *This = ASPARSE_THIS(iface);
491 return IActiveScript_Release(ACTSCRIPT(This));
494 static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
496 JScript *This = ASPARSE_THIS(iface);
499 TRACE("(%p)\n", This);
504 ctx = heap_alloc_zero(sizeof(script_ctx_t));
506 return E_OUTOFMEMORY;
509 ctx->state = SCRIPTSTATE_UNINITIALIZED;
511 ctx = InterlockedCompareExchangePointer((void**)&This->ctx, ctx, NULL);
520 static HRESULT WINAPI JScriptParse_AddScriptlet(IActiveScriptParse *iface,
521 LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
522 LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName, LPCOLESTR pstrDelimiter,
523 DWORD dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags,
524 BSTR *pbstrName, EXCEPINFO *pexcepinfo)
526 JScript *This = ASPARSE_THIS(iface);
527 FIXME("(%p)->(%s %s %s %s %s %s %x %u %x %p %p)\n", This, debugstr_w(pstrDefaultName),
528 debugstr_w(pstrCode), debugstr_w(pstrItemName), debugstr_w(pstrSubItemName),
529 debugstr_w(pstrEventName), debugstr_w(pstrDelimiter), dwSourceContextCookie,
530 ulStartingLineNumber, dwFlags, pbstrName, pexcepinfo);
534 static HRESULT WINAPI JScriptParse_ParseScriptText(IActiveScriptParse *iface,
535 LPCOLESTR pstrCode, LPCOLESTR pstrItemName, IUnknown *punkContext,
536 LPCOLESTR pstrDelimiter, DWORD dwSourceContextCookie, ULONG ulStartingLine,
537 DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo)
539 JScript *This = ASPARSE_THIS(iface);
540 parser_ctx_t *parser_ctx;
543 TRACE("(%p)->(%s %s %p %s %x %u %x %p %p)\n", This, debugstr_w(pstrCode),
544 debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter),
545 dwSourceContextCookie, ulStartingLine, dwFlags, pvarResult, pexcepinfo);
547 if(This->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED)
550 hres = script_parse(This->ctx, pstrCode, &parser_ctx);
554 if(!is_started(This->ctx)) {
556 This->queue_tail = This->queue_tail->next = parser_ctx;
558 This->queue_head = This->queue_tail = parser_ctx;
562 hres = exec_global_code(This, parser_ctx);
563 parser_release(parser_ctx);
570 static const IActiveScriptParseVtbl JScriptParseVtbl = {
571 JScriptParse_QueryInterface,
573 JScriptParse_Release,
574 JScriptParse_InitNew,
575 JScriptParse_AddScriptlet,
576 JScriptParse_ParseScriptText
579 #define ASPARSEPROC_THIS(iface) DEFINE_THIS(JScript, IActiveScriptParseProcedure2, iface)
581 static HRESULT WINAPI JScriptParseProcedure_QueryInterface(IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
583 JScript *This = ASPARSEPROC_THIS(iface);
584 return IActiveScript_QueryInterface(ACTSCRIPT(This), riid, ppv);
587 static ULONG WINAPI JScriptParseProcedure_AddRef(IActiveScriptParseProcedure2 *iface)
589 JScript *This = ASPARSEPROC_THIS(iface);
590 return IActiveScript_AddRef(ACTSCRIPT(This));
593 static ULONG WINAPI JScriptParseProcedure_Release(IActiveScriptParseProcedure2 *iface)
595 JScript *This = ASPARSEPROC_THIS(iface);
596 return IActiveScript_Release(ACTSCRIPT(This));
599 static HRESULT WINAPI JScriptParseProcedure_ParseProcedureText(IActiveScriptParseProcedure2 *iface,
600 LPCOLESTR pstrCode, LPCOLESTR pstrFormalParams, LPCOLESTR pstrProcedureName,
601 LPCOLESTR pstrItemName, IUnknown *punkContext, LPCOLESTR pstrDelimiter,
602 DWORD dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, IDispatch **ppdisp)
604 JScript *This = ASPARSEPROC_THIS(iface);
605 parser_ctx_t *parser_ctx;
609 TRACE("(%p)->(%s %s %s %s %p %s %x %u %x %p)\n", This, debugstr_w(pstrCode), debugstr_w(pstrFormalParams),
610 debugstr_w(pstrProcedureName), debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter),
611 dwSourceContextCookie, ulStartingLineNumber, dwFlags, ppdisp);
613 if(This->thread_id != GetCurrentThreadId() || This->ctx->state == SCRIPTSTATE_CLOSED)
616 hres = script_parse(This->ctx, pstrCode, &parser_ctx);
618 WARN("Parse failed %08x\n", hres);
622 hres = create_source_function(parser_ctx, NULL, parser_ctx->source, NULL, &dispex);
623 parser_release(parser_ctx);
627 *ppdisp = (IDispatch*)_IDispatchEx_(dispex);
631 #undef ASPARSEPROC_THIS
633 static const IActiveScriptParseProcedure2Vtbl JScriptParseProcedureVtbl = {
634 JScriptParseProcedure_QueryInterface,
635 JScriptParseProcedure_AddRef,
636 JScriptParseProcedure_Release,
637 JScriptParseProcedure_ParseProcedureText,
640 #define ACTSCPPROP_THIS(iface) DEFINE_THIS(JScript, IActiveScriptProperty, iface)
642 static HRESULT WINAPI JScriptProperty_QueryInterface(IActiveScriptProperty *iface, REFIID riid, void **ppv)
644 JScript *This = ACTSCPPROP_THIS(iface);
645 return IActiveScript_QueryInterface(ACTSCRIPT(This), riid, ppv);
648 static ULONG WINAPI JScriptProperty_AddRef(IActiveScriptProperty *iface)
650 JScript *This = ACTSCPPROP_THIS(iface);
651 return IActiveScript_AddRef(ACTSCRIPT(This));
654 static ULONG WINAPI JScriptProperty_Release(IActiveScriptProperty *iface)
656 JScript *This = ACTSCPPROP_THIS(iface);
657 return IActiveScript_Release(ACTSCRIPT(This));
660 static HRESULT WINAPI JScriptProperty_GetProperty(IActiveScriptProperty *iface, DWORD dwProperty,
661 VARIANT *pvarIndex, VARIANT *pvarValue)
663 JScript *This = ACTSCPPROP_THIS(iface);
664 FIXME("(%p)->(%x %p %p)\n", This, dwProperty, pvarIndex, pvarValue);
668 static HRESULT WINAPI JScriptProperty_SetProperty(IActiveScriptProperty *iface, DWORD dwProperty,
669 VARIANT *pvarIndex, VARIANT *pvarValue)
671 JScript *This = ACTSCPPROP_THIS(iface);
672 FIXME("(%p)->(%x %p %p)\n", This, dwProperty, pvarIndex, pvarValue);
676 #undef ACTSCPPROP_THIS
678 static const IActiveScriptPropertyVtbl JScriptPropertyVtbl = {
679 JScriptProperty_QueryInterface,
680 JScriptProperty_AddRef,
681 JScriptProperty_Release,
682 JScriptProperty_GetProperty,
683 JScriptProperty_SetProperty
686 #define OBJSAFETY_THIS(iface) DEFINE_THIS(JScript, IObjectSafety, iface)
688 static HRESULT WINAPI JScriptSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
690 JScript *This = OBJSAFETY_THIS(iface);
691 return IActiveScript_QueryInterface(ACTSCRIPT(This), riid, ppv);
694 static ULONG WINAPI JScriptSafety_AddRef(IObjectSafety *iface)
696 JScript *This = OBJSAFETY_THIS(iface);
697 return IActiveScript_AddRef(ACTSCRIPT(This));
700 static ULONG WINAPI JScriptSafety_Release(IObjectSafety *iface)
702 JScript *This = OBJSAFETY_THIS(iface);
703 return IActiveScript_Release(ACTSCRIPT(This));
706 #define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER)
708 static HRESULT WINAPI JScriptSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid,
709 DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
711 JScript *This = OBJSAFETY_THIS(iface);
713 TRACE("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions);
715 if(!pdwSupportedOptions || !pdwEnabledOptions)
718 *pdwSupportedOptions = SUPPORTED_OPTIONS;
719 *pdwEnabledOptions = This->safeopt;
724 static HRESULT WINAPI JScriptSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid,
725 DWORD dwOptionSetMask, DWORD dwEnabledOptions)
727 JScript *This = OBJSAFETY_THIS(iface);
729 TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions);
731 if(dwOptionSetMask & ~SUPPORTED_OPTIONS)
734 This->safeopt = dwEnabledOptions & dwEnabledOptions;
738 #undef OBJSAFETY_THIS
740 static const IObjectSafetyVtbl JScriptSafetyVtbl = {
741 JScriptSafety_QueryInterface,
742 JScriptSafety_AddRef,
743 JScriptSafety_Release,
744 JScriptSafety_GetInterfaceSafetyOptions,
745 JScriptSafety_SetInterfaceSafetyOptions
748 HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter,
749 REFIID riid, void **ppv)
754 TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
758 ret = heap_alloc_zero(sizeof(*ret));
760 ret->lpIActiveScriptVtbl = &JScriptVtbl;
761 ret->lpIActiveScriptParseVtbl = &JScriptParseVtbl;
762 ret->lpIActiveScriptParseProcedure2Vtbl = &JScriptParseProcedureVtbl;
763 ret->lpIActiveScriptPropertyVtbl = &JScriptPropertyVtbl;
764 ret->lpIObjectSafetyVtbl = &JScriptSafetyVtbl;
766 ret->safeopt = INTERFACE_USES_DISPEX;
768 hres = IActiveScript_QueryInterface(ACTSCRIPT(ret), riid, ppv);
769 IActiveScript_Release(ACTSCRIPT(ret));