ReactOS  0.4.14-dev-317-g96040ec
vbscript.h File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ole2.h"
#include "dispex.h"
#include "activscp.h"
#include "activdbg.h"
#include "vbscript_classes.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/unicode.h"
Include dependency graph for vbscript.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  heap_pool_t
 
struct  named_item_t
 
struct  array_desc_t
 
struct  vbdisp_prop_desc_t
 
struct  vbdisp_funcprop_desc_t
 
struct  builtin_prop_t
 
struct  _class_desc_t
 
struct  _vbdisp_t
 
struct  ScriptDisp
 
struct  _dynamic_var_t
 
struct  _script_ctx_t
 
union  instr_arg_t
 
struct  instr_t
 
struct  arg_desc_t
 
struct  var_desc_t
 
struct  _function_t
 
struct  _vbscode_t
 
struct  string_constant_t
 

Macros

#define COBJMACROS
 
#define BP_GET   1
 
#define BP_GETPUT   2
 
#define OP_LIST
 
#define X(x, n, a, b)   OP_##x,
 
#define TID_LIST
 
#define XDIID(iface)   iface ## _tid,
 
#define INT32_MIN   (-2147483647-1)
 
#define INT32_MAX   (2147483647)
 
#define FACILITY_VBS   0xa
 
#define MAKE_VBSERROR(code)   MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code)
 
#define VBSE_ILLEGAL_FUNC_CALL   5
 
#define VBSE_OVERFLOW   6
 
#define VBSE_OUT_OF_MEMORY   7
 
#define VBSE_OUT_OF_BOUNDS   9
 
#define VBSE_ARRAY_LOCKED   10
 
#define VBSE_TYPE_MISMATCH   13
 
#define VBSE_FILE_NOT_FOUND   53
 
#define VBSE_IO_ERROR   57
 
#define VBSE_FILE_ALREADY_EXISTS   58
 
#define VBSE_DISK_FULL   61
 
#define VBSE_TOO_MANY_FILES   67
 
#define VBSE_PERMISSION_DENIED   70
 
#define VBSE_PATH_FILE_ACCESS   75
 
#define VBSE_PATH_NOT_FOUND   76
 
#define VBSE_ILLEGAL_NULL_USE   94
 
#define VBSE_OLE_NOT_SUPPORTED   430
 
#define VBSE_OLE_NO_PROP_OR_METHOD   438
 
#define VBSE_ACTION_NOT_SUPPORTED   445
 
#define VBSE_NAMED_ARGS_NOT_SUPPORTED   446
 
#define VBSE_LOCALE_SETTING_NOT_SUPPORTED   447
 
#define VBSE_NAMED_PARAM_NOT_FOUND   448
 
#define VBSE_INVALID_TYPELIB_VARIABLE   458
 
#define VBSE_FUNC_ARITY_MISMATCH   450
 
#define VBSE_PARAMETER_NOT_OPTIONAL   449
 
#define VBSE_NOT_ENUM   451
 
#define VBSE_INVALID_DLL_FUNCTION_NAME   453
 
#define VBSE_CANT_CREATE_TMP_FILE   322
 
#define VBSE_OLE_FILE_NOT_FOUND   432
 
#define VBSE_CANT_CREATE_OBJECT   429
 
#define VBSE_SERVER_NOT_FOUND   462
 
#define VBSCRIPT_BUILD_VERSION   16978
 
#define VBSCRIPT_MAJOR_VERSION   5
 
#define VBSCRIPT_MINOR_VERSION   8
 

Typedefs

typedef struct _function_t function_t
 
typedef struct _vbscode_t vbscode_t
 
typedef struct _script_ctx_t script_ctx_t
 
typedef struct _vbdisp_t vbdisp_t
 
typedef struct named_item_t named_item_t
 
typedef struct _class_desc_t class_desc_t
 
typedef struct _ident_map_t ident_map_t
 
typedef struct _dynamic_var_t dynamic_var_t
 

Enumerations

enum  vbdisp_invoke_type_t { VBDISP_CALLGET, VBDISP_LET, VBDISP_SET, VBDISP_ANY }
 
enum  instr_arg_type_t {
  ARG_NONE = 0, ARG_ADDR, ARG_BSTR, ARG_DBL,
  ARG_FUNC, ARG_INT, ARG_STR, ARG_UINT,
  ARG_NONE = 0, ARG_STR, ARG_BSTR, ARG_INT,
  ARG_UINT, ARG_ADDR, ARG_DOUBLE
}
 
enum  vbsop_t { OP_LAST }
 
enum  function_type_t {
  FUNC_GLOBAL, FUNC_FUNCTION, FUNC_SUB, FUNC_PROPGET,
  FUNC_PROPLET, FUNC_PROPSET, FUNC_DEFGET
}
 
enum  tid_t {
  LAST_tid, LAST_tid, Database_tid, Installer_tid,
  Record_tid, Session_tid, StringList_tid, SummaryInfo_tid,
  View_tid, LAST_tid, NULL_tid, IXMLDOMAttribute_tid,
  IXMLDOMCDATASection_tid, IXMLDOMComment_tid, IXMLDOMDocument_tid, IXMLDOMDocument2_tid,
  IXMLDOMDocument3_tid, IXMLDOMDocumentFragment_tid, IXMLDOMDocumentType_tid, IXMLDOMElement_tid,
  IXMLDOMEntityReference_tid, IXMLDOMImplementation_tid, IXMLDOMNamedNodeMap_tid, IXMLDOMNode_tid,
  IXMLDOMNodeList_tid, IXMLDOMParseError2_tid, IXMLDOMProcessingInstruction_tid, IXMLDOMSchemaCollection_tid,
  IXMLDOMSchemaCollection2_tid, IXMLDOMSelection_tid, IXMLDOMText_tid, IXMLElement_tid,
  IXMLDocument_tid, IXMLHTTPRequest_tid, IXSLProcessor_tid, IXSLTemplate_tid,
  IVBSAXAttributes_tid, IVBSAXContentHandler_tid, IVBSAXDeclHandler_tid, IVBSAXDTDHandler_tid,
  IVBSAXEntityResolver_tid, IVBSAXErrorHandler_tid, IVBSAXLexicalHandler_tid, IVBSAXLocator_tid,
  IVBSAXXMLFilter_tid, IVBSAXXMLReader_tid, IMXAttributes_tid, IMXReaderControl_tid,
  IMXWriter_tid, IVBMXNamespaceManager_tid, IServerXMLHTTPRequest_tid, LAST_tid,
  NULL_tid, ITextDocument_tid, ITextRange_tid, ITextSelection_tid,
  ITextFont_tid, ITextPara_tid, LAST_tid, NULL_tid,
  IDictionary_tid, IDrive_tid, IDriveCollection_tid, IFile_tid,
  IFileCollection_tid, IFileSystem3_tid, IFolder_tid, IFolderCollection_tid,
  ITextStream_tid, LAST_tid, LAST_tid, NULL_tid,
  IWshCollection_tid, IWshEnvironment_tid, IWshExec_tid, IWshShell3_tid,
  IWshShortcut_tid, LAST_tid
}
 

Functions

void heap_pool_init (heap_pool_t *) DECLSPEC_HIDDEN
 
voidheap_pool_alloc (heap_pool_t *, size_t) __WINE_ALLOC_SIZE(2) DECLSPEC_HIDDEN
 
voidheap_pool_grow (heap_pool_t *, void *, DWORD, DWORD) DECLSPEC_HIDDEN
 
void heap_pool_clear (heap_pool_t *) DECLSPEC_HIDDEN
 
void heap_pool_free (heap_pool_t *) DECLSPEC_HIDDEN
 
heap_pool_theap_pool_mark (heap_pool_t *) DECLSPEC_HIDDEN
 
HRESULT create_vbdisp (const class_desc_t *, vbdisp_t **) DECLSPEC_HIDDEN
 
HRESULT disp_get_id (IDispatch *, BSTR, vbdisp_invoke_type_t, BOOL, DISPID *) DECLSPEC_HIDDEN
 
HRESULT vbdisp_get_id (vbdisp_t *, BSTR, vbdisp_invoke_type_t, BOOL, DISPID *) DECLSPEC_HIDDEN
 
HRESULT disp_call (script_ctx_t *, IDispatch *, DISPID, DISPPARAMS *, VARIANT *) DECLSPEC_HIDDEN
 
HRESULT disp_propput (script_ctx_t *, IDispatch *, DISPID, WORD, DISPPARAMS *) DECLSPEC_HIDDEN
 
HRESULT get_disp_value (script_ctx_t *, IDispatch *, VARIANT *) DECLSPEC_HIDDEN
 
void collect_objects (script_ctx_t *) DECLSPEC_HIDDEN
 
HRESULT create_procedure_disp (script_ctx_t *, vbscode_t *, IDispatch **) DECLSPEC_HIDDEN
 
HRESULT create_script_disp (script_ctx_t *, ScriptDisp **) DECLSPEC_HIDDEN
 
HRESULT to_int (VARIANT *, int *) DECLSPEC_HIDDEN
 
static unsigned arg_cnt (const DISPPARAMS *dp)
 
static VARIANTget_arg (DISPPARAMS *dp, DWORD i)
 
HRESULT init_global (script_ctx_t *) DECLSPEC_HIDDEN
 
HRESULT init_err (script_ctx_t *) DECLSPEC_HIDDEN
 
IUnknowncreate_ax_site (script_ctx_t *) DECLSPEC_HIDDEN
 
void release_vbscode (vbscode_t *) DECLSPEC_HIDDEN
 
HRESULT compile_script (script_ctx_t *, const WCHAR *, const WCHAR *, vbscode_t **) DECLSPEC_HIDDEN
 
