ReactOS  0.4.14-dev-604-gcfdd483
vbscript.c
Go to the documentation of this file.
1 /*
2  * Copyright 2011 Jacek Caban for CodeWeavers
3  *
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.
8  *
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.
13  *
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
17  */
18 
19 
20 #include <assert.h>
21 
22 #include "vbscript.h"
23 #include "objsafe.h"
24 
25 #include "wine/debug.h"
26 
28 
29 #ifdef _WIN64
30 
31 #define CTXARG_T DWORDLONG
32 #define IActiveScriptDebugVtbl IActiveScriptDebug64Vtbl
33 #define IActiveScriptParseVtbl IActiveScriptParse64Vtbl
34 #define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_64Vtbl
35 
36 #else
37 
38 #define CTXARG_T DWORD
39 #define IActiveScriptDebugVtbl IActiveScriptDebug32Vtbl
40 #define IActiveScriptParseVtbl IActiveScriptParse32Vtbl
41 #define IActiveScriptParseProcedure2Vtbl IActiveScriptParseProcedure2_32Vtbl
42 
43 #endif
44 
45 struct VBScript {
47  IActiveScriptDebug IActiveScriptDebug_iface;
48  IActiveScriptParse IActiveScriptParse_iface;
49  IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_iface;
51 
53 
58 };
59 
60 typedef struct {
65 
67 {
68  if(This->state == state)
69  return;
70 
71  This->state = state;
72  if(This->ctx->site)
73  IActiveScriptSite_OnStateChange(This->ctx->site, state);
74 }
75 
76 static inline BOOL is_started(VBScript *This)
77 {
78  return This->state == SCRIPTSTATE_STARTED
79  || This->state == SCRIPTSTATE_CONNECTED
80  || This->state == SCRIPTSTATE_DISCONNECTED;
81 }
82 
84 {
85  code->pending_exec = FALSE;
86  return exec_script(ctx, TRUE, &code->main_code, NULL, NULL, res);
87 }
88 
89 static void exec_queued_code(script_ctx_t *ctx)
90 {
91  vbscode_t *iter;
92 
94  if(iter->pending_exec)
95  exec_global_code(ctx, iter, NULL);
96  }
97 }
98 
100 {
102  HRESULT hres;
103 
105  if((item->flags & flags) == flags && !wcsicmp(item->name, name)) {
106  if(!item->disp) {
107  IUnknown *unk;
108 
109  hres = IActiveScriptSite_GetItemInfo(ctx->site, item->name,
110  SCRIPTINFO_IUNKNOWN, &unk, NULL);
111  if(FAILED(hres)) {
112  WARN("GetItemInfo failed: %08x\n", hres);
113  continue;
114  }
115 
116  hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp);
117  IUnknown_Release(unk);
118  if(FAILED(hres)) {
119  WARN("object does not implement IDispatch\n");
120  continue;
121  }
122  }
123 
124  return item->disp;
125  }
126  }
127 
128  return NULL;
129 }
130 
131 static void release_script(script_ctx_t *ctx)
132 {
133  class_desc_t *class_desc;
134 
135  collect_objects(ctx);
136  clear_ei(&ctx->ei);
137 
139  ctx->global_vars = NULL;
140 
141  while(!list_empty(&ctx->named_items)) {
143 
144  list_remove(&iter->entry);
145  if(iter->disp)
146  IDispatch_Release(iter->disp);
147  heap_free(iter->name);
148  heap_free(iter);
149  }
150 
151  while(ctx->procs) {
152  class_desc = ctx->procs;
153  ctx->procs = class_desc->next;
154 
155  heap_free(class_desc);
156  }
157 
158  if(ctx->host_global) {
159  IDispatch_Release(ctx->host_global);
160  ctx->host_global = NULL;
161  }
162 
163  if(ctx->secmgr) {
164  IInternetHostSecurityManager_Release(ctx->secmgr);
165  ctx->secmgr = NULL;
166  }
167 
168  if(ctx->site) {
169  IActiveScriptSite_Release(ctx->site);
170  ctx->site = NULL;
171  }
172 
173  if(ctx->script_obj) {
174  ScriptDisp *script_obj = ctx->script_obj;
175 
176  ctx->script_obj = NULL;
177  script_obj->ctx = NULL;
178  IDispatchEx_Release(&script_obj->IDispatchEx_iface);
179  }
180 
182  heap_pool_free(&ctx->heap);
183  heap_pool_init(&ctx->heap);
184 }
185 
186 static void destroy_script(script_ctx_t *ctx)
187 {
188  while(!list_empty(&ctx->code_list))
190 
191  release_script(ctx);
192  heap_free(ctx);
193 }
194 
196 {
197  switch(This->state) {
201  return;
202  /* FALLTHROUGH */
203  case SCRIPTSTATE_STARTED:
205  if(This->state == SCRIPTSTATE_DISCONNECTED)
208  break;
209  /* FALLTHROUGH */
213  release_script(This->ctx);
214  This->thread_id = 0;
215  break;
216  case SCRIPTSTATE_CLOSED:
217  break;
219  }
220 }
221 
223 {
224  return CONTAINING_RECORD(iface, VBScriptError, IActiveScriptError_iface);
225 }
226 
228 {
230 
231  if(IsEqualGUID(riid, &IID_IUnknown)) {
232  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
233  *ppv = &This->IActiveScriptError_iface;
234  }else if(IsEqualGUID(riid, &IID_IActiveScriptError)) {
235  TRACE("(%p)->(IID_IActiveScriptError %p)\n", This, ppv);
236  *ppv = &This->IActiveScriptError_iface;
237  }else {
238  FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
239  *ppv = NULL;
240  return E_NOINTERFACE;
241  }
242 
243  IUnknown_AddRef((IUnknown*)*ppv);
244  return S_OK;
245 }
246 
248 {
251 
252  TRACE("(%p) ref=%d\n", This, ref);
253 
254  return ref;
255 }
256 
258 {
261 
262  TRACE("(%p) ref=%d\n", This, ref);
263 
264  if(!ref) {
265  heap_free(This);
266  }
267 
268  return ref;
269 }
270 
272 {
274 
275  TRACE("(%p)->(%p)\n", This, excepinfo);
276 
277  *excepinfo = This->ei;
278  excepinfo->bstrSource = SysAllocString(This->ei.bstrSource);
279  excepinfo->bstrDescription = SysAllocString(This->ei.bstrDescription);
280  excepinfo->bstrHelpFile = SysAllocString(This->ei.bstrHelpFile);
281  return S_OK;
282 }
283 
285 {
287 
288  FIXME("(%p)->(%p %p %p)\n", This, source_context, line, character);
289 
290  if(source_context)
291  *source_context = 0;
292  if(line)
293  *line = 0;
294  if(character)
295  *character = 0;
296  return S_OK;
297 }
298 
300 {
302  FIXME("(%p)->(%p)\n", This, source);
303  return E_NOTIMPL;
304 }
305 
306 static const IActiveScriptErrorVtbl VBScriptErrorVtbl = {
313 };
314 
316 {
319 
320  if(!(error = heap_alloc(sizeof(*error))))
321  return E_OUTOFMEMORY;
322  error->IActiveScriptError_iface.lpVtbl = &VBScriptErrorVtbl;
323 
324  error->ref = 1;
325  error->ei = ctx->ei;
326  memset(&ctx->ei, 0, sizeof(ctx->ei));
327  result = error->ei.scode;
328 
329  hres = IActiveScriptSite_OnScriptError(ctx->site, &error->IActiveScriptError_iface);
330  IActiveScriptError_Release(&error->IActiveScriptError_iface);
331  return hres == S_OK ? SCRIPT_E_REPORTED : result;
332 }
333 
335 {
336  return CONTAINING_RECORD(iface, VBScript, IActiveScript_iface);
337 }
338 
340 {
342 
343  if(IsEqualGUID(riid, &IID_IUnknown)) {
344  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
345  *ppv = &This->IActiveScript_iface;
346  }else if(IsEqualGUID(riid, &IID_IActiveScript)) {
347  TRACE("(%p)->(IID_IActiveScript %p)\n", This, ppv);
348  *ppv = &This->IActiveScript_iface;
349  }else if(IsEqualGUID(riid, &IID_IActiveScriptDebug)) {
350  TRACE("(%p)->(IID_IActiveScriptDebug %p)\n", This, ppv);
351  *ppv = &This->IActiveScriptDebug_iface;
352  }else if(IsEqualGUID(riid, &IID_IActiveScriptParse)) {
353  TRACE("(%p)->(IID_IActiveScriptParse %p)\n", This, ppv);
354  *ppv = &This->IActiveScriptParse_iface;
355  }else if(IsEqualGUID(riid, &IID_IActiveScriptParseProcedure2)) {
356  TRACE("(%p)->(IID_IActiveScriptParseProcedure2 %p)\n", This, ppv);
357  *ppv = &This->IActiveScriptParseProcedure2_iface;
358  }else if(IsEqualGUID(riid, &IID_IObjectSafety)) {
359  TRACE("(%p)->(IID_IObjectSafety %p)\n", This, ppv);
360  *ppv = &This->IObjectSafety_iface;
361  }else {
362  FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
363  *ppv = NULL;
364  return E_NOINTERFACE;
365  }
366 
367  IUnknown_AddRef((IUnknown*)*ppv);
368  return S_OK;
369 }
370 
372 {
375 
376  TRACE("(%p) ref=%d\n", This, ref);
377 
378  return ref;
379 }
380 
382 {
385 
386  TRACE("(%p) ref=%d\n", iface, ref);
387 
388  if(!ref) {
390  destroy_script(This->ctx);
391  heap_free(This);
392  }
393 
394  return ref;
395 }
396 
398 {
400  LCID lcid;
401  HRESULT hres;
402 
403  TRACE("(%p)->(%p)\n", This, pass);
404 
405  if(!pass)
406  return E_POINTER;
407 
408  if(This->ctx->site)
409  return E_UNEXPECTED;
410 
411  if(InterlockedCompareExchange(&This->thread_id, GetCurrentThreadId(), 0))
412  return E_UNEXPECTED;
413 
414  hres = create_script_disp(This->ctx, &This->ctx->script_obj);
415  if(FAILED(hres))
416  return hres;
417 
418  This->ctx->site = pass;
419  IActiveScriptSite_AddRef(This->ctx->site);
420 
421  hres = IActiveScriptSite_GetLCID(This->ctx->site, &lcid);
422  if(hres == S_OK)
423  This->ctx->lcid = lcid;
424 
425  if(This->is_initialized)
427  return S_OK;
428 }
429 
431  void **ppvObject)
432 {
434  FIXME("(%p)->()\n", This);
435  return E_NOTIMPL;
436 }
437 
439 {
441 
442  TRACE("(%p)->(%d)\n", This, ss);
443 
444  if(This->thread_id && GetCurrentThreadId() != This->thread_id)
445  return E_UNEXPECTED;
446 
448  if(This->state == SCRIPTSTATE_CLOSED)
449  return E_UNEXPECTED;
450 
452  return S_OK;
453  }
454 
455  if(!This->is_initialized)
456  return E_UNEXPECTED;
457 
458  switch(ss) {
459  case SCRIPTSTATE_STARTED:
460  case SCRIPTSTATE_CONNECTED: /* FIXME */
461  if(This->state == SCRIPTSTATE_CLOSED)
462  return E_UNEXPECTED;
463 
464  exec_queued_code(This->ctx);
465  break;
467  FIXME("unimplemented SCRIPTSTATE_INITIALIZED\n");
468  return S_OK;
470  FIXME("unimplemented SCRIPTSTATE_DISCONNECTED\n");
471  return S_OK;
472  default:
473  FIXME("unimplemented state %d\n", ss);
474  return E_NOTIMPL;
475  }
476 
477  change_state(This, ss);
478  return S_OK;
479 }
480 
482 {
484 
485  TRACE("(%p)->(%p)\n", This, pssState);
486 
487  if(!pssState)
488  return E_POINTER;
489 
490  if(This->thread_id && This->thread_id != GetCurrentThreadId())
491  return E_UNEXPECTED;
492 
493  *pssState = This->state;
494  return S_OK;
495 }
496 
498 {
500 
501  TRACE("(%p)->()\n", This);
502 
503  if(This->thread_id && This->thread_id != GetCurrentThreadId())
504  return E_UNEXPECTED;
505 
507  return S_OK;
508 }
509 
510 static HRESULT WINAPI VBScript_AddNamedItem(IActiveScript *iface, LPCOLESTR pstrName, DWORD dwFlags)
511 {
514  IDispatch *disp = NULL;
515  HRESULT hres;
516 
517  TRACE("(%p)->(%s %x)\n", This, debugstr_w(pstrName), dwFlags);
518 
519  if(This->thread_id != GetCurrentThreadId() || !This->ctx->site)
520  return E_UNEXPECTED;
521 
522  if(dwFlags & SCRIPTITEM_GLOBALMEMBERS) {
523  IUnknown *unk;
524 
525  hres = IActiveScriptSite_GetItemInfo(This->ctx->site, pstrName, SCRIPTINFO_IUNKNOWN, &unk, NULL);
526  if(FAILED(hres)) {
527  WARN("GetItemInfo failed: %08x\n", hres);
528  return hres;
529  }
530 
531  hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&disp);
532  IUnknown_Release(unk);
533  if(FAILED(hres)) {
534  WARN("object does not implement IDispatch\n");
535  return hres;
536  }
537 
538  if(This->ctx->host_global)
539  IDispatch_Release(This->ctx->host_global);
540  IDispatch_AddRef(disp);
541  This->ctx->host_global = disp;
542  }
543 
544  item = heap_alloc(sizeof(*item));
545  if(!item) {
546  if(disp)
547  IDispatch_Release(disp);
548  return E_OUTOFMEMORY;
549  }
550 
551  item->disp = disp;
552  item->flags = dwFlags;
553  item->name = heap_strdupW(pstrName);
554  if(!item->name) {
555  if(disp)
556  IDispatch_Release(disp);
557  heap_free(item);
558  return E_OUTOFMEMORY;
559  }
560 
561  list_add_tail(&This->ctx->named_items, &item->entry);
562  return S_OK;
563 }
564 
566  DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
567 {
569  FIXME("(%p)->()\n", This);
570  return E_NOTIMPL;
571 }
572 
573 static HRESULT WINAPI VBScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR pstrItemName, IDispatch **ppdisp)
574 {
576 
577  TRACE("(%p)->(%p)\n", This, ppdisp);
578 
579  if(!ppdisp)
580  return E_POINTER;
581 
582  if(This->thread_id != GetCurrentThreadId() || !This->ctx->script_obj) {
583  *ppdisp = NULL;
584  return E_UNEXPECTED;
585  }
586 
587  *ppdisp = (IDispatch*)&This->ctx->script_obj->IDispatchEx_iface;
588  IDispatch_AddRef(*ppdisp);
589  return S_OK;
590 }
591 
593  SCRIPTTHREADID *pstridThread)
594 {
596  FIXME("(%p)->()\n", This);
597  return E_NOTIMPL;
598 }
599 
601  DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
602 {
604  FIXME("(%p)->()\n", This);
605  return E_NOTIMPL;
606 }
607 
609  SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
610 {
612  FIXME("(%p)->()\n", This);
613  return E_NOTIMPL;
614 }
615 
617  SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
618 {
620  FIXME("(%p)->()\n", This);
621  return E_NOTIMPL;
622 }
623 
625 {
627  FIXME("(%p)->()\n", This);
628  return E_NOTIMPL;
629 }
630 
631 static const IActiveScriptVtbl VBScriptVtbl = {
648 };
649 
650 static inline VBScript *impl_from_IActiveScriptDebug(IActiveScriptDebug *iface)
651 {
652  return CONTAINING_RECORD(iface, VBScript, IActiveScriptDebug_iface);
653 }
654 
655 static HRESULT WINAPI VBScriptDebug_QueryInterface(IActiveScriptDebug *iface, REFIID riid, void **ppv)
656 {
658  return IActiveScript_QueryInterface(&This->IActiveScript_iface, riid, ppv);
659 }
660 
661 static ULONG WINAPI VBScriptDebug_AddRef(IActiveScriptDebug *iface)
662 {
664  return IActiveScript_AddRef(&This->IActiveScript_iface);
665 }
666 
667 static ULONG WINAPI VBScriptDebug_Release(IActiveScriptDebug *iface)
668 {
670  return IActiveScript_Release(&This->IActiveScript_iface);
671 }
672 
673 static HRESULT WINAPI VBScriptDebug_GetScriptTextAttributes(IActiveScriptDebug *iface,
674  LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
675 {
677  FIXME("(%p)->(%s %u %s %#x %p)\n", This, debugstr_w(code), len,
679  return E_NOTIMPL;
680 }
681 
682 static HRESULT WINAPI VBScriptDebug_GetScriptletTextAttributes(IActiveScriptDebug *iface,
683  LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
684 {
686  FIXME("(%p)->(%s %u %s %#x %p)\n", This, debugstr_w(code), len,
688  return E_NOTIMPL;
689 }
690 
691 static HRESULT WINAPI VBScriptDebug_EnumCodeContextsOfPosition(IActiveScriptDebug *iface,
693 {
695  FIXME("(%p)->(%s %u %u %p)\n", This, wine_dbgstr_longlong(source), offset, len, ret);
696  return E_NOTIMPL;
697 }
698 
706 };
707 
708 static inline VBScript *impl_from_IActiveScriptParse(IActiveScriptParse *iface)
709 {
710  return CONTAINING_RECORD(iface, VBScript, IActiveScriptParse_iface);
711 }
712 
713 static HRESULT WINAPI VBScriptParse_QueryInterface(IActiveScriptParse *iface, REFIID riid, void **ppv)
714 {
716  return IActiveScript_QueryInterface(&This->IActiveScript_iface, riid, ppv);
717 }
718 
719 static ULONG WINAPI VBScriptParse_AddRef(IActiveScriptParse *iface)
720 {
722  return IActiveScript_AddRef(&This->IActiveScript_iface);
723 }
724 
725 static ULONG WINAPI VBScriptParse_Release(IActiveScriptParse *iface)
726 {
728  return IActiveScript_Release(&This->IActiveScript_iface);
729 }
730 
731 static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface)
732 {
734 
735  TRACE("(%p)\n", This);
736 
737  if(This->is_initialized)
738  return E_UNEXPECTED;
739  This->is_initialized = TRUE;
740 
741  if(This->ctx->site)
743  return S_OK;
744 }
745 
746 static HRESULT WINAPI VBScriptParse_AddScriptlet(IActiveScriptParse *iface,
747  LPCOLESTR pstrDefaultName, LPCOLESTR pstrCode, LPCOLESTR pstrItemName,
748  LPCOLESTR pstrSubItemName, LPCOLESTR pstrEventName, LPCOLESTR pstrDelimiter,
749  CTXARG_T dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags,
750  BSTR *pbstrName, EXCEPINFO *pexcepinfo)
751 {
753  FIXME("(%p)->(%s %s %s %s %s %s %s %u %x %p %p)\n", This, debugstr_w(pstrDefaultName),
754  debugstr_w(pstrCode), debugstr_w(pstrItemName), debugstr_w(pstrSubItemName),
755  debugstr_w(pstrEventName), debugstr_w(pstrDelimiter), wine_dbgstr_longlong(dwSourceContextCookie),
756  ulStartingLineNumber, dwFlags, pbstrName, pexcepinfo);
757  return E_NOTIMPL;
758 }
759 
760 static HRESULT WINAPI VBScriptParse_ParseScriptText(IActiveScriptParse *iface,
761  LPCOLESTR pstrCode, LPCOLESTR pstrItemName, IUnknown *punkContext,
762  LPCOLESTR pstrDelimiter, CTXARG_T dwSourceContextCookie, ULONG ulStartingLine,
763  DWORD dwFlags, VARIANT *pvarResult, EXCEPINFO *pexcepinfo)
764 {
767  vbscode_t *code;
768  HRESULT hres;
769 
770  TRACE("(%p)->(%s %s %p %s %s %u %x %p %p)\n", This, debugstr_w(pstrCode),
771  debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter),
772  wine_dbgstr_longlong(dwSourceContextCookie), ulStartingLine, dwFlags, pvarResult, pexcepinfo);
773 
774  if(This->thread_id != GetCurrentThreadId() || This->state == SCRIPTSTATE_CLOSED)
775  return E_UNEXPECTED;
776 
777  if(pstrItemName) {
778  context = lookup_named_item(This->ctx, pstrItemName, 0);
779  if(!context) {
780  WARN("Inknown context %s\n", debugstr_w(pstrItemName));
781  return E_INVALIDARG;
782  }
783  }
784 
785  hres = compile_script(This->ctx, pstrCode, pstrDelimiter, dwFlags, &code);
786  if(FAILED(hres))
787  return hres;
788 
789  if(context)
790  IDispatch_AddRef(code->context = context);
791 
792  if(!(dwFlags & SCRIPTTEXT_ISEXPRESSION) && !is_started(This)) {
793  code->pending_exec = TRUE;
794  return S_OK;
795  }
796 
797  return exec_global_code(This->ctx, code, pvarResult);
798 }
799 
807 };
808 
809 static inline VBScript *impl_from_IActiveScriptParseProcedure2(IActiveScriptParseProcedure2 *iface)
810 {
811  return CONTAINING_RECORD(iface, VBScript, IActiveScriptParseProcedure2_iface);
812 }
813 
814 static HRESULT WINAPI VBScriptParseProcedure_QueryInterface(IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
815 {
817  return IActiveScript_QueryInterface(&This->IActiveScript_iface, riid, ppv);
818 }
819 
820 static ULONG WINAPI VBScriptParseProcedure_AddRef(IActiveScriptParseProcedure2 *iface)
821 {
823  return IActiveScript_AddRef(&This->IActiveScript_iface);
824 }
825 
826 static ULONG WINAPI VBScriptParseProcedure_Release(IActiveScriptParseProcedure2 *iface)
827 {
829  return IActiveScript_Release(&This->IActiveScript_iface);
830 }
831 
832 static HRESULT WINAPI VBScriptParseProcedure_ParseProcedureText(IActiveScriptParseProcedure2 *iface,
833  LPCOLESTR pstrCode, LPCOLESTR pstrFormalParams, LPCOLESTR pstrProcedureName,
834  LPCOLESTR pstrItemName, IUnknown *punkContext, LPCOLESTR pstrDelimiter,
835  CTXARG_T dwSourceContextCookie, ULONG ulStartingLineNumber, DWORD dwFlags, IDispatch **ppdisp)
836 {
839  vbdisp_t *vbdisp;
840  HRESULT hres;
841 
842  TRACE("(%p)->(%s %s %s %s %p %s %s %u %x %p)\n", This, debugstr_w(pstrCode), debugstr_w(pstrFormalParams),
843  debugstr_w(pstrProcedureName), debugstr_w(pstrItemName), punkContext, debugstr_w(pstrDelimiter),
844  wine_dbgstr_longlong(dwSourceContextCookie), ulStartingLineNumber, dwFlags, ppdisp);
845 
846  if(This->thread_id != GetCurrentThreadId() || This->state == SCRIPTSTATE_CLOSED)
847  return E_UNEXPECTED;
848 
849  hres = compile_procedure(This->ctx, pstrCode, pstrDelimiter, dwFlags, &desc);
850  if(FAILED(hres))
851  return hres;
852 
853  hres = create_vbdisp(desc, &vbdisp);
854  if(FAILED(hres))
855  return hres;
856 
857  *ppdisp = (IDispatch*)&vbdisp->IDispatchEx_iface;
858  return S_OK;
859 }
860 
866 };
867 
869 {
870  return CONTAINING_RECORD(iface, VBScript, IObjectSafety_iface);
871 }
872 
874 {
876  return IActiveScript_QueryInterface(&This->IActiveScript_iface, riid, ppv);
877 }
878 
880 {
882  return IActiveScript_AddRef(&This->IActiveScript_iface);
883 }
884 
886 {
888  return IActiveScript_Release(&This->IActiveScript_iface);
889 }
890 
891 #define SUPPORTED_OPTIONS (INTERFACESAFE_FOR_UNTRUSTED_DATA|INTERFACE_USES_DISPEX|INTERFACE_USES_SECURITY_MANAGER)
892 
894  DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
895 {
897 
898  TRACE("(%p)->(%s %p %p)\n", This, debugstr_guid(riid), pdwSupportedOptions, pdwEnabledOptions);
899 
900  if(!pdwSupportedOptions || !pdwEnabledOptions)
901  return E_POINTER;
902 
903  *pdwSupportedOptions = SUPPORTED_OPTIONS;
904  *pdwEnabledOptions = This->ctx->safeopt;
905  return S_OK;
906 }
907 
909  DWORD dwOptionSetMask, DWORD dwEnabledOptions)
910 {
912 
913  TRACE("(%p)->(%s %x %x)\n", This, debugstr_guid(riid), dwOptionSetMask, dwEnabledOptions);
914 
915  if(dwOptionSetMask & ~SUPPORTED_OPTIONS)
916  return E_FAIL;
917 
918  This->ctx->safeopt = (dwEnabledOptions & dwOptionSetMask) | (This->ctx->safeopt & ~dwOptionSetMask) | INTERFACE_USES_DISPEX;
919  return S_OK;
920 }
921 
922 static const IObjectSafetyVtbl VBScriptSafetyVtbl = {
928 };
929 
931 {
932  script_ctx_t *ctx;
933  VBScript *ret;
934  HRESULT hres;
935 
936  TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
937 
938  ret = heap_alloc_zero(sizeof(*ret));
939  if(!ret)
940  return E_OUTOFMEMORY;
941 
942  ret->IActiveScript_iface.lpVtbl = &VBScriptVtbl;
943  ret->IActiveScriptDebug_iface.lpVtbl = &VBScriptDebugVtbl;
944  ret->IActiveScriptParse_iface.lpVtbl = &VBScriptParseVtbl;
945  ret->IActiveScriptParseProcedure2_iface.lpVtbl = &VBScriptParseProcedureVtbl;
946  ret->IObjectSafety_iface.lpVtbl = &VBScriptSafetyVtbl;
947 
948  ret->ref = 1;
950 
951  ctx = ret->ctx = heap_alloc_zero(sizeof(*ctx));
952  if(!ctx) {
953  heap_free(ret);
954  return E_OUTOFMEMORY;
955  }
956 
957  ctx->safeopt = INTERFACE_USES_DISPEX;
958  heap_pool_init(&ctx->heap);
959  list_init(&ctx->objects);
960  list_init(&ctx->code_list);
961  list_init(&ctx->named_items);
962 
963  hres = init_global(ctx);
964  if(FAILED(hres)) {
965  IActiveScript_Release(&ret->IActiveScript_iface);
966  return hres;
967  }
968 
969  hres = IActiveScript_QueryInterface(&ret->IActiveScript_iface, riid, ppv);
970  IActiveScript_Release(&ret->IActiveScript_iface);
971  return hres;
972 }
973 
974 typedef struct {
975  IServiceProvider IServiceProvider_iface;
976 
977  LONG ref;
978 
980 } AXSite;
981 
983 {
984  return CONTAINING_RECORD(iface, AXSite, IServiceProvider_iface);
985 }
986 
988 {
990 
991  if(IsEqualGUID(&IID_IUnknown, riid)) {
992  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
993  *ppv = &This->IServiceProvider_iface;
994  }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
995  TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
996  *ppv = &This->IServiceProvider_iface;
997  }else {
998  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
999  *ppv = NULL;
1000  return E_NOINTERFACE;
1001  }
1002 
1003  IUnknown_AddRef((IUnknown*)*ppv);
1004  return S_OK;
1005 }
1006 
1008 {
1010  LONG ref = InterlockedIncrement(&This->ref);
1011 
1012  TRACE("(%p) ref=%d\n", This, ref);
1013 
1014  return ref;
1015 }
1016 
1018 {
1020  LONG ref = InterlockedDecrement(&This->ref);
1021 
1022  TRACE("(%p) ref=%d\n", This, ref);
1023 
1024  if(!ref)
1025  heap_free(This);
1026 
1027  return ref;
1028 }
1029 
1031  REFGUID guidService, REFIID riid, void **ppv)
1032 {
1034 
1035  TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
1036 
1037  return IServiceProvider_QueryService(This->sp, guidService, riid, ppv);
1038 }
1039 
1040 static IServiceProviderVtbl AXSiteVtbl = {
1042  AXSite_AddRef,
1045 };
1046 
1048 {
1050  AXSite *ret;
1051  HRESULT hres;
1052 
1053  hres = IActiveScriptSite_QueryInterface(ctx->site, &IID_IServiceProvider, (void**)&sp);
1054  if(FAILED(hres)) {
1055  ERR("Could not get IServiceProvider iface: %08x\n", hres);
1056  return NULL;
1057  }
1058 
1059  ret = heap_alloc(sizeof(*ret));
1060  if(!ret) {
1061  IServiceProvider_Release(sp);
1062  return NULL;
1063  }
1064 
1065  ret->IServiceProvider_iface.lpVtbl = &AXSiteVtbl;
1066  ret->ref = 1;
1067  ret->sp = sp;
1068 
1069  return (IUnknown*)&ret->IServiceProvider_iface;
1070 }
script_ctx_t * ctx
Definition: vbscript.c:55
static void release_script(script_ctx_t *ctx)
Definition: vbscript.c:131
static BOOL is_started(VBScript *This)
Definition: vbscript.c:76
#define DEFAULT_UNREACHABLE
static AXSite * impl_from_IServiceProvider(IServiceProvider *iface)
Definition: vbscript.c:982
disp
Definition: i386-dis.c:3181
static HRESULT WINAPI VBScriptDebug_GetScriptTextAttributes(IActiveScriptDebug *iface, LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
Definition: vbscript.c:673
heap_pool_t heap
Definition: vbscript.h:200
static ULONG WINAPI VBScriptParseProcedure_AddRef(IActiveScriptParseProcedure2 *iface)
Definition: vbscript.c:820
static BOOL CALLBACK collect_objects(LPCDIDEVICEOBJECTINSTANCEW lpddo, LPVOID pvRef)
Definition: config.c:57
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
static void exec_queued_code(script_ctx_t *ctx)
Definition: vbscript.c:89
#define E_NOINTERFACE
Definition: winerror.h:2364
ScriptDisp * script_obj
Definition: vbscript.h:188
static const IObjectSafetyVtbl VBScriptSafetyVtbl
Definition: vbscript.c:922
#define error(str)
Definition: mkdosfs.c:1605
static HRESULT WINAPI VBScript_Clone(IActiveScript *iface, IActiveScript **ppscript)
Definition: vbscript.c:624
Definition: scsiwmi.h:51
void release_vbscode(vbscode_t *code)
Definition: compile.c:1768
Definition: http.c:7098
static ULONG WINAPI VBScriptParse_AddRef(IActiveScriptParse *iface)
Definition: vbscript.c:719
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI VBScript_SetScriptSite(IActiveScript *iface, IActiveScriptSite *pass)
Definition: vbscript.c:397
static const IActiveScriptParseProcedure2Vtbl VBScriptParseProcedureVtbl
Definition: vbscript.c:861
script_ctx_t * ctx
Definition: vbscript.h:138
struct list objects
Definition: vbscript.h:202
#define WARN(fmt,...)
Definition: debug.h:111
dynamic_var_t * global_vars
Definition: vbscript.h:195
GLintptr offset
Definition: glext.h:5920
static HRESULT WINAPI VBScriptDebug_GetScriptletTextAttributes(IActiveScriptDebug *iface, LPCOLESTR code, ULONG len, LPCOLESTR delimiter, DWORD flags, SOURCE_TEXT_ATTR *attr)
Definition: vbscript.c:682
REFIID LPVOID * ppv
Definition: atlbase.h:39
IObjectSafety IObjectSafety_iface
Definition: vbscript.c:50
IUnknown * create_ax_site(script_ctx_t *ctx)
Definition: vbscript.c:1047
static HRESULT WINAPI VBScript_GetCurrentScriptThreadID(IActiveScript *iface, SCRIPTTHREADID *pstridThread)
Definition: vbscript.c:592
#define InterlockedCompareExchange
Definition: interlocked.h:104
static HRESULT WINAPI VBScriptError_GetExceptionInfo(IActiveScriptError *iface, EXCEPINFO *excepinfo)
Definition: vbscript.c:271
SCRIPTSTATE state
Definition: vbscript.c:54
DWORD SCRIPTTHREADID
Definition: activscp.idl:86
DWORD LCID
Definition: nls.h:13
void release_dynamic_vars(dynamic_var_t *var)
Definition: interp.c:2044
static void decrease_state(VBScript *This, SCRIPTSTATE state)
Definition: vbscript.c:195
OLECHAR * BSTR
Definition: compat.h:1942
HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: vbscript.c:930
LONG thread_id
Definition: vbscript.c:56
void clear_ei(script_ctx_t *ctx)
Definition: engine.c:430
static HRESULT WINAPI VBScript_SetScriptState(IActiveScript *iface, SCRIPTSTATE ss)
Definition: vbscript.c:438
#define E_FAIL
Definition: ddrawi.h:102
static ULONG WINAPI VBScriptSafety_AddRef(IObjectSafety *iface)
Definition: vbscript.c:879
Definition: send.c:47
IDispatch * host_global
Definition: jscript.h:429
IActiveScriptParse IActiveScriptParse_iface
Definition: vbscript.c:48
static HRESULT WINAPI VBScriptParse_InitNew(IActiveScriptParse *iface)
Definition: vbscript.c:731
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static const IActiveScriptVtbl VBScriptVtbl
Definition: vbscript.c:631
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
#define CTXARG_T
Definition: vbscript.c:38
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
pass
Definition: typegen.h:24
static HRESULT WINAPI VBScript_InterruptScriptThread(IActiveScript *iface, SCRIPTTHREADID stidThread, const EXCEPINFO *pexcepinfo, DWORD dwFlags)
Definition: vbscript.c:616
HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
Definition: vbdisp.c:470
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static const IActiveScriptErrorVtbl VBScriptErrorVtbl
Definition: vbscript.c:306
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT create_script_disp(script_ctx_t *ctx, ScriptDisp **ret)
Definition: vbdisp.c:819
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static const WCHAR desc[]
Definition: protectdata.c:36
static WCHAR * heap_strdupW(const WCHAR *str)
Definition: propsheet.c:178
#define debugstr_w
Definition: kernel32.h:32
static HRESULT WINAPI VBScriptDebug_EnumCodeContextsOfPosition(IActiveScriptDebug *iface, CTXARG_T source, ULONG offset, ULONG len, IEnumDebugCodeContexts **ret)
Definition: vbscript.c:691
GLenum GLint ref
Definition: glext.h:6028
LONG ref
Definition: vbscript.c:52
#define FIXME(fmt,...)
Definition: debug.h:110
static ULONG WINAPI VBScript_AddRef(IActiveScript *iface)
Definition: vbscript.c:371
static VBScript * impl_from_IActiveScriptParse(IActiveScriptParse *iface)
Definition: vbscript.c:708
static ULONG WINAPI VBScriptSafety_Release(IObjectSafety *iface)
Definition: vbscript.c:885
#define E_INVALIDARG
Definition: ddrawi.h:101
static ULONG WINAPI VBScript_Release(IActiveScript *iface)
Definition: vbscript.c:381
smooth NULL
Definition: ftsmooth.c:416
const char * delimiter
Definition: string.c:1566
static ULONG WINAPI VBScriptParseProcedure_Release(IActiveScriptParseProcedure2 *iface)
Definition: vbscript.c:826
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
Definition: parser.c:48
enum tagSCRIPTSTATE SCRIPTSTATE
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)
Definition: compile.c:2461
#define debugstr_guid
Definition: kernel32.h:35
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
DWORD WINAPI GetCurrentThreadId(VOID)
Definition: thread.c:458
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)
Definition: vbscript.c:760
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)
Definition: vbscript.c:746
EXCEPINFO ei
Definition: vbscript.c:63
static ULONG WINAPI AXSite_AddRef(IServiceProvider *iface)
Definition: vbscript.c:1007
IActiveScript IActiveScript_iface
Definition: vbscript.c:46
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static HRESULT WINAPI VBScriptDebug_QueryInterface(IActiveScriptDebug *iface, REFIID riid, void **ppv)
Definition: vbscript.c:655
WORD SOURCE_TEXT_ATTR
Definition: activdbg.idl:83
static VBScript * impl_from_IActiveScriptDebug(IActiveScriptDebug *iface)
Definition: vbscript.c:650
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI VBScriptSafety_QueryInterface(IObjectSafety *iface, REFIID riid, void **ppv)
Definition: vbscript.c:873
HRESULT hres
Definition: protocol.c:465
class_desc_t * procs
Definition: vbscript.h:198
void detach_global_objects(script_ctx_t *ctx)
Definition: global.c:2855
DWORD safeopt
Definition: jscript.h:419
static HRESULT WINAPI VBScript_GetScriptDispatch(IActiveScript *iface, LPCOLESTR pstrItemName, IDispatch **ppdisp)
Definition: vbscript.c:573
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define IActiveScriptDebugVtbl
Definition: vbscript.c:39
static HRESULT WINAPI AXSite_QueryInterface(IServiceProvider *iface, REFIID riid, void **ppv)
Definition: vbscript.c:987
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:6
enum tagSCRIPTTHREADSTATE SCRIPTTHREADSTATE
static HRESULT WINAPI VBScriptParse_QueryInterface(IActiveScriptParse *iface, REFIID riid, void **ppv)
Definition: vbscript.c:713
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT init_global(script_ctx_t *ctx)
Definition: global.c:1105
struct _class_desc_t * next
Definition: vbscript.h:113
static HRESULT WINAPI VBScript_AddNamedItem(IActiveScript *iface, LPCOLESTR pstrName, DWORD dwFlags)
Definition: vbscript.c:510
Definition: cookie.c:201
static HRESULT WINAPI VBScriptParseProcedure_QueryInterface(IActiveScriptParseProcedure2 *iface, REFIID riid, void **ppv)
Definition: vbscript.c:814
GLbitfield flags
Definition: glext.h:7161
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:117
const GUID IID_IDispatch
static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code, VARIANT *res)
Definition: vbscript.c:83
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)
Definition: vbscript.c:832
int ret
static ULONG WINAPI VBScriptDebug_AddRef(IActiveScriptDebug *iface)
Definition: vbscript.c:661
#define InterlockedDecrement
Definition: armddk.h:52
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static int state
Definition: maze.c:121
static HRESULT WINAPI VBScriptSafety_GetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions)
Definition: vbscript.c:893
uint32_t entry
Definition: isohybrid.c:63
GLenum GLsizei len
Definition: glext.h:6722
REFIID LPVOID * ppvObject
Definition: precomp.h:44
HRESULT compile_procedure(script_ctx_t *script, const WCHAR *src, const WCHAR *delimiter, DWORD flags, class_desc_t **ret)
Definition: compile.c:1930
static ULONG WINAPI VBScriptError_Release(IActiveScriptError *iface)
Definition: vbscript.c:257
static void change_state(VBScript *This, SCRIPTSTATE state)
Definition: vbscript.c:66
int code
Definition: i386-dis.c:3591
void heap_pool_init(heap_pool_t *) DECLSPEC_HIDDEN
Definition: jsutils.c:71
#define wcsicmp
Definition: string.h:1152
static HRESULT WINAPI VBScript_Close(IActiveScript *iface)
Definition: vbscript.c:497
static VBScript * impl_from_IActiveScript(IActiveScript *iface)
Definition: vbscript.c:334
static HRESULT WINAPI VBScript_QueryInterface(IActiveScript *iface, REFIID riid, void **ppv)
Definition: vbscript.c:339
HRESULT report_script_error(script_ctx_t *ctx)
Definition: vbscript.c:315
BOOL pending_exec
Definition: vbscript.h:342
struct list entry
Definition: vbscript.h:68
#define ERR(fmt,...)
Definition: debug.h:109
static HRESULT WINAPI VBScript_GetScriptThreadState(IActiveScript *iface, SCRIPTTHREADID stidThread, SCRIPTTHREADSTATE *pstsState)
Definition: vbscript.c:608
struct stdole::EXCEPINFO EXCEPINFO
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
#define S_OK
Definition: intsafe.h:59
static HRESULT WINAPI VBScriptError_GetSourceLineText(IActiveScriptError *iface, BSTR *source)
Definition: vbscript.c:299
HRESULT exec_script(HTMLInnerWindow *, const WCHAR *, const WCHAR *, VARIANT *) DECLSPEC_HIDDEN
Definition: script.c:1245
static VBScriptError * impl_from_IActiveScriptError(IActiveScriptError *iface)
Definition: vbscript.c:222
static VBScript * impl_from_IActiveScriptParseProcedure2(IActiveScriptParseProcedure2 *iface)
Definition: vbscript.c:809
#define InterlockedIncrement
Definition: armddk.h:53
static ATOM item
Definition: dde.c:856
static ULONG WINAPI VBScriptDebug_Release(IActiveScriptDebug *iface)
Definition: vbscript.c:667
LPWSTR name
Definition: jscript.h:365
WINE_DEFAULT_DEBUG_CHANNEL(vbscript)
#define E_NOTIMPL
Definition: ddrawi.h:99
IActiveScriptSite * site
Definition: jscript.h:417
struct list code_list
Definition: vbscript.h:203
static HRESULT WINAPI VBScriptError_GetSourcePosition(IActiveScriptError *iface, DWORD *source_context, ULONG *line, LONG *character)
Definition: vbscript.c:284
IDispatch * lookup_named_item(script_ctx_t *ctx, const WCHAR *name, unsigned flags)
Definition: vbscript.c:99
IDispatch * disp
Definition: jscript.h:363
IInternetHostSecurityManager * secmgr
Definition: jscript.h:418
static const IActiveScriptDebugVtbl VBScriptDebugVtbl
Definition: vbscript.c:699
#define IActiveScriptParseProcedure2Vtbl
Definition: vbscript.c:41
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:131
IActiveScriptError IActiveScriptError_iface
Definition: vbscript.c:61
#define SUPPORTED_OPTIONS
Definition: vbscript.c:891
#define E_UNEXPECTED
Definition: winerror.h:2456
static ULONG WINAPI VBScriptError_AddRef(IActiveScriptError *iface)
Definition: vbscript.c:247
void heap_pool_free(heap_pool_t *) DECLSPEC_HIDDEN
Definition: jsutils.c:169
Definition: name.c:38
static EXCEPINFO excepinfo
Definition: automation.c:60
static VBScript * impl_from_IObjectSafety(IObjectSafety *iface)
Definition: vbscript.c:868
GLuint res
Definition: glext.h:9613
static HRESULT WINAPI VBScript_GetScriptThreadID(IActiveScript *iface, DWORD dwWin32ThreadId, SCRIPTTHREADID *pstidThread)
Definition: vbscript.c:600
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
static HRESULT WINAPI AXSite_QueryService(IServiceProvider *iface, REFGUID guidService, REFIID riid, void **ppv)
Definition: vbscript.c:1030
IActiveScriptDebug IActiveScriptDebug_iface
Definition: vbscript.c:47
unsigned int ULONG
Definition: retypes.h:1
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
static const WCHAR sp[]
Definition: suminfo.c:288
named_item_t * named_items
Definition: jscript.h:416
static HRESULT WINAPI VBScriptSafety_SetInterfaceSafetyOptions(IObjectSafety *iface, REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions)
Definition: vbscript.c:908
static const IActiveScriptParseVtbl VBScriptParseVtbl
Definition: vbscript.c:800
static ULONG WINAPI AXSite_Release(IServiceProvider *iface)
Definition: vbscript.c:1017
#define LIST_ENTRY(type)
Definition: queue.h:175
BOOL is_initialized
Definition: vbscript.c:57
#define ss
Definition: i386-dis.c:432
#define E_POINTER
Definition: winerror.h:2365
static ULONG WINAPI VBScriptParse_Release(IActiveScriptParse *iface)
Definition: vbscript.c:725
static void destroy_script(script_ctx_t *ctx)
Definition: vbscript.c:186
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
IActiveScriptParseProcedure2 IActiveScriptParseProcedure2_iface
Definition: vbscript.c:49
static HRESULT WINAPI VBScript_AddTypeLib(IActiveScript *iface, REFGUID rguidTypeLib, DWORD dwMajor, DWORD dwMinor, DWORD dwFlags)
Definition: vbscript.c:565
static IServiceProviderVtbl AXSiteVtbl
Definition: vbscript.c:1040
static HRESULT WINAPI VBScript_GetScriptState(IActiveScript *iface, SCRIPTSTATE *pssState)
Definition: vbscript.c:481
#define IActiveScriptParseVtbl
Definition: vbscript.c:40
jsexcept_t ei
Definition: jscript.h:425
static HRESULT WINAPI VBScript_GetScriptSite(IActiveScript *iface, REFIID riid, void **ppvObject)
Definition: vbscript.c:430
static HRESULT WINAPI VBScriptError_QueryInterface(IActiveScriptError *iface, REFIID riid, void **ppv)
Definition: vbscript.c:227
static BOOL heap_free(void *mem)
Definition: appwiz.h:75