vbscript: Don't use IDispatchEx for internal calls.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-10-17 22:46:17 +02:00 committed by Alexandre Julliard
parent 6d55197ee0
commit be253c1dc9
2 changed files with 14 additions and 5 deletions

View File

@ -1610,9 +1610,7 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid,
memset(&ei, 0, sizeof(ei));
hres = IDispatchEx_InvokeEx(dispex, id, 0, DISPATCH_METHOD, &dp, &v, &ei, pspCaller);
ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
todo_wine
CHECK_CALLED(OnEnterScript);
todo_wine
CHECK_CALLED(OnLeaveScript);
ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v));
ok(V_BOOL(&v) == VARIANT_TRUE, "V_BOOL(v) = %x\n", V_BOOL(&v));

View File

@ -266,7 +266,7 @@ static HRESULT invoke_vbdisp(vbdisp_t *This, DISPID id, DWORD flags, BOOL extern
return DISP_E_MEMBERNOTFOUND;
}
return exec_script(This->desc->ctx, FALSE, func, This, params, res);
return exec_script(This->desc->ctx, extern_caller, func, This, params, res);
case DISPATCH_METHOD:
case DISPATCH_METHOD|DISPATCH_PROPERTYGET:
@ -276,7 +276,8 @@ static HRESULT invoke_vbdisp(vbdisp_t *This, DISPID id, DWORD flags, BOOL extern
return DISP_E_MEMBERNOTFOUND;
}
return exec_script(This->desc->ctx, FALSE, func, This, params, res);
return exec_script(This->desc->ctx, extern_caller, func, This, params, res);
case DISPATCH_PROPERTYPUT:
case DISPATCH_PROPERTYPUTREF:
case DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF: {
@ -301,7 +302,7 @@ static HRESULT invoke_vbdisp(vbdisp_t *This, DISPID id, DWORD flags, BOOL extern
return DISP_E_MEMBERNOTFOUND;
}
hres = exec_script(This->desc->ctx, FALSE, func, This, &dp, NULL);
hres = exec_script(This->desc->ctx, extern_caller, func, This, &dp, NULL);
if(needs_release)
VariantClear(&put_val);
return hres;
@ -1078,6 +1079,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp,
{
const WORD flags = DISPATCH_METHOD|(retv ? DISPATCH_PROPERTYGET : 0);
IDispatchEx *dispex;
vbdisp_t *vbdisp;
EXCEPINFO ei;
HRESULT hres;
@ -1085,6 +1087,10 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp,
if(retv)
V_VT(retv) = VT_EMPTY;
vbdisp = unsafe_impl_from_IDispatch(disp);
if(vbdisp && vbdisp->desc && vbdisp->desc->ctx == ctx)
return invoke_vbdisp(vbdisp, id, flags, FALSE, dp, retv);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
if(FAILED(hres)) {
UINT err = 0;
@ -1107,9 +1113,14 @@ HRESULT get_disp_value(script_ctx_t *ctx, IDispatch *disp, VARIANT *v)
HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *dp)
{
IDispatchEx *dispex;
vbdisp_t *vbdisp;
EXCEPINFO ei = {0};
HRESULT hres;
vbdisp = unsafe_impl_from_IDispatch(disp);
if(vbdisp && vbdisp->desc && vbdisp->desc->ctx == ctx)
return invoke_vbdisp(vbdisp, id, flags, FALSE, dp, NULL);
hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex);
if(SUCCEEDED(hres)) {
hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, NULL, &ei, NULL /* FIXME! */);