HRESULT exec_script (script_ctx_t *, function_t *, vbdisp_t *, DISPPARAMS *, VARIANT *) DECLSPEC_HIDDEN
 
void release_dynamic_vars (dynamic_var_t *) DECLSPEC_HIDDEN
 
IDispatchlookup_named_item (script_ctx_t *, const WCHAR *, unsigned) DECLSPEC_HIDDEN
 
HRESULT get_typeinfo (tid_t, ITypeInfo **) DECLSPEC_HIDDEN
 
void release_regexp_typelib (void) DECLSPEC_HIDDEN
 
static BOOL is_int32 (double d)
 
HRESULT create_regexp (IDispatch **) DECLSPEC_HIDDEN
 
HRESULT map_hres (HRESULT) DECLSPEC_HIDDEN
 
HRESULT create_safearray_iter (SAFEARRAY *sa, IEnumVARIANT **ev) DECLSPEC_HIDDEN
 
HRESULT WINAPI VBScriptFactory_CreateInstance (IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
 
HRESULT WINAPI VBScriptRegExpFactory_CreateInstance (IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
 
static LPWSTR heap_strdupW (LPCWSTR str)
 

Macro Definition Documentation

◆ BP_GET

#define BP_GET   1

Definition at line 95 of file vbscript.h.

◆ BP_GETPUT

#define BP_GETPUT   2

Definition at line 96 of file vbscript.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file vbscript.h.

◆ FACILITY_VBS

#define FACILITY_VBS   0xa

Definition at line 405 of file vbscript.h.

◆ INT32_MAX

#define INT32_MAX   (2147483647)

Definition at line 391 of file vbscript.h.

◆ INT32_MIN

#define INT32_MIN   (-2147483647-1)

Definition at line 387 of file vbscript.h.

◆ MAKE_VBSERROR

#define MAKE_VBSERROR (   code)    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code)

Definition at line 406 of file vbscript.h.

◆ OP_LIST

#define OP_LIST

Definition at line 229 of file vbscript.h.

◆ TID_LIST

#define TID_LIST
Value:
XDIID(ErrObj) \
XDIID(GlobalObj)
#define XDIID(iface)
Definition: vbscript.h:377

Definition at line 372 of file vbscript.h.

◆ VBSCRIPT_BUILD_VERSION

#define VBSCRIPT_BUILD_VERSION   16978

Definition at line 458 of file vbscript.h.

◆ VBSCRIPT_MAJOR_VERSION

#define VBSCRIPT_MAJOR_VERSION   5

Definition at line 459 of file vbscript.h.

◆ VBSCRIPT_MINOR_VERSION

#define VBSCRIPT_MINOR_VERSION   8

Definition at line 460 of file vbscript.h.

◆ VBSE_ACTION_NOT_SUPPORTED

#define VBSE_ACTION_NOT_SUPPORTED   445

Definition at line 425 of file vbscript.h.

◆ VBSE_ARRAY_LOCKED

#define VBSE_ARRAY_LOCKED   10

Definition at line 412 of file vbscript.h.

◆ VBSE_CANT_CREATE_OBJECT

#define VBSE_CANT_CREATE_OBJECT   429

Definition at line 436 of file vbscript.h.

◆ VBSE_CANT_CREATE_TMP_FILE

#define VBSE_CANT_CREATE_TMP_FILE   322

Definition at line 434 of file vbscript.h.

◆ VBSE_DISK_FULL

#define VBSE_DISK_FULL   61

Definition at line 417 of file vbscript.h.

◆ VBSE_FILE_ALREADY_EXISTS

#define VBSE_FILE_ALREADY_EXISTS   58

Definition at line 416 of file vbscript.h.

◆ VBSE_FILE_NOT_FOUND

#define VBSE_FILE_NOT_FOUND   53

Definition at line 414 of file vbscript.h.

◆ VBSE_FUNC_ARITY_MISMATCH

#define VBSE_FUNC_ARITY_MISMATCH   450

Definition at line 430 of file vbscript.h.

◆ VBSE_ILLEGAL_FUNC_CALL

#define VBSE_ILLEGAL_FUNC_CALL   5

Definition at line 408 of file vbscript.h.

◆ VBSE_ILLEGAL_NULL_USE

#define VBSE_ILLEGAL_NULL_USE   94

Definition at line 422 of file vbscript.h.

◆ VBSE_INVALID_DLL_FUNCTION_NAME

#define VBSE_INVALID_DLL_FUNCTION_NAME   453

Definition at line 433 of file vbscript.h.

◆ VBSE_INVALID_TYPELIB_VARIABLE

#define VBSE_INVALID_TYPELIB_VARIABLE   458

Definition at line 429 of file vbscript.h.

◆ VBSE_IO_ERROR

#define VBSE_IO_ERROR   57

Definition at line 415 of file vbscript.h.

◆ VBSE_LOCALE_SETTING_NOT_SUPPORTED

#define VBSE_LOCALE_SETTING_NOT_SUPPORTED   447

Definition at line 427 of file vbscript.h.

◆ VBSE_NAMED_ARGS_NOT_SUPPORTED

#define VBSE_NAMED_ARGS_NOT_SUPPORTED   446

Definition at line 426 of file vbscript.h.

◆ VBSE_NAMED_PARAM_NOT_FOUND

#define VBSE_NAMED_PARAM_NOT_FOUND   448

Definition at line 428 of file vbscript.h.

◆ VBSE_NOT_ENUM

#define VBSE_NOT_ENUM   451

Definition at line 432 of file vbscript.h.

◆ VBSE_OLE_FILE_NOT_FOUND

#define VBSE_OLE_FILE_NOT_FOUND   432

Definition at line 435 of file vbscript.h.

◆ VBSE_OLE_NO_PROP_OR_METHOD

#define VBSE_OLE_NO_PROP_OR_METHOD   438

Definition at line 424 of file vbscript.h.

◆ VBSE_OLE_NOT_SUPPORTED

#define VBSE_OLE_NOT_SUPPORTED   430

Definition at line 423 of file vbscript.h.

◆ VBSE_OUT_OF_BOUNDS

#define VBSE_OUT_OF_BOUNDS   9

Definition at line 411 of file vbscript.h.

◆ VBSE_OUT_OF_MEMORY

#define VBSE_OUT_OF_MEMORY   7

Definition at line 410 of file vbscript.h.

◆ VBSE_OVERFLOW

#define VBSE_OVERFLOW   6

Definition at line 409 of file vbscript.h.

◆ VBSE_PARAMETER_NOT_OPTIONAL

#define VBSE_PARAMETER_NOT_OPTIONAL   449

Definition at line 431 of file vbscript.h.

◆ VBSE_PATH_FILE_ACCESS

#define VBSE_PATH_FILE_ACCESS   75

Definition at line 420 of file vbscript.h.

◆ VBSE_PATH_NOT_FOUND

#define VBSE_PATH_NOT_FOUND   76

Definition at line 421 of file vbscript.h.

◆ VBSE_PERMISSION_DENIED

#define VBSE_PERMISSION_DENIED   70

Definition at line 419 of file vbscript.h.

◆ VBSE_SERVER_NOT_FOUND

#define VBSE_SERVER_NOT_FOUND   462

Definition at line 437 of file vbscript.h.

◆ VBSE_TOO_MANY_FILES

#define VBSE_TOO_MANY_FILES   67

Definition at line 418 of file vbscript.h.

◆ VBSE_TYPE_MISMATCH

#define VBSE_TYPE_MISMATCH   13

Definition at line 413 of file vbscript.h.

◆ X

#define X (   x,
  n,
  a,
  b 
)    OP_##x,

Definition at line 289 of file vbscript.h.

◆ XDIID

#define XDIID (   iface)    iface ## _tid,

Definition at line 377 of file vbscript.h.

Typedef Documentation

◆ class_desc_t

◆ dynamic_var_t

◆ function_t

Definition at line 57 of file vbscript.h.

◆ ident_map_t

Definition at line 141 of file vbscript.h.

◆ named_item_t

◆ script_ctx_t

Definition at line 59 of file vbscript.h.

◆ vbdisp_t

Definition at line 60 of file vbscript.h.

◆ vbscode_t

Definition at line 58 of file vbscript.h.

Enumeration Type Documentation

◆ function_type_t

Enumerator
FUNC_GLOBAL 
FUNC_FUNCTION 
FUNC_SUB 
FUNC_PROPGET 
FUNC_PROPLET 
FUNC_PROPSET 
FUNC_DEFGET 

Definition at line 314 of file vbscript.h.

◆ instr_arg_type_t

Enumerator
ARG_NONE 
ARG_ADDR 
ARG_BSTR 
ARG_DBL 
ARG_FUNC 
ARG_INT 
ARG_STR 
ARG_UINT 
ARG_NONE 
ARG_STR 
ARG_BSTR 
ARG_INT 
ARG_UINT 
ARG_ADDR 
ARG_DOUBLE 

Definition at line 219 of file vbscript.h.

219  {
220  ARG_NONE = 0,
221  ARG_STR,
222  ARG_BSTR,
223  ARG_INT,
224  ARG_UINT,
225  ARG_ADDR,
226  ARG_DOUBLE
instr_arg_type_t
Definition: vbscript.h:219

◆ tid_t

Enumerator
LAST_tid 
LAST_tid 
Database_tid 
Installer_tid 
Record_tid 
Session_tid 
StringList_tid 
SummaryInfo_tid 
View_tid 
LAST_tid 
NULL_tid 
IXMLDOMAttribute_tid 
IXMLDOMCDATASection_tid 
IXMLDOMComment_tid 
IXMLDOMDocument_tid 
IXMLDOMDocument2_tid 
IXMLDOMDocument3_tid 
IXMLDOMDocumentFragment_tid 
IXMLDOMDocumentType_tid 
IXMLDOMElement_tid 
IXMLDOMEntityReference_tid 
IXMLDOMImplementation_tid 
IXMLDOMNamedNodeMap_tid 
IXMLDOMNode_tid 
IXMLDOMNodeList_tid 
IXMLDOMParseError2_tid 
IXMLDOMProcessingInstruction_tid 
IXMLDOMSchemaCollection_tid 
IXMLDOMSchemaCollection2_tid 
IXMLDOMSelection_tid 
IXMLDOMText_tid 
IXMLElement_tid 
IXMLDocument_tid 
IXMLHTTPRequest_tid 
IXSLProcessor_tid 
IXSLTemplate_tid 
IVBSAXAttributes_tid 
IVBSAXContentHandler_tid 
IVBSAXDeclHandler_tid 
IVBSAXDTDHandler_tid 
IVBSAXEntityResolver_tid 
IVBSAXErrorHandler_tid 
IVBSAXLexicalHandler_tid 
IVBSAXLocator_tid 
IVBSAXXMLFilter_tid 
IVBSAXXMLReader_tid 
IMXAttributes_tid 
IMXReaderControl_tid 
IMXWriter_tid 
IVBMXNamespaceManager_tid 
IServerXMLHTTPRequest_tid 
LAST_tid 
NULL_tid 
ITextDocument_tid 
ITextRange_tid 
ITextSelection_tid 
ITextFont_tid 
ITextPara_tid 
LAST_tid 
NULL_tid 
IDictionary_tid 
IDrive_tid 
IDriveCollection_tid 
IFile_tid 
IFileCollection_tid 
IFileSystem3_tid 
IFolder_tid 
IFolderCollection_tid 
ITextStream_tid 
LAST_tid 
LAST_tid 
NULL_tid 
IWshCollection_tid 
IWshEnvironment_tid 
IWshExec_tid 
IWshShell3_tid 
IWshShortcut_tid 
LAST_tid 

Definition at line 376 of file vbscript.h.

376  {
377 #define XDIID(iface) iface ## _tid,
378 TID_LIST
379 #undef XDIID
380  LAST_tid
381 } tid_t;
#define TID_LIST
Definition: vbscript.h:372
tid_t
Definition: vbscript.h:376

◆ vbdisp_invoke_type_t

Enumerator
VBDISP_CALLGET 
VBDISP_LET 
VBDISP_SET 
VBDISP_ANY 

Definition at line 70 of file vbscript.h.

◆ vbsop_t

Enumerator
OP_LAST 

Definition at line 288 of file vbscript.h.

288  {
289 #define X(x,n,a,b) OP_##x,
290 OP_LIST
291 #undef X
292  OP_LAST
293 } vbsop_t;
vbsop_t
Definition: vbscript.h:288
#define OP_LIST
Definition: vbscript.h:229

Function Documentation

◆ arg_cnt()

◆ collect_objects()

void collect_objects ( script_ctx_t )

Definition at line 975 of file vbdisp.c.

976 {
977  vbdisp_t *iter, *iter2;
978 
979  LIST_FOR_EACH_ENTRY_SAFE(iter, iter2, &ctx->objects, vbdisp_t, entry)
980  run_terminator(iter);
981 
982  while(!list_empty(&ctx->objects)) {
983  iter = LIST_ENTRY(list_head(&ctx->objects), vbdisp_t, entry);
984 
985  IDispatchEx_AddRef(&iter->IDispatchEx_iface);
986  clean_props(iter);
987  iter->desc = NULL;
988  list_remove(&iter->entry);
989  list_init(&iter->entry);
990  IDispatchEx_Release(&iter->IDispatchEx_iface);
991  }
992 }
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
smooth NULL
Definition: ftsmooth.c:416
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
static void clean_props(vbdisp_t *This)
Definition: vbdisp.c:268
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:130
uint32_t entry
Definition: isohybrid.c:63
const class_desc_t * desc
Definition: vbscript.h:136
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
struct list entry
Definition: vbscript.h:134
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define LIST_ENTRY(type)
Definition: queue.h:175
static BOOL run_terminator(vbdisp_t *This)
Definition: vbdisp.c:251

◆ compile_script()

HRESULT compile_script ( script_ctx_t ,
const WCHAR ,
const WCHAR ,
vbscode_t **   
)

Definition at line 1800 of file compile.c.

1801 {
1802  function_t *new_func;
1803  function_decl_t *func_decl;
1804  class_decl_t *class_decl;
1805  compile_ctx_t ctx;
1806  vbscode_t *code;
1807  HRESULT hres;
1808 
1809  hres = parse_script(&ctx.parser, src, delimiter);
1810  if(FAILED(hres))
1811  return hres;
1812 
1813  code = ctx.code = alloc_vbscode(&ctx, src);
1814  if(!ctx.code)
1815  return E_OUTOFMEMORY;
1816 
1817  ctx.funcs = NULL;
1818  ctx.func_decls = NULL;
1819  ctx.global_vars = NULL;
1820  ctx.classes = NULL;
1821  ctx.labels = NULL;
1822  ctx.global_consts = NULL;
1823  ctx.stat_ctx = NULL;
1824  ctx.labels_cnt = ctx.labels_size = 0;
1825 
1826  hres = compile_func(&ctx, ctx.parser.stats, &ctx.code->main_code);
1827  if(FAILED(hres)) {
1828  release_compiler(&ctx);
1829  return hres;
1830  }
1831 
1832  ctx.global_consts = ctx.const_decls;
1833 
1834  for(func_decl = ctx.func_decls; func_decl; func_decl = func_decl->next) {
1835  hres = create_function(&ctx, func_decl, &new_func);
1836  if(FAILED(hres)) {
1837  release_compiler(&ctx);
1838  return hres;
1839  }
1840 
1841  new_func->next = ctx.funcs;
1842  ctx.funcs = new_func;
1843  }
1844 
1845  for(class_decl = ctx.parser.class_decls; class_decl; class_decl = class_decl->next) {
1846  hres = compile_class(&ctx, class_decl);
1847  if(FAILED(hres)) {
1848  release_compiler(&ctx);
1849  return hres;
1850  }
1851  }
1852 
1854  if(FAILED(hres)) {
1855  release_compiler(&ctx);
1856  return hres;
1857  }
1858 
1859  if(ctx.global_vars) {
1860  dynamic_var_t *var;
1861 
1862  for(var = ctx.global_vars; var->next; var = var->next);
1863 
1864  var->next = script->global_vars;
1865  script->global_vars = ctx.global_vars;
1866  }
1867 
1868  if(ctx.funcs) {
1869  for(new_func = ctx.funcs; new_func->next; new_func = new_func->next);
1870 
1871  new_func->next = script->global_funcs;
1872  script->global_funcs = ctx.funcs;
1873  }
1874 
1875  if(ctx.classes) {
1876  class_desc_t *class = ctx.classes;
1877 
1878  while(1) {
1879  class->ctx = script;
1880  if(!class->next)
1881  break;
1882  class = class->next;
1883  }
1884 
1885  class->next = script->classes;
1886  script->classes = ctx.classes;
1887  }
1888 
1889  if(TRACE_ON(vbscript_disas))
1890  dump_code(&ctx);
1891 
1892  ctx.code = NULL;
1893  release_compiler(&ctx);
1894 
1895  list_add_tail(&script->code_list, &code->entry);
1896  *ret = code;
1897  return S_OK;
1898 }
unsigned * labels
Definition: compile.c:48
unsigned labels_cnt
Definition: compile.c:50
const_decl_t * global_consts
Definition: compile.c:61
struct _class_decl_t * next
Definition: parse.h:187
struct _function_decl_t * next
Definition: parse.h:174
statement_ctx_t * stat_ctx
Definition: compile.c:46
script_ctx_t * ctx
Definition: vbscript.h:108
vbscode_t * code
Definition: compile.c:44
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
parser_ctx_t parser
Definition: compile.c:40
smooth NULL
Definition: ftsmooth.c:416
const char * delimiter
Definition: string.c:1566
static HRESULT compile_func(compile_ctx_t *ctx, statement_t *stat, function_t *func)
Definition: compile.c:1327
script
Definition: msipriv.h:374
struct _dynamic_var_t * next
Definition: vbscript.h:177
HRESULT hres
Definition: protocol.c:465
function_t main_code
Definition: vbscript.h:350
LONG HRESULT
Definition: typedefs.h:77
dynamic_var_t * global_vars
Definition: compile.c:58
static vbscode_t * alloc_vbscode(compile_ctx_t *ctx, const WCHAR *source)
Definition: compile.c:1759
const_decl_t * const_decls
Definition: compile.c:60
int ret
static HRESULT compile_class(compile_ctx_t *ctx, class_decl_t *class_decl)
Definition: compile.c:1573
function_t * next
Definition: vbscript.h:340
static void release_compiler(compile_ctx_t *ctx)
Definition: compile.c:1792
GLenum src
Definition: glext.h:6340
int code
Definition: i386-dis.c:3591
unsigned labels_size
Definition: compile.c:49
#define S_OK
Definition: intsafe.h:59
static unsigned __int64 next
Definition: rand_nt.c:6
static HRESULT check_script_collisions(compile_ctx_t *ctx, script_ctx_t *script)
Definition: compile.c:1710
class_desc_t * classes
Definition: compile.c:67
HRESULT parse_script(parser_ctx_t *, const WCHAR *, const WCHAR *) DECLSPEC_HIDDEN
Definition: parser.tab.c:3415
function_decl_t * func_decls
Definition: compile.c:65
function_t * funcs
Definition: compile.c:64
const WCHAR * class
Definition: main.c:68
static HRESULT create_function(compile_ctx_t *ctx, function_decl_t *decl, function_t **ret)
Definition: compile.c:1454
statement_t * stats
Definition: parse.h:267
class_decl_t * class_decls
Definition: parse.h:269
#define TRACE_ON(x)
Definition: compat.h:65
static void dump_code(compile_ctx_t *ctx)
Definition: compile.c:106

◆ create_ax_site()

IUnknown* create_ax_site ( script_ctx_t )

Definition at line 324 of file jscript.c.

325 {
327  AXSite *ret;
328  HRESULT hres;
329 
330  hres = IActiveScriptSite_QueryInterface(ctx->site, &IID_IServiceProvider, (void**)&sp);
331  if(FAILED(hres)) {
332  TRACE("Could not get IServiceProvider iface: %08x\n", hres);
333  }
334 
335  ret = heap_alloc(sizeof(AXSite));
336  if(!ret) {
337  IServiceProvider_Release(sp);
338  return NULL;
339  }
340 
341  ret->IServiceProvider_iface.lpVtbl = &AXSiteVtbl;
342  ret->ref = 1;
343  ret->sp = sp;
344 
345  return (IUnknown*)&ret->IServiceProvider_iface;
346 }
static IServiceProviderVtbl AXSiteVtbl
Definition: jscript.c:317
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
static const WCHAR sp[]
Definition: suminfo.c:288

Referenced by create_activex_object(), and set_object_site().

◆ create_procedure_disp()

HRESULT create_procedure_disp ( script_ctx_t ,
vbscode_t ,
IDispatch **   
)

Definition at line 639 of file vbdisp.c.

640 {
642  vbdisp_t *vbdisp;
643  HRESULT hres;
644 
645  desc = heap_alloc_zero(sizeof(*desc));
646  if(!desc)
647  return E_OUTOFMEMORY;
648 
649  desc->ctx = ctx;
650  desc->builtin_prop_cnt = ARRAY_SIZE(procedure_props);
651  desc->builtin_props = procedure_props;
652  desc->value_func = &code->main_code;
653 
654  hres = create_vbdisp(desc, &vbdisp);
655  if(FAILED(hres)) {
656  heap_free(desc);
657  return hres;
658  }
659 
660  desc->next = ctx->procs;
661  ctx->procs = desc;
662 
663  *ret = (IDispatch*)&vbdisp->IDispatchEx_iface;
664  return S_OK;
665 }
HRESULT create_vbdisp(const class_desc_t *desc, vbdisp_t **ret)
Definition: vbdisp.c:562
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:130
int ret
#define S_OK
Definition: intsafe.h:59
static const builtin_prop_t procedure_props[]
Definition: vbdisp.c:635
#define ARRAY_SIZE(a)
Definition: main.h:24
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by VBScriptParseProcedure_ParseProcedureText().

◆ create_regexp()

HRESULT create_regexp ( IDispatch **  )

Definition at line 1596 of file vbregexp.c.

1597 {
1598  RegExp2 *regexp;
1599  HRESULT hres;
1600 
1601  hres = init_regexp_typeinfo(RegExp2_tid);
1602  if(FAILED(hres))
1603  return hres;
1604 
1605  regexp = heap_alloc_zero(sizeof(*regexp));
1606  if(!regexp)
1607  return E_OUTOFMEMORY;
1608 
1609  regexp->IRegExp2_iface.lpVtbl = &RegExp2Vtbl;
1610  regexp->IRegExp_iface.lpVtbl = &RegExpVtbl;
1611  regexp->ref = 1;
1612  heap_pool_init(&regexp->pool);
1613 
1614  *ret = (IDispatch*)&regexp->IRegExp2_iface;
1615  return S_OK;
1616 }
IRegExp IRegExp_iface
Definition: vbregexp.c:125
static IRegExpVtbl RegExpVtbl
Definition: vbregexp.c:1577
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const IRegExp2Vtbl RegExp2Vtbl
Definition: vbregexp.c:1444
HRESULT hres
Definition: protocol.c:465
LONG ref
Definition: vbregexp.c:127
LONG HRESULT
Definition: typedefs.h:77
int ret
void heap_pool_init(heap_pool_t *) DECLSPEC_HIDDEN
Definition: jsutils.c:71
#define S_OK
Definition: intsafe.h:59
heap_pool_t pool
Definition: vbregexp.c:131
static HRESULT init_regexp_typeinfo(regexp_tid_t tid)
Definition: vbregexp.c:49
IRegExp2 IRegExp2_iface
Definition: vbregexp.c:124

Referenced by VBScriptRegExpFactory_CreateInstance().

◆ create_safearray_iter()

HRESULT create_safearray_iter ( SAFEARRAY sa,
IEnumVARIANT **  ev 
)

Definition at line 163 of file utils.c.

164 {
165  safearray_iter *iter;
166  HRESULT hres;
167 
168  if(sa && !(sa->fFeatures & FADF_VARIANT)) {
169  FIXME("enumeration not supported: %x\n", sa->fFeatures);
170  return E_NOTIMPL;
171  }
172 
173  iter = heap_alloc(sizeof(*iter));
174  if(!iter)
175  return E_OUTOFMEMORY;
176 
177  if(sa) {
178  hres = SafeArrayLock(sa);
179  if(FAILED(hres)) {
180  heap_free(iter);
181  return hres;
182  }
183  }
184 
186  iter->ref = 1;
187  iter->sa = sa;
188  iter->i = 0;
189  iter->size = get_safearray_size(sa);
190 
191  *ev = &iter->IEnumVARIANT_iface;
192  return S_OK;
193 }
ULONG size
Definition: utils.c:31
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static ULONG get_safearray_size(SAFEARRAY *sa)
Definition: utils.c:150
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define FIXME(fmt,...)
Definition: debug.h:110
static const IEnumVARIANTVtbl safearray_iter_EnumVARIANTVtbl
Definition: utils.c:140
SAFEARRAY * sa
Definition: utils.c:30
HRESULT WINAPI SafeArrayLock(SAFEARRAY *psa)
Definition: safearray.c:797
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
LONG ref
Definition: utils.c:28
IEnumVARIANT IEnumVARIANT_iface
Definition: utils.c:26
ULONG i
Definition: utils.c:31
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by interp_newenum().

◆ create_script_disp()

HRESULT create_script_disp ( script_ctx_t ,
ScriptDisp **   
)

Definition at line 959 of file vbdisp.c.

960 {
962 
963  script_disp = heap_alloc_zero(sizeof(*script_disp));
964  if(!script_disp)
965  return E_OUTOFMEMORY;
966 
967  script_disp->IDispatchEx_iface.lpVtbl = &ScriptDispVtbl;
968  script_disp->ref = 1;
969  script_disp->ctx = ctx;
970 
971  *ret = script_disp;
972  return S_OK;
973 }
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static IDispatchExVtbl ScriptDispVtbl
Definition: vbdisp.c:941
int ret
static IDispatch * script_disp
Definition: run.c:178
#define S_OK
Definition: intsafe.h:59

Referenced by init_global().

◆ create_vbdisp()

HRESULT create_vbdisp ( const class_desc_t ,
vbdisp_t **   
)

Definition at line 562 of file vbdisp.c.

563 {
564  vbdisp_t *vbdisp;
565  HRESULT hres = S_OK;
566 
567  vbdisp = heap_alloc_zero( FIELD_OFFSET( vbdisp_t, props[desc->prop_cnt] ));
568  if(!vbdisp)
569  return E_OUTOFMEMORY;
570 
571  vbdisp->IDispatchEx_iface.lpVtbl = &DispatchExVtbl;
572  vbdisp->ref = 1;
573  vbdisp->desc = desc;
574 
575  list_add_tail(&desc->ctx->objects, &vbdisp->entry);
576 
577  if(desc->array_cnt) {
578  vbdisp->arrays = heap_alloc_zero(desc->array_cnt * sizeof(*vbdisp->arrays));
579  if(vbdisp->arrays) {
580  unsigned i, j;
581 
582  for(i=0; i < desc->array_cnt; i++) {
583  if(!desc->array_descs[i].dim_cnt)
584  continue;
585 
586  vbdisp->arrays[i] = SafeArrayCreate(VT_VARIANT, desc->array_descs[i].dim_cnt, desc->array_descs[i].bounds);
587  if(!vbdisp->arrays[i]) {
589  break;
590  }
591  }
592 
593  if(SUCCEEDED(hres)) {
594  for(i=0, j=0; i < desc->prop_cnt; i++) {
595  if(desc->props[i].is_array) {
596  V_VT(vbdisp->props+i) = VT_ARRAY|VT_BYREF|VT_VARIANT;
597  V_ARRAYREF(vbdisp->props+i) = vbdisp->arrays + j++;
598  }
599  }
600  }
601  }else {
603  }
604  }
605 
606  if(SUCCEEDED(hres) && desc->class_initialize_id) {
607  DISPPARAMS dp = {0};
608  hres = exec_script(desc->ctx, desc->funcs[desc->class_initialize_id].entries[VBDISP_CALLGET],
609  vbdisp, &dp, NULL);
610  }
611 
612  if(FAILED(hres)) {
613  IDispatchEx_Release(&vbdisp->IDispatchEx_iface);
614  return hres;
615  }
616 
617  *ret = vbdisp;
618  return S_OK;
619 }
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
LONG ref
Definition: vbscript.h:132
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
static const WCHAR desc[]
Definition: protectdata.c:36
#define V_ARRAYREF(A)
Definition: oleauto.h:223
smooth NULL
Definition: ftsmooth.c:416
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
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
IDispatchEx IDispatchEx_iface
Definition: vbscript.h:130
int ret
static IDispatchExVtbl DispatchExVtbl
Definition: vbdisp.c:537
#define V_VT(A)
Definition: oleauto.h:211
VARIANT props[1]
Definition: vbscript.h:138
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:602
const class_desc_t * desc
Definition: vbscript.h:136
#define S_OK
Definition: intsafe.h:59
HRESULT exec_script(HTMLInnerWindow *, const WCHAR *, const WCHAR *, VARIANT *) DECLSPEC_HIDDEN
Definition: script.c:1245
struct list entry
Definition: vbscript.h:134
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
static const WCHAR props[]
Definition: wbemdisp.c:288
struct stdole::DISPPARAMS DISPPARAMS
#define SUCCEEDED(hr)
Definition: intsafe.h:57
SAFEARRAY ** arrays
Definition: vbscript.h:137

Referenced by create_procedure_disp(), init_global(), and interp_new().

◆ disp_call()

HRESULT disp_call ( script_ctx_t ,
IDispatch ,
DISPID  ,
DISPPARAMS *  ,
VARIANT  
)

Definition at line 1078 of file vbdisp.c.

1079 {
1080  const WORD flags = DISPATCH_METHOD|(retv ? DISPATCH_PROPERTYGET : 0);
1081  IDispatchEx *dispex;
1082  EXCEPINFO ei;
1083  HRESULT hres;
1084 
1085  memset(&ei, 0, sizeof(ei));
1086  if(retv)
1087  V_VT(retv) = VT_EMPTY;
1088 
1089  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1090  if(FAILED(hres)) {
1091  UINT err = 0;
1092 
1093  TRACE("using IDispatch\n");
1094  return IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, retv, &ei, &err);
1095  }
1096 
1097  hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, retv, &ei, NULL /* CALLER_FIXME */);
1098  IDispatchEx_Release(dispex);
1099  return hres;
1100 }
disp
Definition: i386-dis.c:3181
#define DISPATCH_PROPERTYGET
Definition: oleauto.h:1007
#define DISPATCH_METHOD
Definition: oleauto.h:1006
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned short WORD
Definition: ntddk_ex.h:93
GLbitfield flags
Definition: glext.h:7161
#define IID_NULL
Definition: guiddef.h:98
#define V_VT(A)
Definition: oleauto.h:211
#define err(...)
struct stdole::EXCEPINFO EXCEPINFO
unsigned int UINT
Definition: ndis.h:50
#define memset(x, y, z)
Definition: compat.h:39

