Commit 48d04b22 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

vbscript: Added function invocation supprot to do_icall.

parent f00a8ec0
...@@ -266,8 +266,10 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res) ...@@ -266,8 +266,10 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
return hres; return hres;
break; break;
case REF_FUNC: case REF_FUNC:
FIXME("functions not implemented\n"); hres = exec_script(ctx->script, ref.u.f, &dp, res);
return E_NOTIMPL; if(FAILED(hres))
return hres;
break;
case REF_NONE: case REF_NONE:
FIXME("%s not found\n", debugstr_w(identifier)); FIXME("%s not found\n", debugstr_w(identifier));
return DISP_E_UNKNOWNNAME; return DISP_E_UNKNOWNNAME;
...@@ -812,12 +814,22 @@ OP_LIST ...@@ -812,12 +814,22 @@ OP_LIST
#undef X #undef X
}; };
HRESULT exec_script(script_ctx_t *ctx, function_t *func) HRESULT exec_script(script_ctx_t *ctx, function_t *func, DISPPARAMS *dp, VARIANT *res)
{ {
exec_ctx_t exec; exec_ctx_t exec;
vbsop_t op; vbsop_t op;
HRESULT hres = S_OK; HRESULT hres = S_OK;
if(res) {
FIXME("returning value is not implemented\n");
return E_NOTIMPL;
}
if(dp && arg_cnt(dp)) {
FIXME("arguments not implemented\n");
return E_NOTIMPL;
}
exec.stack_size = 16; exec.stack_size = 16;
exec.top = 0; exec.top = 0;
exec.stack = heap_alloc(exec.stack_size * sizeof(VARIANT)); exec.stack = heap_alloc(exec.stack_size * sizeof(VARIANT));
......
...@@ -175,4 +175,8 @@ Sub testsub ...@@ -175,4 +175,8 @@ Sub testsub
End Sub End Sub
end if end if
x = false
Call testsub
Call ok(x, "x is false, testsub not called?")
reportSuccess() reportSuccess()
...@@ -77,7 +77,7 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code) ...@@ -77,7 +77,7 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code)
code->global_executed = TRUE; code->global_executed = TRUE;
IActiveScriptSite_OnEnterScript(ctx->site); IActiveScriptSite_OnEnterScript(ctx->site);
hres = exec_script(ctx, &code->global_code); hres = exec_script(ctx, &code->global_code, NULL, NULL);
IActiveScriptSite_OnLeaveScript(ctx->site); IActiveScriptSite_OnLeaveScript(ctx->site);
return hres; return hres;
......
...@@ -65,6 +65,11 @@ HRESULT disp_get_id(IDispatch*,BSTR,DISPID*); ...@@ -65,6 +65,11 @@ HRESULT disp_get_id(IDispatch*,BSTR,DISPID*);
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*); HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,VARIANT*);
HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*); HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,VARIANT*);
static inline unsigned arg_cnt(const DISPPARAMS *dp)
{
return dp->cArgs - dp->cNamedArgs;
}
typedef struct _dynamic_var_t { typedef struct _dynamic_var_t {
struct _dynamic_var_t *next; struct _dynamic_var_t *next;
VARIANT v; VARIANT v;
...@@ -179,7 +184,7 @@ struct _vbscode_t { ...@@ -179,7 +184,7 @@ struct _vbscode_t {
void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN; void release_vbscode(vbscode_t*) DECLSPEC_HIDDEN;
HRESULT compile_script(script_ctx_t*,const WCHAR*,vbscode_t**) DECLSPEC_HIDDEN; HRESULT compile_script(script_ctx_t*,const WCHAR*,vbscode_t**) DECLSPEC_HIDDEN;
HRESULT exec_script(script_ctx_t*,function_t*) DECLSPEC_HIDDEN; HRESULT exec_script(script_ctx_t*,function_t*,DISPPARAMS*,VARIANT*) DECLSPEC_HIDDEN;
HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**); HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment