Jacek Caban : vbscript: Added interp_set_member implementation.
Alexandre Julliard
julliard at winehq.org
Fri Sep 16 13:28:32 CDT 2011
Module: wine
Branch: master
Commit: a03ad6b2cd4113b4cf1a06614d1037322b2f336c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a03ad6b2cd4113b4cf1a06614d1037322b2f336c
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Sep 16 13:28:42 2011 +0200
vbscript: Added interp_set_member implementation.
---
dlls/vbscript/interp.c | 36 ++++++++++++++++++++++++++++++++++--
dlls/vbscript/tests/lang.vbs | 2 ++
2 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/dlls/vbscript/interp.c b/dlls/vbscript/interp.c
index 7376d93..899d989 100644
--- a/dlls/vbscript/interp.c
+++ b/dlls/vbscript/interp.c
@@ -502,8 +502,40 @@ static HRESULT interp_assign_member(exec_ctx_t *ctx)
static HRESULT interp_set_member(exec_ctx_t *ctx)
{
BSTR identifier = ctx->instr->arg1.bstr;
- FIXME("%s\n", debugstr_w(identifier));
- return E_NOTIMPL;
+ IDispatch *obj, *val;
+ DISPID id;
+ HRESULT hres;
+
+ TRACE("%s\n", debugstr_w(identifier));
+
+ hres = stack_pop_disp(ctx, &obj);
+ if(FAILED(hres))
+ return hres;
+
+ if(!obj) {
+ FIXME("NULL obj\n");
+ return E_FAIL;
+ }
+
+ hres = stack_pop_disp(ctx, &val);
+ if(FAILED(hres)) {
+ IDispatch_Release(obj);
+ return hres;
+ }
+
+ hres = disp_get_id(obj, identifier, VBDISP_SET, FALSE, &id);
+ if(SUCCEEDED(hres)) {
+ VARIANT v;
+
+ V_VT(&v) = VT_DISPATCH;
+ V_DISPATCH(&v) = val;
+ hres = disp_propput(ctx->script, obj, id, &v);
+ }
+
+ if(val)
+ IDispatch_Release(val);
+ IDispatch_Release(obj);
+ return hres;
}
static HRESULT interp_new(exec_ctx_t *ctx)
diff --git a/dlls/vbscript/tests/lang.vbs b/dlls/vbscript/tests/lang.vbs
index 02d4438..20f1f42 100644
--- a/dlls/vbscript/tests/lang.vbs
+++ b/dlls/vbscript/tests/lang.vbs
@@ -462,5 +462,7 @@ Call ok(funcCalled = "gsProp get", "funcCalled = " & funcCalled)
obj.gsProp = 3
Call ok(funcCalled = "gsProp let", "funcCalled = " & funcCalled)
Call ok(obj.getPrivateProp = 3, "obj.getPrivateProp = " & obj.getPrivateProp)
+Set obj.gsProp = New testclass
+Call ok(funcCalled = "gsProp set", "funcCalled = " & funcCalled)
reportSuccess()
More information about the wine-cvs
mailing list