Referenced by get_disp_value().

◆ disp_get_id()

HRESULT disp_get_id ( IDispatch ,
BSTR  ,
vbdisp_invoke_type_t  ,
BOOL  ,
DISPID  
)

Definition at line 994 of file vbdisp.c.

995 {
996  IDispatchEx *dispex;
997  vbdisp_t *vbdisp;
998  HRESULT hres;
999 
1000  vbdisp = unsafe_impl_from_IDispatch(disp);
1001  if(vbdisp)
1002  return vbdisp_get_id(vbdisp, name, invoke_type, search_private, id);
1003 
1004  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1005  if(FAILED(hres)) {
1006  TRACE("using IDispatch\n");
1007  return IDispatch_GetIDsOfNames(disp, &IID_NULL, &name, 1, 0, id);
1008  }
1009 
1010  hres = IDispatchEx_GetDispID(dispex, name, fdexNameCaseInsensitive, id);
1011  IDispatchEx_Release(dispex);
1012  return hres;
1013 }
disp
Definition: i386-dis.c:3181
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
#define IID_NULL
Definition: guiddef.h:98
HRESULT vbdisp_get_id(vbdisp_t *This, BSTR name, vbdisp_invoke_type_t invoke_type, BOOL search_private, DISPID *id)
Definition: vbdisp.c:59
Definition: name.c:36
static vbdisp_t * unsafe_impl_from_IDispatch(IDispatch *iface)
Definition: vbdisp.c:555

