From: Jacek Caban Subject: [PATCH 2/7] vbscript: Pass DISPATCH_PROPERTYPUTREF flag to InvokeEx when apropriate. Message-Id: <54F5B9D4.8080707@codeweavers.com> Date: Tue, 03 Mar 2015 14:40:36 +0100 --- dlls/vbscript/interp.c | 14 +++++++------- dlls/vbscript/vbdisp.c | 6 +++--- dlls/vbscript/vbscript.h | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c index 4b45006..d2152cd 100644 --- a/dlls/vbscript/interp.c +++ b/dlls/vbscript/interp.c @@ -709,7 +709,7 @@ static HRESULT interp_mcallv(exec_ctx_t *ctx) return do_mcall(ctx, NULL); } -static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, DISPPARAMS *dp) +static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, WORD flags, DISPPARAMS *dp) { ref_t ref; HRESULT hres; @@ -762,7 +762,7 @@ static HRESULT assign_ident(exec_ctx_t *ctx, BSTR name, DISPPARAMS *dp) break; } case REF_DISP: - hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, dp); + hres = disp_propput(ctx->script, ref.u.d.disp, ref.u.d.id, flags, dp); break; case REF_FUNC: FIXME("functions not implemented\n"); @@ -805,7 +805,7 @@ static HRESULT interp_assign_ident(exec_ctx_t *ctx) return hres; vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = assign_ident(ctx, arg, &dp); + hres = assign_ident(ctx, arg, DISPATCH_PROPERTYPUT, &dp); if(FAILED(hres)) return hres; @@ -832,7 +832,7 @@ static HRESULT interp_set_ident(exec_ctx_t *ctx) return hres; vbstack_to_dp(ctx, 0, TRUE, &dp); - hres = assign_ident(ctx, ctx->instr->arg1.bstr, &dp); + hres = assign_ident(ctx, ctx->instr->arg1.bstr, DISPATCH_PROPERTYPUTREF, &dp); if(FAILED(hres)) return hres; @@ -867,7 +867,7 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx) hres = disp_get_id(obj, identifier, VBDISP_LET, FALSE, &id); if(SUCCEEDED(hres)) { vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = disp_propput(ctx->script, obj, id, &dp); + hres = disp_propput(ctx->script, obj, id, DISPATCH_PROPERTYPUT, &dp); } if(FAILED(hres)) return hres; @@ -908,7 +908,7 @@ static HRESULT interp_set_member(exec_ctx_t *ctx) hres = disp_get_id(obj, identifier, VBDISP_SET, FALSE, &id); if(SUCCEEDED(hres)) { vbstack_to_dp(ctx, arg_cnt, TRUE, &dp); - hres = disp_propput(ctx->script, obj, id, &dp); + hres = disp_propput(ctx->script, obj, id, DISPATCH_PROPERTYPUTREF, &dp); } if(FAILED(hres)) return hres; @@ -1176,7 +1176,7 @@ static HRESULT interp_enumnext(exec_ctx_t *ctx) return hres; do_continue = hres == S_OK; - hres = assign_ident(ctx, ident, &dp); + hres = assign_ident(ctx, ident, DISPATCH_PROPERTYPUT|DISPATCH_PROPERTYPUTREF, &dp); VariantClear(&v); if(FAILED(hres)) return hres; diff --git a/dlls/vbscript/vbdisp.c b/dlls/vbscript/vbdisp.c index c9d318e..18ba966 100644 --- a/dlls/vbscript/vbdisp.c +++ b/dlls/vbscript/vbdisp.c @@ -1070,7 +1070,7 @@ HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp, return hres; } -HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp) +HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, WORD flags, DISPPARAMS *dp) { IDispatchEx *dispex; EXCEPINFO ei = {0}; @@ -1078,13 +1078,13 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS * hres = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (void**)&dispex); if(SUCCEEDED(hres)) { - hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, NULL /* FIXME! */); + hres = IDispatchEx_InvokeEx(dispex, id, ctx->lcid, flags, dp, NULL, &ei, NULL /* FIXME! */); IDispatchEx_Release(dispex); }else { ULONG err = 0; TRACE("using IDispatch\n"); - hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, DISPATCH_PROPERTYPUT, dp, NULL, &ei, &err); + hres = IDispatch_Invoke(disp, id, &IID_NULL, ctx->lcid, flags, dp, NULL, &ei, &err); } return hres; diff --git a/dlls/vbscript/vbscript.h b/dlls/vbscript/vbscript.h index d1f35be..cbb90ce 100644 --- a/dlls/vbscript/vbscript.h +++ b/dlls/vbscript/vbscript.h @@ -148,7 +148,7 @@ 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,DISPPARAMS*) DECLSPEC_HIDDEN; +HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,WORD,DISPPARAMS*) 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;