2 * Copyright 2011 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
25 #include "wine/debug.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(vbscript
);
31 #define CTXARG_T DWORDLONG
32 #define IActiveScriptParseVtbl IActiveScriptParse64Vtbl
36 #define CTXARG_T DWORD
37 #define IActiveScriptParseVtbl IActiveScriptParse32Vtbl
42 IActiveScript IActiveScript_iface
;
43 IActiveScriptParse IActiveScriptParse_iface
;
44 IObjectSafety IObjectSafety_iface
;
50 IActiveScriptSite
*site
;
56 static void change_state(VBScript
*This
, SCRIPTSTATE state
)
58 if(This
->state
== state
)
63 IActiveScriptSite_OnStateChange(This
->site
, state
);
66 static inline BOOL
is_started(VBScript
*This
)
68 return This
->state
== SCRIPTSTATE_STARTED
69 || This
->state
== SCRIPTSTATE_CONNECTED
70 || This
->state
== SCRIPTSTATE_DISCONNECTED
;
73 static HRESULT
exec_global_code(script_ctx_t
*ctx
, vbscode_t
*code
)
77 code
->global_executed
= TRUE
;
79 IActiveScriptSite_OnEnterScript(ctx
->site
);
80 hres
= exec_script(ctx
, &code
->global_code
, NULL
, NULL
, NULL
);
81 IActiveScriptSite_OnLeaveScript(ctx
->site
);
86 static void exec_queued_code(script_ctx_t
*ctx
)
90 LIST_FOR_EACH_ENTRY(iter
, &ctx
->code_list
, vbscode_t
, entry
) {
91 if(!iter
->global_executed
)
92 exec_global_code(ctx
, iter
);
96 static HRESULT
set_ctx_site(VBScript
*This
)
100 This
->ctx
->lcid
= This
->lcid
;
102 hres
= init_global(This
->ctx
);
106 IActiveScriptSite_AddRef(This
->site
);
107 This
->ctx
->site
= This
->site
;
109 change_state(This
, SCRIPTSTATE_INITIALIZED
);
113 static void destroy_script(script_ctx_t
*ctx
)
115 collect_objects(ctx
);
117 while(!list_empty(&ctx
->code_list
))
118 release_vbscode(LIST_ENTRY(list_head(&ctx
->code_list
), vbscode_t
, entry
));
120 while(!list_empty(&ctx
->named_items
)) {
121 named_item_t
*iter
= LIST_ENTRY(list_head(&ctx
->named_items
), named_item_t
, entry
);
123 list_remove(&iter
->entry
);
125 IDispatch_Release(iter
->disp
);
126 heap_free(iter
->name
);
131 IDispatch_Release(ctx
->host_global
);
133 IInternetHostSecurityManager_Release(ctx
->secmgr
);
135 IActiveScriptSite_Release(ctx
->site
);
137 IDispatchEx_Release(&ctx
->err_obj
->IDispatchEx_iface
);
139 IDispatchEx_Release(&ctx
->global_obj
->IDispatchEx_iface
);
141 IDispatchEx_Release(&ctx
->script_obj
->IDispatchEx_iface
);
142 vbsheap_free(&ctx
->heap
);
146 static void decrease_state(VBScript
*This
, SCRIPTSTATE state
)
148 switch(This
->state
) {
149 case SCRIPTSTATE_CONNECTED
:
150 change_state(This
, SCRIPTSTATE_DISCONNECTED
);
151 if(state
== SCRIPTSTATE_DISCONNECTED
)
154 case SCRIPTSTATE_STARTED
:
155 case SCRIPTSTATE_DISCONNECTED
:
156 if(This
->state
== SCRIPTSTATE_DISCONNECTED
)
157 change_state(This
, SCRIPTSTATE_INITIALIZED
);
158 if(state
== SCRIPTSTATE_INITIALIZED
)
161 case SCRIPTSTATE_INITIALIZED
:
162 case SCRIPTSTATE_UNINITIALIZED
:
163 change_state(This
, state
);
166 IActiveScriptSite_Release(This
->site
);
172 if(state
== SCRIPTSTATE_CLOSED
) {
173 destroy_script(This
->ctx
);
183 static inline VBScript
*impl_from_IActiveScript(IActiveScript
*iface
)
185 return CONTAINING_RECORD(iface
, VBScript
, IActiveScript_iface
);
188 static HRESULT WINAPI
VBScript_QueryInterface(IActiveScript
*iface
, REFIID riid
, void **ppv
)
190 VBScript
*This
= impl_from_IActiveScript(iface
);
192 if(IsEqualGUID(riid
, &IID_IUnknown
)) {
193 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
194 *ppv
= &This
->IActiveScript_iface
;
195 }else if(IsEqualGUID(riid
, &IID_IActiveScript
)) {
196 TRACE("(%p)->(IID_IActiveScript %p)\n", This
, ppv
);
197 *ppv
= &This
->IActiveScript_iface
;
198 }else if(IsEqualGUID(riid
, &IID_IActiveScriptParse
)) {
199 TRACE("(%p)->(IID_IActiveScriptParse %p)\n", This
, ppv
);
200 *ppv
= &This
->IActiveScriptParse_iface
;
201 }else if(IsEqualGUID(riid
, &IID_IObjectSafety
)) {
202 TRACE("(%p)->(IID_IObjectSafety %p)\n", This
, ppv
);
203 *ppv
= &This
->IObjectSafety_iface
;
205 FIXME("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
207 return E_NOINTERFACE
;
210 IUnknown_AddRef((IUnknown
*)*ppv
);
214 static ULONG WINAPI
VBScript_AddRef(IActiveScript
*iface
)
216 VBScript
*This
= impl_from_IActiveScript(iface
);
217 LONG ref
= InterlockedIncrement(&This
->ref
);
219 TRACE("(%p) ref=%d\n", This
, ref
);
224 static ULONG WINAPI
VBScript_Release(IActiveScript
*iface
)
226 VBScript
*This
= impl_from_IActiveScript(iface
);
227 LONG ref
= InterlockedDecrement(&This
->ref
);
229 TRACE("(%p) ref=%d\n", iface
, ref
);
233 IActiveScriptSite_Release(This
->site
);
240 static HRESULT WINAPI
VBScript_SetScriptSite(IActiveScript
*iface
, IActiveScriptSite
*pass
)
242 VBScript
*This
= impl_from_IActiveScript(iface
);
246 TRACE("(%p)->(%p)\n", This
, pass
);
254 if(InterlockedCompareExchange(&This
->thread_id
, GetCurrentThreadId(), 0))
258 IActiveScriptSite_AddRef(This
->site
);
260 hres
= IActiveScriptSite_GetLCID(This
->site
, &lcid
);
264 return This
->ctx
? set_ctx_site(This
) : S_OK
;
267 static HRESULT WINAPI
VBScript_GetScriptSite(IActiveScript
*iface
, REFIID riid
,
270 VBScript
*This
= impl_from_IActiveScript(iface
);
271 FIXME("(%p)->()\n", This
);
275 static HRESULT WINAPI
VBScript_SetScriptState(IActiveScript
*iface
, SCRIPTSTATE ss
)
277 VBScript
*This
= impl_from_IActiveScript(iface
);
279 TRACE("(%p)->(%d)\n", This
, ss
);
281 if(This
->thread_id
&& GetCurrentThreadId() != This
->thread_id
)
284 if(ss
== SCRIPTSTATE_UNINITIALIZED
) {
285 if(This
->state
== SCRIPTSTATE_CLOSED
)
288 decrease_state(This
, SCRIPTSTATE_UNINITIALIZED
);
296 case SCRIPTSTATE_STARTED
:
297 case SCRIPTSTATE_CONNECTED
: /* FIXME */
298 if(This
->state
== SCRIPTSTATE_CLOSED
)
301 exec_queued_code(This
->ctx
);
303 case SCRIPTSTATE_INITIALIZED
:
304 FIXME("unimplemented SCRIPTSTATE_INITIALIZED\n");
307 FIXME("unimplemented state %d\n", ss
);
311 change_state(This
, ss
);
315 static HRESULT WINAPI
VBScript_GetScriptState(IActiveScript
*iface
, SCRIPTSTATE
*pssState
)
317 VBScript
*This
= impl_from_IActiveScript(iface
);
319 TRACE("(%p)->(%p)\n", This
, pssState
);
324 if(This
->thread_id
&& This
->thread_id
!= GetCurrentThreadId())
327 *pssState
= This
->state
;
331 static HRESULT WINAPI
VBScript_Close(IActiveScript
*iface
)
333 VBScript
*This
= impl_from_IActiveScript(iface
);
335 TRACE("(%p)->()\n", This
);
337 if(This
->thread_id
&& This
->thread_id
!= GetCurrentThreadId())
340 decrease_state(This
, SCRIPTSTATE_CLOSED
);
344 static HRESULT WINAPI
VBScript_AddNamedItem(IActiveScript
*iface
, LPCOLESTR pstrName
, DWORD dwFlags
)
346 VBScript
*This
= impl_from_IActiveScript(iface
);
348 IDispatch
*disp
= NULL
;
351 TRACE("(%p)->(%s %x)\n", This
, debugstr_w(pstrName
), dwFlags
);
353 if(This
->thread_id
!= GetCurrentThreadId() || !This
->ctx
|| This
->state
== SCRIPTSTATE_CLOSED
)
356 if(dwFlags
& SCRIPTITEM_GLOBALMEMBERS
) {
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 if(This
->ctx
->host_global
)
373 IDispatch_Release(This
->ctx
->host_global
);
374 IDispatch_AddRef(disp
);
375 This
->ctx
->host_global
= disp
;
378 item
= heap_alloc(sizeof(*item
));
381 IDispatch_Release(disp
);
382 return E_OUTOFMEMORY
;
386 item
->flags
= dwFlags
;
387 item
->name
= heap_strdupW(pstrName
);
390 IDispatch_Release(disp
);
392 return E_OUTOFMEMORY
;
395 list_add_tail(&This
->ctx
->named_items
, &item
->entry
);
399 static HRESULT WINAPI
VBScript_AddTypeLib(IActiveScript
*iface
, REFGUID rguidTypeLib
,
400 DWORD dwMajor
, DWORD dwMinor
, DWORD dwFlags
)
402 VBScript
*This
= impl_from_IActiveScript(iface
);
403 FIXME("(%p)->()\n", This
);
407 static HRESULT WINAPI
VBScript_GetScriptDispatch(IActiveScript
*iface
, LPCOLESTR pstrItemName
, IDispatch
**ppdisp
)
409 VBScript
*This
= impl_from_IActiveScript(iface
);
411 TRACE("(%p)->(%p)\n", This
, ppdisp
);
416 if(This
->thread_id
!= GetCurrentThreadId() || !This
->ctx
->script_obj
) {
421 *ppdisp
= (IDispatch
*)&This
->ctx
->script_obj
->IDispatchEx_iface
;
422 IDispatch_AddRef(*ppdisp
);
426 static HRESULT WINAPI
VBScript_GetCurrentScriptThreadID(IActiveScript
*iface
,
427 SCRIPTTHREADID
*pstridThread
)
429 VBScript
*This
= impl_from_IActiveScript(iface
);
430 FIXME("(%p)->()\n", This
);
434 static HRESULT WINAPI
VBScript_GetScriptThreadID(IActiveScript
*iface
,
435 DWORD dwWin32ThreadId
, SCRIPTTHREADID
*pstidThread
)
437 VBScript
*This
= impl_from_IActiveScript(iface
);
438 FIXME("(%p)->()\n", This
);
442 static HRESULT WINAPI
VBScript_GetScriptThreadState(IActiveScript
*iface
,
443 SCRIPTTHREADID stidThread
, SCRIPTTHREADSTATE
*pstsState
)
445 VBScript
*This
= impl_from_IActiveScript(iface
);
446 FIXME("(%p)->()\n", This
);
450 static HRESULT WINAPI
VBScript_InterruptScriptThread(IActiveScript
*iface
,
451 SCRIPTTHREADID stidThread
, const EXCEPINFO
*pexcepinfo
, DWORD dwFlags
)
453 VBScript
*This
= impl_from_IActiveScript(iface
);
454 FIXME("(%p)->()\n", This
);
458 static HRESULT WINAPI
VBScript_Clone(IActiveScript
*iface
, IActiveScript
**ppscript
)
460 VBScript
*This
= impl_from_IActiveScript(iface
);
461 FIXME("(%p)->()\n", This
);
465 static const IActiveScriptVtbl VBScriptVtbl
= {
466 VBScript_QueryInterface
,
469 VBScript_SetScriptSite
,
470 VBScript_GetScriptSite
,
471 VBScript_SetScriptState
,
472 VBScript_GetScriptState
,
474 VBScript_AddNamedItem
,
476 VBScript_GetScriptDispatch
,
477 VBScript_GetCurrentScriptThreadID
,
478 VBScript_GetScriptThreadID
,
479 VBScript_GetScriptThreadState
,
480 VBScript_InterruptScriptThread
,
484 static inline VBScript
*impl_from_IActiveScriptParse(IActiveScriptParse
*iface
)
486 return CONTAINING_RECORD(iface
, VBScript
, IActiveScriptParse_iface
);
489 static HRESULT WINAPI
VBScriptParse_QueryInterface(IActiveScriptParse
*iface
, REFIID riid
, void **ppv
)
491 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
492 return IActiveScript_QueryInterface(&This
->IActiveScript_iface
, riid
, ppv
);
495 static ULONG WINAPI
VBScriptParse_AddRef(IActiveScriptParse
*iface
)
497 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
498 return IActiveScript_AddRef(&This
->IActiveScript_iface
);
501 static ULONG WINAPI
VBScriptParse_Release(IActiveScriptParse
*iface
)
503 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
504 return IActiveScript_Release(&This
->IActiveScript_iface
);
507 static HRESULT WINAPI
VBScriptParse_InitNew(IActiveScriptParse
*iface
)
509 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
510 script_ctx_t
*ctx
, *old_ctx
;
512 TRACE("(%p)\n", This
);
517 ctx
= heap_alloc_zero(sizeof(script_ctx_t
));
519 return E_OUTOFMEMORY
;
521 ctx
->safeopt
= This
->safeopt
;
522 vbsheap_init(&ctx
->heap
);
523 list_init(&ctx
->objects
);
524 list_init(&ctx
->code_list
);
525 list_init(&ctx
->named_items
);
527 old_ctx
= InterlockedCompareExchangePointer((void**)&This
->ctx
, ctx
, NULL
);
533 return This
->site
? set_ctx_site(This
) : S_OK
;
536 static HRESULT WINAPI
VBScriptParse_AddScriptlet(IActiveScriptParse
*iface
,
537 LPCOLESTR pstrDefaultName
, LPCOLESTR pstrCode
, LPCOLESTR pstrItemName
,
538 LPCOLESTR pstrSubItemName
, LPCOLESTR pstrEventName
, LPCOLESTR pstrDelimiter
,
539 CTXARG_T dwSourceContextCookie
, ULONG ulStartingLineNumber
, DWORD dwFlags
,
540 BSTR
*pbstrName
, EXCEPINFO
*pexcepinfo
)
542 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
543 FIXME("(%p)->(%s %s %s %s %s %s %s %u %x %p %p)\n", This
, debugstr_w(pstrDefaultName
),
544 debugstr_w(pstrCode
), debugstr_w(pstrItemName
), debugstr_w(pstrSubItemName
),
545 debugstr_w(pstrEventName
), debugstr_w(pstrDelimiter
), wine_dbgstr_longlong(dwSourceContextCookie
),
546 ulStartingLineNumber
, dwFlags
, pbstrName
, pexcepinfo
);
550 static HRESULT WINAPI
VBScriptParse_ParseScriptText(IActiveScriptParse
*iface
,
551 LPCOLESTR pstrCode
, LPCOLESTR pstrItemName
, IUnknown
*punkContext
,
552 LPCOLESTR pstrDelimiter
, CTXARG_T dwSourceContextCookie
, ULONG ulStartingLine
,
553 DWORD dwFlags
, VARIANT
*pvarResult
, EXCEPINFO
*pexcepinfo
)
555 VBScript
*This
= impl_from_IActiveScriptParse(iface
);
559 TRACE("(%p)->(%s %s %p %s %s %u %x %p %p)\n", This
, debugstr_w(pstrCode
),
560 debugstr_w(pstrItemName
), punkContext
, debugstr_w(pstrDelimiter
),
561 wine_dbgstr_longlong(dwSourceContextCookie
), ulStartingLine
, dwFlags
, pvarResult
, pexcepinfo
);
563 if(This
->thread_id
!= GetCurrentThreadId() || This
->state
== SCRIPTSTATE_CLOSED
)
566 hres
= compile_script(This
->ctx
, pstrCode
, &code
);
570 return is_started(This
) ? exec_global_code(This
->ctx
, code
) : S_OK
;
573 static const IActiveScriptParseVtbl VBScriptParseVtbl
= {
574 VBScriptParse_QueryInterface
,
575 VBScriptParse_AddRef
,
576 VBScriptParse_Release
,
577 VBScriptParse_InitNew
,
578 VBScriptParse_AddScriptlet
,
579 VBScriptParse_ParseScriptText
582 static inline VBScript
*impl_from_IObjectSafety(IObjectSafety
*iface
)
584 return CONTAINING_RECORD(iface
, VBScript
, IObjectSafety_iface
);
587 static HRESULT WINAPI
VBScriptSafety_QueryInterface(IObjectSafety
*iface
, REFIID riid
, void **ppv
)
589 VBScript
*This
= impl_from_IObjectSafety(iface
);
590 return IActiveScript_QueryInterface(&This
->IActiveScript_iface
, riid
, ppv
);
593 static ULONG WINAPI
VBScriptSafety_AddRef(IObjectSafety
*iface
)
595 VBScript
*This
= impl_from_IObjectSafety(iface
);
596 return IActiveScript_AddRef(&This
->IActiveScript_iface
);
599 static ULONG WINAPI
VBScriptSafety_Release(IObjectSafety
*iface
)
601 VBScript
*This
= impl_from_IObjectSafety(iface
);
602 return IActiveScript_Release(&This
->IActiveScript_iface
);
605 #define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER)
607 static HRESULT WINAPI
VBScriptSafety_GetInterfaceSafetyOptions(IObjectSafety
*iface
, REFIID riid
,
608 DWORD
*pdwSupportedOptions
, DWORD
*pdwEnabledOptions
)
610 VBScript
*This
= impl_from_IObjectSafety(iface
);
612 TRACE("(%p)->(%s %p %p)\n", This
, debugstr_guid(riid
), pdwSupportedOptions
, pdwEnabledOptions
);
614 if(!pdwSupportedOptions
|| !pdwEnabledOptions
)
617 *pdwSupportedOptions
= SUPPORTED_OPTIONS
;
618 *pdwEnabledOptions
= This
->safeopt
;
622 static HRESULT WINAPI
VBScriptSafety_SetInterfaceSafetyOptions(IObjectSafety
*iface
, REFIID riid
,
623 DWORD dwOptionSetMask
, DWORD dwEnabledOptions
)
625 VBScript
*This
= impl_from_IObjectSafety(iface
);
627 TRACE("(%p)->(%s %x %x)\n", This
, debugstr_guid(riid
), dwOptionSetMask
, dwEnabledOptions
);
629 if(dwOptionSetMask
& ~SUPPORTED_OPTIONS
)
632 This
->safeopt
= (dwEnabledOptions
& dwOptionSetMask
) | (This
->safeopt
& ~dwOptionSetMask
) | INTERFACE_USES_DISPEX
;
636 static const IObjectSafetyVtbl VBScriptSafetyVtbl
= {
637 VBScriptSafety_QueryInterface
,
638 VBScriptSafety_AddRef
,
639 VBScriptSafety_Release
,
640 VBScriptSafety_GetInterfaceSafetyOptions
,
641 VBScriptSafety_SetInterfaceSafetyOptions
644 HRESULT WINAPI
VBScriptFactory_CreateInstance(IClassFactory
*iface
, IUnknown
*pUnkOuter
, REFIID riid
, void **ppv
)
649 TRACE("(%p %s %p)\n", pUnkOuter
, debugstr_guid(riid
), ppv
);
651 ret
= heap_alloc_zero(sizeof(*ret
));
653 return E_OUTOFMEMORY
;
655 ret
->IActiveScript_iface
.lpVtbl
= &VBScriptVtbl
;
656 ret
->IActiveScriptParse_iface
.lpVtbl
= &VBScriptParseVtbl
;
657 ret
->IObjectSafety_iface
.lpVtbl
= &VBScriptSafetyVtbl
;
660 ret
->state
= SCRIPTSTATE_UNINITIALIZED
;
661 ret
->safeopt
= INTERFACE_USES_DISPEX
;
663 hres
= IActiveScript_QueryInterface(&ret
->IActiveScript_iface
, riid
, ppv
);
664 IActiveScript_Release(&ret
->IActiveScript_iface
);
669 IServiceProvider IServiceProvider_iface
;
673 IServiceProvider
*sp
;
676 static inline AXSite
*impl_from_IServiceProvider(IServiceProvider
*iface
)
678 return CONTAINING_RECORD(iface
, AXSite
, IServiceProvider_iface
);
681 static HRESULT WINAPI
AXSite_QueryInterface(IServiceProvider
*iface
, REFIID riid
, void **ppv
)
683 AXSite
*This
= impl_from_IServiceProvider(iface
);
685 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
686 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
687 *ppv
= &This
->IServiceProvider_iface
;
688 }else if(IsEqualGUID(&IID_IServiceProvider
, riid
)) {
689 TRACE("(%p)->(IID_IServiceProvider %p)\n", This
, ppv
);
690 *ppv
= &This
->IServiceProvider_iface
;
692 TRACE("(%p)->(%s %p)\n", This
, debugstr_guid(riid
), ppv
);
694 return E_NOINTERFACE
;
697 IUnknown_AddRef((IUnknown
*)*ppv
);
701 static ULONG WINAPI
AXSite_AddRef(IServiceProvider
*iface
)
703 AXSite
*This
= impl_from_IServiceProvider(iface
);
704 LONG ref
= InterlockedIncrement(&This
->ref
);
706 TRACE("(%p) ref=%d\n", This
, ref
);
711 static ULONG WINAPI
AXSite_Release(IServiceProvider
*iface
)
713 AXSite
*This
= impl_from_IServiceProvider(iface
);
714 LONG ref
= InterlockedDecrement(&This
->ref
);
716 TRACE("(%p) ref=%d\n", This
, ref
);
724 static HRESULT WINAPI
AXSite_QueryService(IServiceProvider
*iface
,
725 REFGUID guidService
, REFIID riid
, void **ppv
)
727 AXSite
*This
= impl_from_IServiceProvider(iface
);
729 TRACE("(%p)->(%s %s %p)\n", This
, debugstr_guid(guidService
), debugstr_guid(riid
), ppv
);
731 return IServiceProvider_QueryService(This
->sp
, guidService
, riid
, ppv
);
734 static IServiceProviderVtbl AXSiteVtbl
= {
735 AXSite_QueryInterface
,
741 IUnknown
*create_ax_site(script_ctx_t
*ctx
)
743 IServiceProvider
*sp
;
747 hres
= IActiveScriptSite_QueryInterface(ctx
->site
, &IID_IServiceProvider
, (void**)&sp
);
749 ERR("Could not get IServiceProvider iface: %08x\n", hres
);
753 ret
= heap_alloc(sizeof(*ret
));
755 IServiceProvider_Release(sp
);
759 ret
->IServiceProvider_iface
.lpVtbl
= &AXSiteVtbl
;
763 return (IUnknown
*)&ret
->IServiceProvider_iface
;