◆ disp_propput()

HRESULT disp_propput ( script_ctx_t ,
IDispatch ,
DISPID  ,
WORD  ,
DISPPARAMS *   
)

Definition at line 1108 of file vbdisp.c.

1109 {
1110  IDispatchEx *dispex;
1111  EXCEPINFO ei = {0};
1112  HRESULT hres;
1113 
1114  hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
1115  if(SUCCEEDED(hres)) {
1116  hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, NULL, &ei, NULL /* FIXME! */);
1117  IDispatchEx_Release(dispex);
1118  }else {
1119  ULONG err = 0;
1120 
1121  TRACE("using IDispatch\n");
1122  hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, NULL, &ei, &err);
1123  }
1124 
1125  return hres;
1126 }
disp
Definition: i386-dis.c:3181
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
#define IID_NULL
Definition: guiddef.h:98
#define err(...)
struct stdole::EXCEPINFO EXCEPINFO
unsigned int ULONG
Definition: retypes.h:1
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ exec_script()

HRESULT exec_script ( script_ctx_t ,
function_t ,
vbdisp_t ,
DISPPARAMS *  ,
VARIANT  
)

Definition at line 2064 of file interp.c.

2065 {
2066  exec_ctx_t exec = {func->code_ctx};
2067  vbsop_t op;
2068  HRESULT hres = S_OK;
2069 
2070  exec.code = func->code_ctx;
2071 
2072  if(dp ? func->arg_cnt != arg_cnt(dp) : func->arg_cnt) {
2073  FIXME("wrong arg_cnt %d, expected %d\n", dp ? arg_cnt(dp) : 0, func->arg_cnt);
2074  return E_FAIL;
2075  }
2076 
2077  heap_pool_init(&exec.heap);
2078 
2079  if(func->arg_cnt) {
2080  VARIANT *v;
2081  unsigned i;
2082 
2083  exec.args = heap_alloc_zero(func->arg_cnt * sizeof(VARIANT));
2084  if(!exec.args) {
2085  release_exec(&exec);
2086  return E_OUTOFMEMORY;
2087  }
2088 
2089  for(i=0; i < func->arg_cnt; i++) {
2090  v = get_arg(dp, i);
2091  if(V_VT(v) == (VT_VARIANT|VT_BYREF)) {
2092  if(func->args[i].by_ref)
2093  exec.args[i] = *v;
2094  else
2095  hres = VariantCopyInd(exec.args+i, V_VARIANTREF(v));
2096  }else {
2097  hres = VariantCopyInd(exec.args+i, v);
2098  }
2099  if(FAILED(hres)) {
2100  release_exec(&exec);
2101  return hres;
2102  }
2103  }
2104  }else {
2105  exec.args = NULL;
2106  }
2107 
2108  if(func->var_cnt) {
2109  exec.vars = heap_alloc_zero(func->var_cnt * sizeof(VARIANT));
2110  if(!exec.vars) {
2111  release_exec(&exec);
2112  return E_OUTOFMEMORY;
2113  }
2114  }else {
2115  exec.vars = NULL;
2116  }
2117 
2118  exec.stack_size = 16;
2119  exec.top = 0;
2120  exec.stack = heap_alloc(exec.stack_size * sizeof(VARIANT));
2121  if(!exec.stack) {
2122  release_exec(&exec);
2123  return E_OUTOFMEMORY;
2124  }
2125 
2126  if(vbthis) {
2127  exec.this_obj = (IDispatch*)&vbthis->IDispatchEx_iface;
2128  exec.vbthis = vbthis;
2129  }else if (ctx->host_global) {
2130  exec.this_obj = ctx->host_global;
2131  }else {
2132  exec.this_obj = (IDispatch*)&ctx->script_obj->IDispatchEx_iface;
2133  }
2134  IDispatch_AddRef(exec.this_obj);
2135 
2136  exec.instr = exec.code->instrs + func->code_off;
2137  exec.script = ctx;
2138  exec.func = func;
2139 
2140  while(exec.instr) {
2141  op = exec.instr->op;
2142  hres = op_funcs[op](&exec);
2143  if(FAILED(hres)) {
2144  ctx->err_number = hres = map_hres(hres);
2145 
2146  if(exec.resume_next) {
2147  unsigned stack_off;
2148 
2149  WARN("Failed %08x in resume next mode\n", hres);
2150 
2151  /*
2152  * Unwinding here is simple. We need to find the next OP_catch, which contains
2153  * information about expected stack size and jump offset on error. Generated
2154  * bytecode needs to guarantee, that simple jump and stack adjustment will
2155  * guarantee proper execution continuation.
2156  */
2157  while((++exec.instr)->op != OP_catch);
2158 
2159  TRACE("unwind jmp %d stack_off %d\n", exec.instr->arg1.uint, exec.instr->arg2.uint);
2160 
2161  stack_off = exec.instr->arg2.uint;
2162  instr_jmp(&exec, exec.instr->arg1.uint);
2163 
2164  if(exec.top > stack_off) {
2165  stack_popn(&exec, exec.top-stack_off);
2166  }else if(exec.top < stack_off) {
2167  VARIANT v;
2168 
2169  V_VT(&v) = VT_EMPTY;
2170  while(exec.top < stack_off) {
2171  hres = stack_push(&exec, &v);
2172  if(FAILED(hres))
2173  break;
2174  }
2175  }
2176 
2177  continue;
2178  }else {
2179  WARN("Failed %08x\n", hres);
2180  stack_popn(&exec, exec.top);
2181  break;
2182  }
2183  }
2184 
2185  exec.instr += op_move[op];
2186  }
2187 
2188  assert(!exec.top);
2189  if(func->type != FUNC_FUNCTION && func->type != FUNC_PROPGET && func->type != FUNC_DEFGET)
2190  assert(V_VT(&exec.ret_val) == VT_EMPTY);
2191 
2192  if(SUCCEEDED(hres) && res) {
2193  *res = exec.ret_val;
2194  V_VT(&exec.ret_val) = VT_EMPTY;
2195  }
2196 
2197  release_exec(&exec);
2198  return hres;
2199 }
GLenum func
Definition: glext.h:6028
VARIANT * stack
Definition: interp.c:48
HRESULT map_hres
Definition: sec_mgr.c:1759
vbsop_t
Definition: vbscript.h:288
#define WARN(fmt,...)
Definition: debug.h:111
static const unsigned op_move[]
Definition: interp.c:2016
HRESULT WINAPI VariantCopyInd(VARIANT *pvargDest, VARIANTARG *pvargSrc)
Definition: variant.c:850
#define assert(x)
Definition: debug.h:53
static const instr_func_t op_funcs[]
Definition: interp.c:2010
#define E_FAIL
Definition: ddrawi.h:102
vbscode_t * code
Definition: interp.c:30
vbdisp_t * vbthis
Definition: interp.c:35
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
function_t * func
Definition: interp.c:33
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
heap_pool_t heap
Definition: interp.c:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static void stack_popn(exec_ctx_t *ctx, unsigned n)
Definition: interp.c:288
instr_arg_t arg2
Definition: vbscript.h:306
VARIANT * vars
Definition: interp.c:38
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
VARIANT * args
Definition: interp.c:37
static void release_exec(exec_ctx_t *ctx)
Definition: interp.c:2030
static void instr_jmp(exec_ctx_t *ctx, unsigned addr)
Definition: interp.c:446
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
instr_t * instrs
Definition: vbscript.h:344
LONG HRESULT
Definition: typedefs.h:77
jsop_t op
Definition: engine.h:127
#define V_VT(A)
Definition: oleauto.h:211
void heap_pool_init(heap_pool_t *) DECLSPEC_HIDDEN
Definition: jsutils.c:71
static ULONG_PTR get_arg(int nr, DWORD flags, struct format_args *args)
Definition: format_msg.c:149
script_ctx_t * script
Definition: interp.c:32
unsigned top
Definition: interp.c:47
VARIANT ret_val
Definition: interp.c:50
#define S_OK
Definition: intsafe.h:59
static unsigned arg_cnt(const DISPPARAMS *dp)
Definition: vbscript.h:166
const GLdouble * v
Definition: gl.h:2040
static HRESULT stack_push(exec_ctx_t *ctx, VARIANT *v)
Definition: interp.c:262
IDispatch * this_obj
Definition: interp.c:34
unsigned stack_size
Definition: interp.c:46
GLuint res
Definition: glext.h:9613
unsigned uint
Definition: engine.h:112
BOOL resume_next
Definition: interp.c:44
UINT op
Definition: effect.c:223
instr_arg_t arg1
Definition: vbscript.h:305
#define V_VARIANTREF(A)
Definition: oleauto.h:283
instr_t * instr
Definition: interp.c:31
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by do_icall().

