Module: wine Branch: master Commit: f00a8ec04dd5f3e30a6527390875aa73d8379f81 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f00a8ec04dd5f3e30a65273908...
Author: Jacek Caban jacek@codeweavers.com Date: Wed Sep 14 12:55:42 2011 +0200
vbscript: Added functions lookup implementation.
---
dlls/vbscript/interp.c | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 66c2cf1..adec28f 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -41,7 +41,8 @@ typedef HRESULT (*instr_func_t)(exec_ctx_t*); typedef enum { REF_NONE, REF_DISP, - REF_VAR + REF_VAR, + REF_FUNC } ref_type_t;
typedef struct { @@ -52,6 +53,7 @@ typedef struct { DISPID id; } d; VARIANT *v; + function_t *f; } u; } ref_t;
@@ -79,12 +81,21 @@ static BOOL lookup_dynamic_vars(dynamic_var_t *var, const WCHAR *name, ref_t *re static HRESULT lookup_identifier(exec_ctx_t *ctx, BSTR name, ref_t *ref) { named_item_t *item; + function_t *func; DISPID id; HRESULT hres;
if(lookup_dynamic_vars(ctx->script->global_vars, name, ref)) return S_OK;
+ for(func = ctx->script->global_funcs; func; func = func->next) { + if(!strcmpiW(func->name, name)) { + ref->type = REF_FUNC; + ref->u.f = func; + return S_OK; + } + } + LIST_FOR_EACH_ENTRY(item, &ctx->script->named_items, named_item_t, entry) { if(item->flags & SCRIPTITEM_GLOBALMEMBERS) { hres = disp_get_id(item->disp, name, &id); @@ -254,6 +265,9 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) if(FAILED(hres)) return hres; break; + case REF_FUNC: + FIXME("functions not implemented\n"); + return E_NOTIMPL; case REF_NONE: FIXME("%s not found\n", debugstr_w(identifier)); return DISP_E_UNKNOWNNAME; @@ -313,6 +327,9 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, VARIANT *val, BOOL own_v if(own_val) VariantClear(val); break; + case REF_FUNC: + FIXME("functions not implemented\n"); + return E_NOTIMPL; case REF_NONE: FIXME("%s not found\n", debugstr_w(name)); if(own_val)