vbscript: Added function invocation supprot to do_icall.
This commit is contained in:
parent
f00a8ec04d
commit
48d04b220b
dlls/vbscript
|
@ -266,8 +266,10 @@ static HRESULT do_icall(exec_ctx_t *ctx, VARIANT *res)
|
|||
return hres;
|
||||
break;
|
||||
case REF_FUNC:
|
||||
FIXME("functions not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
hres = exec_script(ctx->script, ref.u.f, &dp, res);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
break;
|
||||
case REF_NONE:
|
||||
FIXME("%s not found\n", debugstr_w(identifier));
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
@ -812,12 +814,22 @@ OP_LIST
|
|||
#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;
|
||||
vbsop_t op;
|
||||
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.top = 0;
|
||||
exec.stack = heap_alloc(exec.stack_size * sizeof(VARIANT));
|
||||
|
|
|
@ -175,4 +175,8 @@ Sub testsub
|
|||
End Sub
|
||||
end if
|
||||
|
||||
x = false
|
||||
Call testsub
|
||||
Call ok(x, "x is false, testsub not called?")
|
||||
|
||||
reportSuccess()
|
||||
|
|
|
@ -77,7 +77,7 @@ static HRESULT exec_global_code(script_ctx_t *ctx, vbscode_t *code)
|
|||
code->global_executed = TRUE;
|
||||
|
||||
IActiveScriptSite_OnEnterScript(ctx->site);
|
||||
hres = exec_script(ctx, &code->global_code);
|
||||
hres = exec_script(ctx, &code->global_code, NULL, NULL);
|
||||
IActiveScriptSite_OnLeaveScript(ctx->site);
|
||||
|
||||
return hres;
|
||||
|
|
|
@ -65,6 +65,11 @@ HRESULT disp_get_id(IDispatch*,BSTR,DISPID*);
|
|||
HRESULT disp_call(script_ctx_t*,IDispatch*,DISPID,DISPPARAMS*,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 {
|
||||
struct _dynamic_var_t *next;
|
||||
VARIANT v;
|
||||
|
@ -179,7 +184,7 @@ struct _vbscode_t {
|
|||
|
||||
void release_vbscode(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**);
|
||||
|
||||
|
|
Loading…
Reference in New Issue