◆ get_arg()

static VARIANT* get_arg ( DISPPARAMS *  dp,
DWORD  i 
)
inlinestatic

Definition at line 171 of file vbscript.h.

172 {
173  return dp->rgvarg + dp->cArgs-i-1;
174 }
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

◆ get_disp_value()

HRESULT get_disp_value ( script_ctx_t ,
IDispatch ,
VARIANT  
)

Definition at line 1102 of file vbdisp.c.

1103 {
1104  DISPPARAMS dp = {NULL};
1105  return disp_call(ctx, disp, DISPID_VALUE, &dp, v);
1106 }
disp
Definition: i386-dis.c:3181
smooth NULL
Definition: ftsmooth.c:416
const GLdouble * v
Definition: gl.h:2040
struct stdole::DISPPARAMS DISPPARAMS
HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp, VARIANT *retv)
Definition: vbdisp.c:1078

Referenced by assign_value(), get_propput_arg(), stack_assume_val(), and stack_pop_val().

◆ get_typeinfo()

HRESULT get_typeinfo ( tid_t  ,
ITypeInfo **   
)

Definition at line 61 of file ieframe_main.c.

62 {
63  HRESULT hres;
64 
65  if(!typelib)
66  hres = load_typelib();
67  if(!typelib)
68  return hres;
69 
70  if(!typeinfos[tid]) {
71  ITypeInfo *ti;
72 
73  hres = ITypeLib_GetTypeInfoOfGuid(typelib, tid_ids[tid], &ti);
74  if(FAILED(hres)) {
75  ERR("GetTypeInfoOfGuid(%s) failed: %08x\n", debugstr_guid(tid_ids[tid]), hres);
76  return hres;
77  }
78 
80  ITypeInfo_Release(ti);
81  }
82 
84  return S_OK;
85 }
static REFIID tid_ids[]
Definition: ieframe_main.c:37
static ITypeLib * typelib
Definition: ieframe_main.c:34
static ITypeInfo * typeinfos[LAST_tid]
Definition: ieframe_main.c:35
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static HRESULT load_typelib(void)
Definition: ieframe_main.c:45
#define ERR(fmt,...)
Definition: debug.h:109
#define S_OK
Definition: intsafe.h:59
static TfClientId tid

