ReactOS  0.4.15-dev-439-g292f67a
vbdisp.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 #include <assert.h>
20 
21 #include "vbscript.h"
22 
23 #include "wine/debug.h"
24 
26 
27 #define FDEX_VERSION_MASK 0xf0000000
28 
29 static inline BOOL is_func_id(vbdisp_t *This, DISPID id)
30 {
31  return id < This->desc->func_cnt;
32 }
33 
34 static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
35 {
36  unsigned i;
37 
38  for(i = invoke_type == VBDISP_ANY ? 0 : 1; i < This->desc->func_cnt; i++) {
39  if(invoke_type == VBDISP_ANY) {
40  if(!search_private && !This->desc->funcs[i].is_public)
41  continue;
42  if(!i && !This->desc->funcs[0].name) /* default value may not exist */
43  continue;
44  }else {
45  if(!This->desc->funcs[i].entries[invoke_type]
46  || (!search_private && !This->desc->funcs[i].entries[invoke_type]->is_public))
47  continue;
48  }
49 
50  if(!wcsicmp(This->desc->funcs[i].name, name)) {
51  *id = i;
52  return TRUE;
53  }
54  }
55 
56  return FALSE;
57 }
58 
60 {
61  unsigned i;
62 
63  if(get_func_id(This, name, invoke_type, search_private, id))
64  return S_OK;
65 
66  for(i=0; i < This->desc->prop_cnt; i++) {
67  if(!search_private && !This->desc->props[i].is_public)
68  continue;
69 
70  if(!wcsicmp(This->desc->props[i].name, name)) {
71  *id = i + This->desc->func_cnt;
72  return S_OK;
73  }
74  }
75 
76  *id = -1;
77  return DISP_E_UNKNOWNNAME;
78 }
79 
80 static HRESULT get_propput_arg(script_ctx_t *ctx, const DISPPARAMS *dp, WORD flags, VARIANT *v, BOOL *is_owned)
81 {
82  unsigned i;
83 
84  for(i=0; i < dp->cNamedArgs; i++) {
85  if(dp->rgdispidNamedArgs[i] == DISPID_PROPERTYPUT)
86  break;
87  }
88  if(i == dp->cNamedArgs) {
89  WARN("no value to set\n");
91  }
92 
93  *v = dp->rgvarg[i];
94  if(V_VT(v) == (VT_VARIANT|VT_BYREF))
95  *v = *V_VARIANTREF(v);
96  *is_owned = FALSE;
97 
98  if(V_VT(v) == VT_DISPATCH) {
100  HRESULT hres;
101 
102  hres = get_disp_value(ctx, V_DISPATCH(v), v);
103  if(FAILED(hres))
104  return hres;
105 
106  *is_owned = TRUE;
107  }
108  }else if(!(flags & DISPATCH_PROPERTYPUT)) {
109  WARN("%s can't be assigned without DISPATCH_PROPERTYPUT flag\n", debugstr_variant(v));
110  return DISP_E_EXCEPTION;
111  }
112 
113  return S_OK;
114 }
115 
117 {
118  HRESULT hres;
119 
120  switch(flags) {
123  if(dp->cArgs) {
124  WARN("called with arguments\n");
125  return DISP_E_MEMBERNOTFOUND; /* That's what tests show */
126  }
127 
128  hres = VariantCopyInd(res, v);
129  break;
130 
134  VARIANT put_val;
135  BOOL own_val;
136 
137  hres = get_propput_arg(ctx, dp, flags, &put_val, &own_val);
138  if(FAILED(hres))
139  return hres;
140 
141  if(arg_cnt(dp)) {
142  FIXME("Arguments not supported\n");
143  return E_NOTIMPL;
144  }
145 
146  if(res)
147  V_VT(res) = VT_EMPTY;
148 
149  if(own_val)
150  *v = put_val;
151  else
152  hres = VariantCopyInd(v, &put_val);
153  break;
154  }
155 
156  default:
157  FIXME("unimplemented flags %x\n", flags);
158  return E_NOTIMPL;
159  }
160 
161  return hres;
162 }
163 
165 {
166  if(id < 0)
167  return DISP_E_MEMBERNOTFOUND;
168 
169  if(is_func_id(This, id)) {
170  function_t *func;
171 
172  TRACE("%p->%s\n", This, debugstr_w(This->desc->funcs[id].name));
173 
174  switch(flags) {
176  func = This->desc->funcs[id].entries[VBDISP_CALLGET];
177  if(!func || (func->type != FUNC_PROPGET && func->type != FUNC_DEFGET)) {
178  WARN("no getter\n");
179  return DISP_E_MEMBERNOTFOUND;
180  }
181 
182  return exec_script(This->desc->ctx, extern_caller, func, This, params, res);
183 
184  case DISPATCH_METHOD:
186  func = This->desc->funcs[id].entries[VBDISP_CALLGET];
187  if(!func) {
188  FIXME("no invoke/getter\n");
189  return DISP_E_MEMBERNOTFOUND;
190  }
191 
192  return exec_script(This->desc->ctx, extern_caller, func, This, params, res);
193 
197  DISPPARAMS dp = {NULL, NULL, 1, 0};
198  BOOL needs_release;
199  VARIANT put_val;
200  HRESULT hres;
201 
202  if(arg_cnt(params)) {
203  FIXME("arguments not implemented\n");
204  return E_NOTIMPL;
205  }
206 
207  hres = get_propput_arg(This->desc->ctx, params, flags, &put_val, &needs_release);
208  if(FAILED(hres))
209  return hres;
210 
211  dp.rgvarg = &put_val;
212  func = This->desc->funcs[id].entries[V_VT(&put_val) == VT_DISPATCH ? VBDISP_SET : VBDISP_LET];
213  if(!func) {
214  FIXME("no letter/setter\n");
215  return DISP_E_MEMBERNOTFOUND;
216  }
217 
218  hres = exec_script(This->desc->ctx, extern_caller, func, This, &dp, NULL);
219  if(needs_release)
220  VariantClear(&put_val);
221  return hres;
222  }
223  default:
224  FIXME("flags %x\n", flags);
225  return DISP_E_MEMBERNOTFOUND;
226  }
227  }
228 
229  if(id >= This->desc->prop_cnt + This->desc->func_cnt)
230  return DISP_E_MEMBERNOTFOUND;
231 
232  TRACE("%p->%s\n", This, debugstr_w(This->desc->props[id - This->desc->func_cnt].name));
233  return invoke_variant_prop(This->desc->ctx, This->props+(id-This->desc->func_cnt), flags, params, res);
234 }
235 
237 {
238  DISPPARAMS dp = {0};
239 
240  if(This->terminator_ran)
241  return TRUE;
242  This->terminator_ran = TRUE;
243 
244  if(!This->desc->class_terminate_id)
245  return TRUE;
246 
247  This->ref++;
248  exec_script(This->desc->ctx, FALSE, This->desc->funcs[This->desc->class_terminate_id].entries[VBDISP_CALLGET],
249  This, &dp, NULL);
250  return !--This->ref;
251 }
252 
253 static void clean_props(vbdisp_t *This)
254 {
255  unsigned i;
256 
257  if(!This->desc)
258  return;
259 
260  for(i=0; i < This->desc->array_cnt; i++) {
261  if(This->arrays[i]) {
262  SafeArrayDestroy(This->arrays[i]);
263  This->arrays[i] = NULL;
264  }
265  }
266 
267  for(i=0; i < This->desc->prop_cnt; i++)
268  VariantClear(This->props+i);
269 }
270 
271 static inline vbdisp_t *impl_from_IDispatchEx(IDispatchEx *iface)
272 {
273  return CONTAINING_RECORD(iface, vbdisp_t, IDispatchEx_iface);
274 }
275 
276 static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
277 {
279 
280  if(IsEqualGUID(&IID_IUnknown, riid)) {
281  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
282  *ppv = &This->IDispatchEx_iface;
283  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
284  TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
285  *ppv = &This->IDispatchEx_iface;
286  }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
287  TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
288  *ppv = &This->IDispatchEx_iface;
289  }else {
290  WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
291  *ppv = NULL;
292  return E_NOINTERFACE;
293  }
294 
295  IUnknown_AddRef((IUnknown*)*ppv);
296  return S_OK;
297 }
298 
299 static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
300 {
303 
304  TRACE("(%p) ref=%d\n", This, ref);
305 
306  return ref;
307 }
308 
309 static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
310 {
313 
314  TRACE("(%p) ref=%d\n", This, ref);
315 
316  if(!ref && run_terminator(This)) {
317  clean_props(This);
318  list_remove(&This->entry);
319  heap_free(This->arrays);
320  heap_free(This);
321  }
322 
323  return ref;
324 }
325 
326 static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
327 {
329 
330  TRACE("(%p)->(%p)\n", This, pctinfo);
331 
332  *pctinfo = 1;
333  return S_OK;
334 }
335 
336 static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid,
337  ITypeInfo **ppTInfo)
338 {
340  FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
341  return E_NOTIMPL;
342 }
343 
344 static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
345  LPOLESTR *rgszNames, UINT cNames, LCID lcid,
346  DISPID *rgDispId)
347 {
349  FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
350  lcid, rgDispId);
351  return E_NOTIMPL;
352 }
353 
354 static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
355  REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
356  VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
357 {
359 
360  TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
361  lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
362 
363  return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL);
364 }
365 
366 static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
367 {
369 
370  TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
371 
372  grfdex &= ~FDEX_VERSION_MASK;
373 
374  if(!This->desc)
375  return E_UNEXPECTED;
376 
377  /* Tests show that fdexNameCaseSensitive is ignored */
378 
379  if(grfdex & ~(fdexNameEnsure|fdexNameCaseInsensitive|fdexNameCaseSensitive)) {
380  FIXME("unsupported flags %x\n", grfdex);
381  return E_NOTIMPL;
382  }
383 
384  return vbdisp_get_id(This, bstrName, VBDISP_ANY, FALSE, pid);
385 }
386 
387 static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
388  VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
389 {
391 
392  TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
393 
394  if(!This->desc)
395  return E_UNEXPECTED;
396 
397  if(pvarRes)
398  V_VT(pvarRes) = VT_EMPTY;
399 
400  return invoke_vbdisp(This, id, wFlags, TRUE, pdp, pvarRes);
401 }
402 
403 static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
404 {
406  FIXME("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
407  return E_NOTIMPL;
408 }
409 
410 static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
411 {
413  FIXME("(%p)->(%x)\n", This, id);
414  return E_NOTIMPL;
415 }
416 
417 static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
418 {
420  FIXME("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
421  return E_NOTIMPL;
422 }
423 
424 static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
425 {
427  FIXME("(%p)->(%x %p)\n", This, id, pbstrName);
428  return E_NOTIMPL;
429 }
430 
431 static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
432 {
434  FIXME("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
435  return E_NOTIMPL;
436 }
437 
438 static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
439 {
441  FIXME("(%p)->(%p)\n", This, ppunk);
442  return E_NOTIMPL;
443 }
444 
445 static IDispatchExVtbl DispatchExVtbl = {
461 };
462 
464 {
465  return iface->lpVtbl == (IDispatchVtbl*)&DispatchExVtbl
466  ? CONTAINING_RECORD((IDispatchEx *)iface, vbdisp_t, IDispatchEx_iface)
467  : NULL;
468 }
469 
471 {
472  vbdisp_t *vbdisp;
473  HRESULT hres = S_OK;
474 
475  vbdisp = heap_alloc_zero( FIELD_OFFSET( vbdisp_t, props[desc->prop_cnt] ));
476  if(!vbdisp)
477  return E_OUTOFMEMORY;
478 
479  vbdisp->IDispatchEx_iface.lpVtbl = &DispatchExVtbl;
480  vbdisp->ref = 1;
481  vbdisp->desc = desc;
482 
483  list_add_tail(&desc->ctx->objects, &vbdisp->entry);
484 
485  if(desc->array_cnt) {
486  vbdisp->arrays = heap_alloc_zero(desc->array_cnt * sizeof(*vbdisp->arrays));
487  if(vbdisp->arrays) {
488  unsigned i, j;
489 
490  for(i=0; i < desc->array_cnt; i++) {
491  if(!desc->array_descs[i].dim_cnt)
492  continue;
493 
494  vbdisp->arrays[i] = SafeArrayCreate(VT_VARIANT, desc->array_descs[i].dim_cnt, desc->array_descs[i].bounds);
495  if(!vbdisp->arrays[i]) {
497  break;
498  }
499  }
500 
501  if(SUCCEEDED(hres)) {
502  for(i=0, j=0; i < desc->prop_cnt; i++) {
503  if(desc->props[i].is_array) {
504  V_VT(vbdisp->props+i) = VT_ARRAY|VT_BYREF|VT_VARIANT;
505  V_ARRAYREF(vbdisp->props+i) = vbdisp->arrays + j++;
506  }
507  }
508  }
509  }else {
511  }
512  }
513 
514  if(SUCCEEDED(hres) && desc->class_initialize_id) {
515  DISPPARAMS dp = {0};
516  hres = exec_script(desc->ctx, FALSE, desc->funcs[desc->class_initialize_id].entries[VBDISP_CALLGET],
517  vbdisp, &dp, NULL);
518  }
519 
520  if(FAILED(hres)) {
521  IDispatchEx_Release(&vbdisp->IDispatchEx_iface);
522  return hres;
523  }
524 
525  *ret = vbdisp;
526  return S_OK;
527 }
528 
529 struct _ident_map_t {
530  const WCHAR *name;
532  union {
535  } u;
536 };
537 
539 {
540  return (ident-This->ident_map)+1;
541 }
542 
544 {
545  return 0 < id && id <= This->ident_map_cnt ? This->ident_map+id-1 : NULL;
546 }
547 
549 {
550  ident_map_t *ret;
551 
552  if(!This->ident_map_size) {
553  This->ident_map = heap_alloc(4 * sizeof(*This->ident_map));
554  if(!This->ident_map)
555  return NULL;
556  This->ident_map_size = 4;
557  }else if(This->ident_map_cnt == This->ident_map_size) {
558  ident_map_t *new_map;
559 
560  new_map = heap_realloc(This->ident_map, 2*This->ident_map_size*sizeof(*new_map));
561  if(!new_map)
562  return NULL;
563  This->ident_map = new_map;
564  This->ident_map_size *= 2;
565  }
566 
567  ret = This->ident_map + This->ident_map_cnt++;
568  ret->name = name;
569  return ret;
570 }
571 
572 static inline ScriptDisp *ScriptDisp_from_IDispatchEx(IDispatchEx *iface)
573 {
574  return CONTAINING_RECORD(iface, ScriptDisp, IDispatchEx_iface);
575 }
576 
577 static HRESULT WINAPI ScriptDisp_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
578 {
580 
581  if(IsEqualGUID(&IID_IUnknown, riid)) {
582  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
583  *ppv = &This->IDispatchEx_iface;
584  }else if(IsEqualGUID(&IID_IDispatch, riid)) {
585  TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
586  *ppv = &This->IDispatchEx_iface;
587  }else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
588  TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
589  *ppv = &This->IDispatchEx_iface;
590  }else {
591  WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
592  *ppv = NULL;
593  return E_NOINTERFACE;
594  }
595 
596  IUnknown_AddRef((IUnknown*)*ppv);
597  return S_OK;
598 }
599 
600 static ULONG WINAPI ScriptDisp_AddRef(IDispatchEx *iface)
601 {
604 
605  TRACE("(%p) ref=%d\n", This, ref);
606 
607  return ref;
608 }
609 
610 static ULONG WINAPI ScriptDisp_Release(IDispatchEx *iface)
611 {
614 
615  TRACE("(%p) ref=%d\n", This, ref);
616 
617  if(!ref) {
618  assert(!This->ctx);
619  heap_free(This->ident_map);
620  heap_free(This);
621  }
622 
623  return ref;
624 }
625 
626 static HRESULT WINAPI ScriptDisp_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
627 {
629 
630  TRACE("(%p)->(%p)\n", This, pctinfo);
631 
632  *pctinfo = 1;
633  return S_OK;
634 }
635 
636 static HRESULT WINAPI ScriptDisp_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid,
637  ITypeInfo **ppTInfo)
638 {
640  FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
641  return E_NOTIMPL;
642 }
643 
644 static HRESULT WINAPI ScriptDisp_GetIDsOfNames(IDispatchEx *iface, REFIID riid,
645  LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
646 {
648  UINT i;
649  HRESULT hres;
650 
651  TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
652  lcid, rgDispId);
653 
654  for(i=0; i < cNames; i++) {
655  hres = IDispatchEx_GetDispID(&This->IDispatchEx_iface, rgszNames[i], 0, rgDispId+i);
656  if(FAILED(hres))
657  return hres;
658  }
659 
660  return S_OK;
661 }
662 
663 static HRESULT WINAPI ScriptDisp_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
664  WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
665 {
667 
668  TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
669  lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
670 
671  return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags,
672  pDispParams, pVarResult, pExcepInfo, NULL);
673 }
674 
675 static HRESULT WINAPI ScriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
676 {
680  function_t *func;
681 
682  TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
683 
684  if(!This->ctx)
685  return E_UNEXPECTED;
686 
687  for(ident = This->ident_map; ident < This->ident_map+This->ident_map_cnt; ident++) {
688  if(!wcsicmp(ident->name, bstrName)) {
689  *pid = ident_to_id(This, ident);
690  return S_OK;
691  }
692  }
693 
694  for(var = This->ctx->global_vars; var; var = var->next) {
695  if(!wcsicmp(var->name, bstrName)) {
696  ident = add_ident(This, var->name);
697  if(!ident)
698  return E_OUTOFMEMORY;
699 
700  ident->is_var = TRUE;
701  ident->u.var = var;
702  *pid = ident_to_id(This, ident);
703  return S_OK;
704  }
705  }
706 
707  for(func = This->ctx->global_funcs; func; func = func->next) {
708  if(!wcsicmp(func->name, bstrName)) {
709  ident = add_ident(This, func->name);
710  if(!ident)
711  return E_OUTOFMEMORY;
712 
713  ident->is_var = FALSE;
714  ident->u.func = func;
715  *pid = ident_to_id(This, ident);
716  return S_OK;
717  }
718  }
719 
720  *pid = -1;
721  return DISP_E_UNKNOWNNAME;
722 }
723 
724 static HRESULT WINAPI ScriptDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
725  VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
726 {
729  HRESULT hres;
730 
731  TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
732 
733  ident = id_to_ident(This, id);
734  if(!ident)
735  return DISP_E_MEMBERNOTFOUND;
736 
737  if(ident->is_var) {
738  if(ident->u.var->is_const) {
739  FIXME("const not supported\n");
740  return E_NOTIMPL;
741  }
742 
743  return invoke_variant_prop(This->ctx, &ident->u.var->v, wFlags, pdp, pvarRes);
744  }
745 
746  switch(wFlags) {
747  case DISPATCH_METHOD:
749  hres = exec_script(This->ctx, TRUE, ident->u.func, NULL, pdp, pvarRes);
750  break;
751  default:
752  FIXME("Unsupported flags %x\n", wFlags);
753  hres = E_NOTIMPL;
754  }
755 
756  return hres;
757 }
758 
759 static HRESULT WINAPI ScriptDisp_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
760 {
762  FIXME("(%p)->(%s %x)\n", This, debugstr_w(bstrName), grfdex);
763  return E_NOTIMPL;
764 }
765 
766 static HRESULT WINAPI ScriptDisp_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
767 {
769  FIXME("(%p)->(%x)\n", This, id);
770  return E_NOTIMPL;
771 }
772 
773 static HRESULT WINAPI ScriptDisp_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
774 {
776  FIXME("(%p)->(%x %x %p)\n", This, id, grfdexFetch, pgrfdex);
777  return E_NOTIMPL;
778 }
779 
780 static HRESULT WINAPI ScriptDisp_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
781 {
783  FIXME("(%p)->(%x %p)\n", This, id, pbstrName);
784  return E_NOTIMPL;
785 }
786 
787 static HRESULT WINAPI ScriptDisp_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
788 {
790  FIXME("(%p)->(%x %x %p)\n", This, grfdex, id, pid);
791  return E_NOTIMPL;
792 }
793 
794 static HRESULT WINAPI ScriptDisp_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
795 {
797  FIXME("(%p)->(%p)\n", This, ppunk);
798  return E_NOTIMPL;
799 }
800 
801 static IDispatchExVtbl ScriptDispVtbl = {
817 };
818 
820 {
822 
823  script_disp = heap_alloc_zero(sizeof(*script_disp));
824  if(!script_disp)
825  return E_OUTOFMEMORY;
826 
827  script_disp->IDispatchEx_iface.lpVtbl = &ScriptDispVtbl;
828  script_disp->ref = 1;
829  script_disp->ctx = ctx;
830 
831  *ret = script_disp;
832  return S_OK;
833 }
834 
836 {
837  vbdisp_t *iter, *iter2;
838 
839  LIST_FOR_EACH_ENTRY_SAFE(iter, iter2, &ctx->objects, vbdisp_t, entry)
840  run_terminator(iter);
841 
842  while(!list_empty(&ctx->objects)) {
843  iter = LIST_ENTRY(list_head(&ctx->objects), vbdisp_t, entry);
844 
845  IDispatchEx_AddRef(&iter->IDispatchEx_iface);
846  clean_props(iter);
847  iter->desc = NULL;
848  list_remove(&iter->entry);
849  list_init(&iter->entry);
850  IDispatchEx_Release(&iter->IDispatchEx_iface);
851  }
852 }
853 
855 {
856  IDispatchEx *dispex;
857  vbdisp_t *vbdisp;
858  HRESULT hres;
859 
861  if(vbdisp)
862  return vbdisp_get_id(vbdisp, name, invoke_type, search_private, id);
863 
864  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
865  if(FAILED(hres)) {
866  TRACE("using IDispatch\n");
867  return IDispatch_GetIDsOfNames(disp, &IID_NULL, &name, 1, 0, id);
868  }
869 
870  hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseInsensitive, id);
871  IDispatchEx_Release(dispex);
872  return hres;
873 }
874 
875 #define RPC_E_SERVER_UNAVAILABLE 0x800706ba
876 
878 {
880  return hres;
881 
882  switch(hres) {
933  }
934 
935  return hres;
936 }
937 
939 {
940  const WORD flags = DISPATCH_METHOD|(retv ? DISPATCH_PROPERTYGET : 0);
941  IDispatchEx *dispex;
942  vbdisp_t *vbdisp;
943  EXCEPINFO ei;
944  HRESULT hres;
945 
946  memset(&ei, 0, sizeof(ei));
947  if(retv)
948  V_VT(retv) = VT_EMPTY;
949 
951  if(vbdisp && vbdisp->desc && vbdisp->desc->ctx == ctx)
952  return invoke_vbdisp(vbdisp, id, flags, FALSE, dp, retv);
953 
954  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
955  if(FAILED(hres)) {
956  UINT err = 0;
957 
958  TRACE("using IDispatch\n");
959  return IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, retv, &ei, &err);
960  }
961 
962  hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, retv, &ei, NULL /* CALLER_FIXME */);
963  IDispatchEx_Release(dispex);
964  return hres;
965 }
966 
968 {
969  DISPPARAMS dp = {NULL};
970  if(!disp)
972  return disp_call(ctx, disp, DISPID_VALUE, &dp, v);
973 }
974 
976 {
977  IDispatchEx *dispex;
978  vbdisp_t *vbdisp;
979  EXCEPINFO ei = {0};
980  HRESULT hres;
981 
983  if(vbdisp && vbdisp->desc && vbdisp->desc->ctx == ctx)
984  return invoke_vbdisp(vbdisp, id, flags, FALSE, dp, NULL);
985 
986  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
987  if(SUCCEEDED(hres)) {
988  hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, NULL, &ei, NULL /* FIXME! */);
989  IDispatchEx_Release(dispex);
990  }else {
991  ULONG err = 0;
992 
993  TRACE("using IDispatch\n");
994  hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, NULL, &ei, &err);
995  }
996 
997  return hres;
998 }
static HRESULT invoke_variant_prop(script_ctx_t *ctx, VARIANT *v, WORD flags, DISPPARAMS *dp, VARIANT *res)
Definition: vbdisp.c:116
const char * var
Definition: shader.c:5666
#define DISP_E_EXCEPTION
Definition: winerror.h:2518
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: vbdisp.c:276
GLenum func
Definition: glext.h:6028
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define VBSE_NAMED_PARAM_NOT_FOUND
disp
Definition: i386-dis.c:3181
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3835
#define E_ACCESSDENIED
Definition: winerror.h:2849
static DISPID ident_to_id(ScriptDisp *This, ident_map_t *ident)
Definition: vbdisp.c:538
#define VBSE_PATH_FILE_ACCESS
#define REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define VBSE_OLE_NO_PROP_OR_METHOD
#define STG_E_INVALIDNAME
Definition: winerror.h:2584
#define STG_E_WRITEFAULT
Definition: winerror.h:2575
#define E_NOINTERFACE
Definition: winerror.h:2364
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
static HRESULT WINAPI DispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
Definition: vbdisp.c:424
static HRESULT WINAPI ScriptDisp_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbdisp.c:636
#define CO_E_APPDIDNTREG
Definition: winerror.h:2817
vbdisp_invoke_type_t
Definition: vbscript.h:71
#define VBSE_CANT_CREATE_OBJECT
REFIID riid
Definition: precomp.h:44
#define VBSE_LOCALE_SETTING_NOT_SUPPORTED
#define STG_E_NOTCURRENT
Definition: winerror.h:2589
static ULONG WINAPI ScriptDisp_Release(IDispatchEx *iface)
Definition: vbdisp.c:610
static HRESULT WINAPI ScriptDisp_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
Definition: vbdisp.c:794
WINE_DEFAULT_DEBUG_CHANNEL(vbscript)
struct list objects
Definition: vbscript.h:202
#define WARN(fmt,...)
Definition: debug.h:112
#define CO_E_SERVER_EXEC_FAILURE
Definition: winerror.h:2860
void collect_objects(script_ctx_t *ctx)
Definition: vbdisp.c:835
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:847
#define VBSE_TOO_MANY_FILES
#define FDEX_VERSION_MASK
Definition: vbdisp.c:27
#define assert(x)
Definition: debug.h:53
#define STG_E_NOMOREFILES
Definition: winerror.h:2572
script_ctx_t * ctx
Definition: vbscript.h:98
#define VBSE_OLE_FILE_NOT_FOUND
#define STG_E_MEDIUMFULL
Definition: winerror.h:2581
BOOL is_var
Definition: vbdisp.c:531
#define VBSE_DISK_FULL
#define STG_E_INSUFFICIENTMEMORY
Definition: winerror.h:2570
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1943
HRESULT get_disp_value(script_ctx_t *ctx, IDispatch *disp, VARIANT *v)
Definition: vbdisp.c:967
#define VBSE_TYPE_MISMATCH
#define STG_E_TOOMANYOPENFILES
Definition: winerror.h:2567
const WCHAR * name
Definition: vbdisp.c:530
static LPOLESTR
Definition: stg_prop.c:27
HRESULT disp_get_id(IDispatch *disp, BSTR name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
Definition: vbdisp.c:854
Definition: send.c:48
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
#define DISP_E_ARRAYISLOCKED
Definition: winerror.h:2522
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define VBSE_ILLEGAL_FUNC_CALL
static HRESULT invoke_vbdisp(vbdisp_t *This, DISPID id, DWORD flags, BOOL extern_caller, DISPPARAMS *params, VARIANT *res)
Definition: vbdisp.c:164
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
#define V_DISPATCH(A)
Definition: oleauto.h:239
static HRESULT WINAPI ScriptDisp_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
Definition: vbdisp.c:773
static ULONG WINAPI DispatchEx_AddRef(IDispatchEx *iface)
Definition: vbdisp.c:299
static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: vbdisp.c:366
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
static HRESULT WINAPI DispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
Definition: vbdisp.c:326
#define STG_E_INUSE
Definition: winerror.h:2588
HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
Definition: vbdisp.c:470
LONG ref
Definition: vbscript.h:119
static HRESULT WINAPI DispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: vbdisp.c:336
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
HRESULT create_script_disp(script_ctx_t *ctx, ScriptDisp **ret)
Definition: vbdisp.c:819
GLenum const GLfloat * params
Definition: glext.h:5645
#define VBSE_INVALID_TYPELIB_VARIABLE
#define STG_E_ACCESSDENIED
Definition: winerror.h:2568
#define STG_E_PATHNOTFOUND
Definition: winerror.h:2566
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static IDispatchExVtbl ScriptDispVtbl
Definition: vbdisp.c:801
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
static const WCHAR desc[]
Definition: protectdata.c:36
static HRESULT get_propput_arg(script_ctx_t *ctx, const DISPPARAMS *dp, WORD flags, VARIANT *v, BOOL *is_owned)
Definition: vbdisp.c:80
#define debugstr_w
Definition: kernel32.h:32
GLenum GLint ref
Definition: glext.h:6028
#define FIXME(fmt,...)
Definition: debug.h:111
#define V_ARRAYREF(A)
Definition: oleauto.h:223
static HRESULT WINAPI DispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
Definition: vbdisp.c:417
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DISP_E_NONAMEDARGS
Definition: winerror.h:2516
#define TYPE_E_OUTOFBOUNDS
Definition: winerror.h:2549
smooth NULL
Definition: ftsmooth.c:416
static HRESULT WINAPI DispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
Definition: vbdisp.c:403
static HRESULT WINAPI ScriptDisp_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbdisp.c:663
#define VBSE_PERMISSION_DENIED
#define DISP_E_UNKNOWNLCID
Definition: winerror.h:2521
#define VBSE_NAMED_ARGS_NOT_SUPPORTED
#define debugstr_guid
Definition: kernel32.h:35
#define DISPATCH_PROPERTYPUT
Definition: oleauto.h:1008
#define VBSE_PATH_NOT_FOUND
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
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
_In_ ULONG _In_ ULONG_PTR ident
Definition: winddi.h:3993
#define MK_E_INVALIDEXTENSION
Definition: winerror.h:2787
#define MK_E_CANTOPENFILE
Definition: winerror.h:2791
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
#define TYPE_E_DLLFUNCTIONNOTFOUND
Definition: winerror.h:2543
#define VBSE_FILE_ALREADY_EXISTS
#define STG_E_SHAREVIOLATION
Definition: winerror.h:2577
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
Definition: vbdisp.c:438
#define TYPE_E_TYPEMISMATCH
Definition: winerror.h:2548
__wchar_t WCHAR
Definition: xmlstorage.h:180
static void clean_props(vbdisp_t *This)
Definition: vbdisp.c:253
static HRESULT WINAPI ScriptDisp_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
Definition: vbdisp.c:780
static HRESULT WINAPI DispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbdisp.c:344
LONG HRESULT
Definition: typedefs.h:78
static ScriptDisp * ScriptDisp_from_IDispatchEx(IDispatchEx *iface)
Definition: vbdisp.c:572
#define STG_E_FILEALREADYEXISTS
Definition: winerror.h:2579
#define VBSE_OUT_OF_BOUNDS
const GUID IID_IUnknown
struct _vbdisp_t vbdisp_t
Definition: vbscript.h:61
#define WINAPI
Definition: msvc.h:6
static HRESULT WINAPI ScriptDisp_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
Definition: vbdisp.c:759
static HRESULT WINAPI ScriptDisp_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo)
Definition: vbdisp.c:626
unsigned short WORD
Definition: ntddk_ex.h:93
static BOOL get_func_id(vbdisp_t *This, const WCHAR *name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
Definition: vbdisp.c:34
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DISP_E_UNKNOWNINTERFACE
Definition: winerror.h:2511
#define VBSE_FILE_NOT_FOUND
GLbitfield flags
Definition: glext.h:7161
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
static ULONG WINAPI ScriptDisp_AddRef(IDispatchEx *iface)
Definition: vbdisp.c:600
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:117
union _ident_map_t::@574 u
const GUID IID_IDispatch
#define VBSE_FUNC_ARITY_MISMATCH
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
int ret
#define VBSE_CANT_CREATE_TMP_FILE
#define STG_E_FILENOTFOUND
Definition: winerror.h:2565
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
static IDispatchExVtbl DispatchExVtbl
Definition: vbdisp.c:445
#define IID_NULL
Definition: guiddef.h:98
#define InterlockedDecrement
Definition: armddk.h:52
static HRESULT WINAPI ScriptDisp_GetIDsOfNames(IDispatchEx *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: vbdisp.c:644
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:2524
#define V_VT(A)
Definition: oleauto.h:211
uint32_t entry
Definition: isohybrid.c:63
#define VBSE_ARRAY_LOCKED
#define err(...)
static vbdisp_t * impl_from_IDispatchEx(IDispatchEx *iface)
Definition: vbdisp.c:271
#define wcsicmp
Definition: string.h:1152
#define DISPATCH_PROPERTYPUTREF
Definition: oleauto.h:1009
dynamic_var_t * var
Definition: vbdisp.c:533
VARIANT props[1]
Definition: vbscript.h:125
#define VBSE_NOT_ENUM
static IDispatch * script_disp
Definition: run.c:178
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:534
static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
Definition: vbdisp.c:431
#define VBSE_OUT_OF_MEMORY
static HRESULT WINAPI ScriptDisp_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
Definition: vbdisp.c:787
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
static ULONG WINAPI DispatchEx_Release(IDispatchEx *iface)
Definition: vbdisp.c:309
#define VBSE_INVALID_DLL_FUNCTION_NAME
struct stdole::EXCEPINFO EXCEPINFO
const class_desc_t * desc
Definition: vbscript.h:123
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
static unsigned arg_cnt(const DISPPARAMS *dp)
Definition: vbscript.h:162
#define STG_E_DISKISWRITEPROTECTED
Definition: winerror.h:2573
HRESULT vbdisp_get_id(vbdisp_t *This, BSTR name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
Definition: vbdisp.c:59
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define STG_E_LOCKVIOLATION
Definition: winerror.h:2578
HRESULT exec_script(HTMLInnerWindow *, const WCHAR *, const WCHAR *, VARIANT *) DECLSPEC_HIDDEN
Definition: script.c:1245
static HRESULT WINAPI DispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: vbdisp.c:410
static HRESULT WINAPI ScriptDisp_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
Definition: vbdisp.c:675
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
#define InterlockedIncrement
Definition: armddk.h:53
const GLdouble * v
Definition: gl.h:2040
#define MAKE_VBSERROR(code)
Definition: vbscript.h:379
#define VBSE_OBJECT_VARIABLE_NOT_SET
struct list entry
Definition: vbscript.h:121
#define VBSE_OLE_NOT_SUPPORTED
#define E_NOTIMPL
Definition: ddrawi.h:99
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
#define STG_E_READFAULT
Definition: winerror.h:2576
#define TYPE_E_IOERROR
Definition: winerror.h:2550
unsigned int UINT
Definition: ndis.h:50
static HRESULT WINAPI ScriptDisp_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: vbdisp.c:724
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static ident_map_t * add_ident(ScriptDisp *This, const WCHAR *name)
Definition: vbdisp.c:548
#define DISP_E_BADPARAMCOUNT
Definition: winerror.h:2523
static HRESULT WINAPI ScriptDisp_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
Definition: vbdisp.c:577
#define E_UNEXPECTED
Definition: winerror.h:2456
#define MK_E_UNAVAILABLE
Definition: winerror.h:2784
Definition: name.c:38
HRESULT map_hres(HRESULT hres)
Definition: vbdisp.c:877
static const WCHAR props[]
Definition: wbemdisp.c:288
GLuint res
Definition: glext.h:9613
struct stdole::DISPPARAMS DISPPARAMS
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define FACILITY_VBS
Definition: vbscript.h:378
#define VBSE_OVERFLOW
#define DISP_E_NOTACOLLECTION
Definition: winerror.h:2526
#define TYPE_E_CANTCREATETMPFILE
Definition: winerror.h:2551
unsigned int ULONG
Definition: retypes.h:1
GLenum GLuint id
Definition: glext.h:5579
function_t * func
Definition: vbdisp.c:534
#define VBSE_PARAMETER_NOT_OPTIONAL
#define VBSE_IO_ERROR
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
static ident_map_t * id_to_ident(ScriptDisp *This, DISPID id)
Definition: vbdisp.c:543
static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: vbdisp.c:354
#define DISP_E_BADINDEX
Definition: winerror.h:2520
#define CO_E_APPNOTFOUND
Definition: winerror.h:2808
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define LIST_ENTRY(type)
Definition: queue.h:175
#define STG_E_CANTSAVE
Definition: winerror.h:2591
#define memset(x, y, z)
Definition: compat.h:39
#define DISP_E_OVERFLOW
Definition: winerror.h:2519
#define VBSE_ACTION_NOT_SUPPORTED
HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp, VARIANT *retv)
Definition: vbdisp.c:938
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define RPC_E_SERVER_UNAVAILABLE
Definition: vbdisp.c:875
HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *dp)
Definition: vbdisp.c:975
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static BOOL is_func_id(vbdisp_t *This, DISPID id)
Definition: vbdisp.c:29
static BOOL run_terminator(vbdisp_t *This)
Definition: vbdisp.c:236
static HRESULT WINAPI ScriptDisp_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
Definition: vbdisp.c:766
SAFEARRAY ** arrays
Definition: vbscript.h:124
static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
Definition: vbdisp.c:387
GLuint const GLchar * name
Definition: glext.h:6031
static vbdisp_t * unsafe_impl_from_IDispatch(IDispatch *iface)
Definition: vbdisp.c:463
#define VBSE_SERVER_NOT_FOUND