◆ heap_pool_alloc()

void* heap_pool_alloc ( heap_pool_t ,
size_t   
)

Definition at line 112 of file vbscript_main.c.

113 {
114  struct list *list;
115  void *tmp;
116 
117  size = (size+3)&~3;
118 
119  if(!heap->block_cnt) {
120  if(!heap->blocks) {
121  heap->blocks = heap_alloc(sizeof(void*));
122  if(!heap->blocks)
123  return NULL;
124  }
125 
126  tmp = heap_alloc(block_size(0));
127  if(!tmp)
128  return NULL;
129 
130  heap->blocks[0] = tmp;
131  heap->block_cnt = 1;
132  }
133 
134  if(heap->offset + size <= block_size(heap->last_block)) {
135  tmp = ((BYTE*)heap->blocks[heap->last_block])+heap->offset;
136  heap->offset += size;
137  return tmp;
138  }
139 
140  if(size <= block_size(heap->last_block+1)) {
141  if(heap->last_block+1 == heap->block_cnt) {
142  tmp = heap_realloc(heap->blocks, (heap->block_cnt+1)*sizeof(void*));
143  if(!tmp)
144  return NULL;
145 
146  heap->blocks = tmp;
147  heap->blocks[heap->block_cnt] = heap_alloc(block_size(heap->block_cnt));
148  if(!heap->blocks[heap->block_cnt])
149  return NULL;
150 
151  heap->block_cnt++;
152  }
153 
154  heap->last_block++;
155  heap->offset = size;
156  return heap->blocks[heap->last_block];
157  }
158 
159  list = heap_alloc(size + sizeof(struct list));
160  if(!list)
161  return NULL;
162 
163  list_add_head(&heap->custom_blocks, list);
164  return list+1;
165 }
__WINE_SERVER_LIST_INLINE void list_add_head(struct list *list, struct list *elem)
Definition: list.h:96
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:70
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
static DWORD block_size(DWORD block)
unsigned char BYTE
Definition: mem.h:68
Definition: _list.h:228
#define list
Definition: rosglue.h:35

Referenced by heap_pool_grow().

◆ heap_pool_clear()

void heap_pool_clear ( heap_pool_t )

Definition at line 146 of file jsutils.c.

147 {
148  struct list *tmp;
149 
150  if(!heap)
151  return;
152 
153  while((tmp = list_head(&heap->custom_blocks))) {
154  list_remove(tmp);
155  heap_free(tmp);
156  }
157 
158  if(WARN_ON(heap)) {
159  DWORD i;
160 
161  for(i=0; i < heap->block_cnt; i++)
162  memset(heap->blocks[i], ARENA_FREE_FILLER, block_size(i));
163  }
164 
165  heap->last_block = heap->offset = 0;
166  heap->mark = FALSE;
167 }
#define ARENA_FREE_FILLER
Definition: jsutils.c:64
static DWORD block_size(DWORD block)
Definition: jsutils.c:66
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
#define WARN_ON(c)
Definition: module.h:255
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
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: _list.h:228
#define memset(x, y, z)
Definition: compat.h:39
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by heap_pool_free().

◆ heap_pool_free()

void heap_pool_free ( heap_pool_t )

Definition at line 169 of file jsutils.c.

170 {
171  DWORD i;
172 
173  heap_pool_clear(heap);
174 
175  for(i=0; i < heap->block_cnt; i++)
176  heap_free(heap->blocks[i]);
177  heap_free(heap->blocks);
178 
179  heap_pool_init(heap);
180 }
void heap_pool_clear(heap_pool_t *heap)
Definition: jsutils.c:146
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
unsigned long DWORD
Definition: ntddk_ex.h:95
void heap_pool_init(heap_pool_t *heap)
Definition: jsutils.c:71
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ heap_pool_grow()

void* heap_pool_grow ( heap_pool_t ,
void ,
DWORD  ,
DWORD   
)

Definition at line 130 of file jsutils.c.

131 {
132  void *ret;
133 
134  if(mem == (BYTE*)heap->blocks[heap->last_block] + heap->offset-size
135  && heap->offset+inc < block_size(heap->last_block)) {
136  heap->offset += inc;
137  return mem;
138  }
139 
140  ret = heap_pool_alloc(heap, size+inc);
141  if(ret) /* FIXME: avoid copying for custom blocks */
142  memcpy(ret, mem, size);
143  return ret;
144 }
static DWORD block_size(DWORD block)
Definition: jsutils.c:66
void * heap_pool_alloc(heap_pool_t *heap, DWORD size)
Definition: jsutils.c:77
GLsizeiptr size
Definition: glext.h:5919
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
Definition: mem.c:156

◆ heap_pool_init()

void heap_pool_init ( heap_pool_t )

Definition at line 71 of file jsutils.c.

72 {
73  memset(heap, 0, sizeof(*heap));
74  list_init(&heap->custom_blocks);
75 }
__WINE_SERVER_LIST_INLINE void list_init(struct list *list)
Definition: list.h:149
#define memset(x, y, z)
Definition: compat.h:39

Referenced by heap_pool_free().

◆ heap_pool_mark()

heap_pool_t* heap_pool_mark ( heap_pool_t )

Definition at line 182 of file jsutils.c.

183 {
184  if(heap->mark)
185  return NULL;
186 
187  heap->mark = TRUE;
188  return heap;
189 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416

◆ heap_strdupW()

static LPWSTR heap_strdupW ( LPCWSTR  str)
inlinestatic

Definition at line 442 of file vbscript.h.

443 {
444  LPWSTR ret = NULL;
445 
446  if(str) {
447  DWORD size;
448 
449  size = (strlenW(str)+1)*sizeof(WCHAR);
450  ret = heap_alloc(size);
451  if(ret)
452  memcpy(ret, str, size);
453  }
454 
455  return ret;
456 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ init_err()

HRESULT init_err ( script_ctx_t )

◆ init_global()

HRESULT init_global ( script_ctx_t )

Definition at line 1105 of file global.c.

1106 {
1107  unsigned const_flags = ctx->version >= SCRIPTLANGUAGEVERSION_ES5 ? 0 : PROPF_WRITABLE;
1108  jsdisp_t *math, *object_prototype, *constr;
1109  HRESULT hres;
1110 
1111  if(ctx->global)
1112  return S_OK;
1113 
1114  hres = create_dispex(ctx, &JSGlobal_info, NULL, &ctx->global);
1115  if(FAILED(hres))
1116  return hres;
1117 
1118  hres = create_object_prototype(ctx, &object_prototype);
1119  if(FAILED(hres))
1120  return hres;
1121 
1122  hres = init_constructors(ctx, object_prototype);
1123  jsdisp_release(object_prototype);
1124  if(FAILED(hres))
1125  return hres;
1126 
1127  hres = create_math(ctx, &math);
1128  if(FAILED(hres))
1129  return hres;
1130 
1132  jsdisp_release(math);
1133  if(FAILED(hres))
1134  return hres;
1135 
1136  if(ctx->version >= 2) {
1137  jsdisp_t *json;
1138 
1139  hres = create_json(ctx, &json);
1140  if(FAILED(hres))
1141  return hres;
1142 
1144  jsdisp_release(json);
1145  if(FAILED(hres))
1146  return hres;
1147  }
1148 
1149  hres = create_activex_constr(ctx, &constr);
1150  if(FAILED(hres))
1151  return hres;
1152 
1154  jsval_obj(constr));
1155  jsdisp_release(constr);
1156  if(FAILED(hres))
1157  return hres;
1158 
1159  hres = jsdisp_define_data_property(ctx->global, undefinedW, const_flags, jsval_undefined());
1160  if(FAILED(hres))
1161  return hres;
1162 
1163  hres = jsdisp_define_data_property(ctx->global, NaNW, const_flags, jsval_number(NAN));
1164  if(FAILED(hres))
1165  return hres;
1166 
1167  hres = jsdisp_define_data_property(ctx->global, InfinityW, const_flags, jsval_number(INFINITY));
1168  return hres;
1169 }
#define PROPF_WRITABLE
Definition: jscript.h:101
HRESULT jsdisp_define_data_property(jsdisp_t *obj, const WCHAR *name, unsigned flags, jsval_t value)
Definition: dispex.c:1801
static const WCHAR undefinedW[]
Definition: global.c:78
HRESULT create_math(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
Definition: math.c:533
HRESULT create_json(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
Definition: json.c:837
smooth NULL
Definition: ftsmooth.c:416
HRESULT create_object_prototype(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
Definition: object.c:726
static const WCHAR NaNW[]
Definition: global.c:34
static const builtin_info_t JSGlobal_info
Definition: global.c:955
HRESULT hres
Definition: protocol.c:465
static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
Definition: global.c:964
static const WCHAR ActiveXObjectW[]
Definition: global.c:52
LONG HRESULT
Definition: typedefs.h:77
#define NAN
Definition: misc.c:46
#define SCRIPTLANGUAGEVERSION_ES5
Definition: jscript.h:52
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
static const WCHAR JSONW[]
Definition: global.c:72
HRESULT create_dispex(script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype, jsdisp_t **dispex)
Definition: dispex.c:957
static const WCHAR MathW[]
Definition: global.c:71
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static const WCHAR InfinityW[]
Definition: global.c:35
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
HRESULT create_activex_constr(script_ctx_t *ctx, jsdisp_t **ret)
Definition: activex.c:188
#define INFINITY
Definition: misc.c:36
static jsval_t jsval_number(double n)
Definition: jsval.h:144

Referenced by set_ctx_site().

◆ is_int32()

static BOOL is_int32 ( double  d)
inlinestatic

Definition at line 394 of file vbscript.h.

395 {
396  return INT32_MIN <= d && d <= INT32_MAX && (double)(int)d == d;
397 }
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80
#define d
Definition: ke_i.h:81
#define INT32_MAX
Definition: vbscript.h:391
#define INT32_MIN
Definition: vbscript.h:387

◆ lookup_named_item()

IDispatch* lookup_named_item ( script_ctx_t ,
const WCHAR ,
unsigned   
)

Definition at line 102 of file vbscript.c.

103 {
105  HRESULT hres;
106 
107  LIST_FOR_EACH_ENTRY(item, &ctx->named_items, named_item_t, entry) {
108  if((item->flags & flags) == flags && !strcmpiW(item->name, name)) {
109  if(!item->disp) {
110  IUnknown *unk;
111 
112  hres = IActiveScriptSite_GetItemInfo(ctx->site, item->name,
113  SCRIPTINFO_IUNKNOWN, &unk, NULL);
114  if(FAILED(hres)) {
115  WARN("GetItemInfo failed: %08x\n", hres);
116  continue;
117  }
118 
119  hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)&item->disp);
120  IUnknown_Release(unk);
121  if(FAILED(hres)) {
122  WARN("object does not implement IDispatch\n");
123  continue;
124  }
125  }
126 
127  return item->disp;
128  }
129  }
130 
131  return NULL;
132 }
#define WARN(fmt,...)
Definition: debug.h:111
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLbitfield flags
Definition: glext.h:7161
const GUID IID_IDispatch
uint32_t entry
Definition: isohybrid.c:63
#define strcmpiW(s1, s2)
Definition: unicode.h:39
static ATOM item
Definition: dde.c:856
Definition: name.c:36

Referenced by lookup_identifier(), and VBScriptParse_ParseScriptText().

◆ map_hres()

HRESULT map_hres ( HRESULT  )

Definition at line 1017 of file vbdisp.c.

1018 {
1020  return hres;
1021 
1022  switch(hres) {
1073  }
1074 
1075  return hres;
1076 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define VBSE_ARRAY_LOCKED
Definition: vbscript.h:412
#define E_ACCESSDENIED
Definition: winerror.h:2849
#define STG_E_INVALIDNAME
Definition: winerror.h:2584
#define STG_E_WRITEFAULT
Definition: winerror.h:2575
#define E_NOINTERFACE
Definition: winerror.h:2364
#define VBSE_INVALID_TYPELIB_VARIABLE
Definition: vbscript.h:429
#define CO_E_APPDIDNTREG
Definition: winerror.h:2817
#define VBSE_OLE_NO_PROP_OR_METHOD
Definition: vbscript.h:424
#define VBSE_CANT_CREATE_OBJECT
Definition: vbscript.h:436
#define STG_E_NOTCURRENT
Definition: winerror.h:2589
#define CO_E_SERVER_EXEC_FAILURE
Definition: winerror.h:2860
#define DISP_E_MEMBERNOTFOUND
Definition: winerror.h:2512
#define VBSE_OUT_OF_BOUNDS
Definition: vbscript.h:411
#define STG_E_NOMOREFILES
Definition: winerror.h:2572
#define STG_E_MEDIUMFULL
Definition: winerror.h:2581
#define STG_E_INSUFFICIENTMEMORY
Definition: winerror.h:2570
#define VBSE_NOT_ENUM
Definition: vbscript.h:432
#define STG_E_TOOMANYOPENFILES
Definition: winerror.h:2567
#define DISP_E_ARRAYISLOCKED
Definition: winerror.h:2522
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:2513
#define STG_E_INUSE
Definition: winerror.h:2588
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define STG_E_ACCESSDENIED
Definition: winerror.h:2568
#define STG_E_PATHNOTFOUND
Definition: winerror.h:2566
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define VBSE_OLE_NOT_SUPPORTED
Definition: vbscript.h:423
#define E_INVALIDARG
Definition: ddrawi.h:101
#define DISP_E_NONAMEDARGS
Definition: winerror.h:2516
#define TYPE_E_OUTOFBOUNDS
Definition: winerror.h:2549
#define VBSE_PERMISSION_DENIED
Definition: vbscript.h:419
#define DISP_E_UNKNOWNLCID
Definition: winerror.h:2521
#define VBSE_OVERFLOW
Definition: vbscript.h:409
#define MK_E_INVALIDEXTENSION
Definition: winerror.h:2787
#define MK_E_CANTOPENFILE
Definition: winerror.h:2791
#define TYPE_E_DLLFUNCTIONNOTFOUND
Definition: winerror.h:2543
#define VBSE_OUT_OF_MEMORY
Definition: vbscript.h:410
#define STG_E_SHAREVIOLATION
Definition: winerror.h:2577
#define DISP_E_TYPEMISMATCH
Definition: winerror.h:2514
HRESULT hres
Definition: protocol.c:465
#define TYPE_E_TYPEMISMATCH
Definition: winerror.h:2548
#define STG_E_FILEALREADYEXISTS
Definition: winerror.h:2579
#define VBSE_NAMED_ARGS_NOT_SUPPORTED
Definition: vbscript.h:426
#define DISP_E_UNKNOWNINTERFACE
Definition: winerror.h:2511
#define DISP_E_BADVARTYPE
Definition: winerror.h:2517
#define STG_E_FILENOTFOUND
Definition: winerror.h:2565
#define VBSE_ILLEGAL_FUNC_CALL
Definition: vbscript.h:408
#define VBSE_FILE_ALREADY_EXISTS
Definition: vbscript.h:416
#define DISP_E_PARAMNOTOPTIONAL
Definition: winerror.h:2524
#define VBSE_OLE_FILE_NOT_FOUND
Definition: vbscript.h:435
#define VBSE_SERVER_NOT_FOUND
Definition: vbscript.h:437
#define VBSE_INVALID_DLL_FUNCTION_NAME
Definition: vbscript.h:433
#define VBSE_DISK_FULL
Definition: vbscript.h:417
#define VBSE_NAMED_PARAM_NOT_FOUND
Definition: vbscript.h:428
#define VBSE_LOCALE_SETTING_NOT_SUPPORTED
Definition: vbscript.h:427
#define STG_E_DISKISWRITEPROTECTED
Definition: winerror.h:2573
#define REGDB_E_CLASSNOTREG
Definition: winerror.h:2696
#define STG_E_LOCKVIOLATION
Definition: winerror.h:2578
#define VBSE_ACTION_NOT_SUPPORTED
Definition: vbscript.h:425
#define MAKE_VBSERROR(code)
Definition: vbscript.h:406
#define VBSE_PATH_FILE_ACCESS
Definition: vbscript.h:420
#define VBSE_PARAMETER_NOT_OPTIONAL
Definition: vbscript.h:431
#define E_NOTIMPL
Definition: ddrawi.h:99
#define STG_E_READFAULT
Definition: winerror.h:2576
#define TYPE_E_IOERROR
Definition: winerror.h:2550
#define DISP_E_BADPARAMCOUNT
Definition: winerror.h:2523
#define VBSE_PATH_NOT_FOUND
Definition: vbscript.h:421
#define VBSE_TOO_MANY_FILES
Definition: vbscript.h:418
#define VBSE_IO_ERROR
Definition: vbscript.h:415
#define VBSE_TYPE_MISMATCH
Definition: vbscript.h:413
#define MK_E_UNAVAILABLE
Definition: winerror.h:2784
#define VBSE_FUNC_ARITY_MISMATCH
Definition: vbscript.h:430
#define FACILITY_VBS
Definition: vbscript.h:405
#define DISP_E_NOTACOLLECTION
Definition: winerror.h:2526
#define TYPE_E_CANTCREATETMPFILE
Definition: winerror.h:2551
#define CO_E_CLASSSTRING
Definition: winerror.h:2806
#define DISP_E_BADINDEX
Definition: winerror.h:2520
#define CO_E_APPNOTFOUND
Definition: winerror.h:2808
#define VBSE_CANT_CREATE_TMP_FILE
Definition: vbscript.h:434
#define STG_E_CANTSAVE
Definition: winerror.h:2591
#define DISP_E_OVERFLOW
Definition: winerror.h:2519
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define RPC_E_SERVER_UNAVAILABLE
Definition: vbdisp.c:1015
#define VBSE_FILE_NOT_FOUND
Definition: vbscript.h:414

◆ release_dynamic_vars()

void release_dynamic_vars ( dynamic_var_t )

Definition at line 2022 of file interp.c.

2023 {
2024  while(var) {
2025  VariantClear(&var->v);
2026  var = var->next;
2027  }
2028 }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:651

Referenced by release_exec(), and release_script().

◆ release_regexp_typelib()

void release_regexp_typelib ( void  )

Definition at line 1634 of file vbregexp.c.

1635 {
1636  DWORD i;
1637 
1638  for(i=0; i<REGEXP_LAST_tid; i++) {
1639  if(typeinfos[i])
1640  ITypeInfo_Release(typeinfos[i]);
1641  }
1642  if(typelib)
1643  ITypeLib_Release(typelib);
1644 }
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
static ITypeInfo * typeinfos[REGEXP_LAST_tid]
Definition: vbregexp.c:47
static ITypeLib * typelib
Definition: vbregexp.c:46
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by DllMain().

◆ release_vbscode()

void release_vbscode ( vbscode_t )

Definition at line 1740 of file compile.c.

1741 {
1742  unsigned i;
1743 
1744  list_remove(&code->entry);
1745 
1746  for(i=0; i < code->bstr_cnt; i++)
1747  SysFreeString(code->bstr_pool[i]);
1748 
1749  if(code->context)
1750  IDispatch_Release(code->context);
1751  heap_pool_free(&code->heap);
1752 
1753  heap_free(code->bstr_pool);
1754  heap_free(code->source);
1755  heap_free(code->instrs);
1756  heap_free(code);
1757 }
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
__WINE_SERVER_LIST_INLINE void list_remove(struct list *elem)
Definition: list.h:108
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
void heap_pool_free(heap_pool_t *) DECLSPEC_HIDDEN
Definition: jsutils.c:169
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by alloc_vbscode(), destroy_script(), and release_compiler().

◆ to_int()

HRESULT to_int ( VARIANT ,
int  
)

Definition at line 163 of file global.c.

164 {
165  VARIANT r;
166  HRESULT hres;
167 
168  V_VT(&r) = VT_EMPTY;
169  hres = VariantChangeType(&r, v, 0, VT_I4);
170  if(FAILED(hres))
171  return hres;
172 
173  *ret = V_I4(&r);
174  return S_OK;
175 }
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:965
Definition: compat.h:1939
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define V_I4(A)
Definition: oleauto.h:247
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
#define V_VT(A)
Definition: oleauto.h:211
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040

Referenced by array_access(), Global_Chr(), Global_CLng(), Global_Hex(), Global_InStr(), Global_InStrRev(), Global_Left(), Global_Mid(), Global_MonthName(), Global_MsgBox(), Global_Oct(), Global_RGB(), Global_Right(), Global_Space(), Global_StrComp(), Global_UBound(), and Global_WeekdayName().

◆ vbdisp_get_id()

HRESULT vbdisp_get_id ( vbdisp_t ,
BSTR  ,
vbdisp_invoke_type_t  ,
BOOL  ,
DISPID  
)

Definition at line 59 of file vbdisp.c.

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(!strcmpiW(This->desc->props[i].name, name)) {
71  *id = i + This->desc->func_cnt;
72  return S_OK;
73  }
74  }
75 
76  if(This->desc->typeinfo) {
77  HRESULT hres;
78 
79  hres = ITypeInfo_GetIDsOfNames(This->desc->typeinfo, &name, 1, id);
80  if(SUCCEEDED(hres))
81  return S_OK;
82  }
83 
84  *id = -1;
85  return DISP_E_UNKNOWNNAME;
86 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
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
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
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
#define strcmpiW(s1, s2)
Definition: unicode.h:39
#define S_OK
Definition: intsafe.h:59
Definition: name.c:36
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by disp_get_id(), DispatchEx_GetDispID(), and lookup_identifier().

◆ VBScriptFactory_CreateInstance()

HRESULT WINAPI VBScriptFactory_CreateInstance ( IClassFactory ,
IUnknown ,
REFIID  ,
void **   
)

Definition at line 861 of file vbscript.c.

862 {
863  VBScript *ret;
864  HRESULT hres;
865 
866  TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
867 
868  ret = heap_alloc_zero(sizeof(*ret));
869  if(!ret)
870  return E_OUTOFMEMORY;
871 
872  ret->IActiveScript_iface.lpVtbl = &VBScriptVtbl;
873  ret->IActiveScriptDebug_iface.lpVtbl = &VBScriptDebugVtbl;
874  ret->IActiveScriptParse_iface.lpVtbl = &VBScriptParseVtbl;
875  ret->IActiveScriptParseProcedure2_iface.lpVtbl = &VBScriptParseProcedureVtbl;
876  ret->IObjectSafety_iface.lpVtbl = &VBScriptSafetyVtbl;
877 
878  ret->ref = 1;
880  ret->safeopt = INTERFACE_USES_DISPEX;
881 
882  hres = IActiveScript_QueryInterface(&ret->IActiveScript_iface, riid, ppv);
883  IActiveScript_Release(&ret->IActiveScript_iface);
884  return hres;
885 }
static const IObjectSafetyVtbl VBScriptSafetyVtbl
Definition: vbscript.c:853
REFIID riid
Definition: precomp.h:44
static const IActiveScriptParseProcedure2Vtbl VBScriptParseProcedureVtbl
Definition: vbscript.c:792
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IActiveScriptVtbl VBScriptVtbl
Definition: vbscript.c:554
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
static const IActiveScriptDebugVtbl VBScriptDebugVtbl
Definition: vbscript.c:622
static const IActiveScriptParseVtbl VBScriptParseVtbl
Definition: vbscript.c:737

◆ VBScriptRegExpFactory_CreateInstance()

HRESULT WINAPI VBScriptRegExpFactory_CreateInstance ( IClassFactory ,
IUnknown ,
REFIID  ,
void **   
)

Definition at line 1618 of file vbregexp.c.

1619 {
1620  IDispatch *regexp;
1621  HRESULT hres;
1622 
1623  TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv);
1624 
1625  hres = create_regexp(&regexp);
1626  if(FAILED(hres))
1627  return hres;
1628 
1629  hres = IDispatch_QueryInterface(regexp, riid, ppv);
1630  IDispatch_Release(regexp);
1631  return hres;
1632 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT create_regexp(IDispatch **ret)
Definition: vbregexp.c:1596
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77