Jacek Caban : mshtml: Don' t overwrite type of result if property type is VT_VARIANT.

Alexandre Julliard julliard at winehq.org
Fri Mar 16 14:07:26 CDT 2012


Module: wine
Branch: master
Commit: cfb219f910ab5b057c589b600f042d587d6eab32
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cfb219f910ab5b057c589b600f042d587d6eab32

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Mar 16 18:26:47 2012 +0100

mshtml: Don't overwrite type of result if property type is VT_VARIANT.

---

 dlls/mshtml/dispex.c       |    3 ++-
 dlls/mshtml/tests/script.c |   14 ++++++++++++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/dlls/mshtml/dispex.c b/dlls/mshtml/dispex.c
index 7eff5c6..c42e2ef 100644
--- a/dlls/mshtml/dispex.c
+++ b/dlls/mshtml/dispex.c
@@ -825,7 +825,8 @@ static HRESULT builtin_propget(DispatchEx *This, func_info_t *func, DISPPARAMS *
     if(FAILED(hres))
         return hres;
 
-    V_VT(res) = func->prop_vt == VT_PTR ? VT_DISPATCH : func->prop_vt;
+    if(func->prop_vt != VT_VARIANT)
+        V_VT(res) = func->prop_vt == VT_PTR ? VT_DISPATCH : func->prop_vt;
     return S_OK;
 }
 
diff --git a/dlls/mshtml/tests/script.c b/dlls/mshtml/tests/script.c
index 43c66c6..df391d6 100644
--- a/dlls/mshtml/tests/script.c
+++ b/dlls/mshtml/tests/script.c
@@ -1854,6 +1854,14 @@ static HRESULT dispex_propput(IDispatchEx *obj, DISPID id, DWORD flags, VARIANT
     return IDispatchEx_InvokeEx(obj, id, LOCALE_NEUTRAL, DISPATCH_PROPERTYPUT|flags, &dp, NULL, &ei, caller_sp);
 }
 
+static HRESULT dispex_propget(IDispatchEx *obj, DISPID id, VARIANT *res, IServiceProvider *caller_sp)
+{
+    DISPPARAMS dp = {NULL};
+    EXCEPINFO ei = {0};
+
+    return IDispatchEx_InvokeEx(obj, id, LOCALE_NEUTRAL, DISPATCH_PROPERTYGET, &dp, res, &ei, caller_sp);
+}
+
 static void test_func(IDispatchEx *obj)
 {
     DISPID id;
@@ -1999,6 +2007,12 @@ static void test_arg_conv(IHTMLWindow2 *window)
     CHECK_CALLED(QS_VariantConversion);
     CHECK_CALLED(ChangeType);
 
+    V_VT(&v) = VT_EMPTY;
+    hres = dispex_propget(dispex, DISPID_IHTMLBODYELEMENT_BGCOLOR, &v, &caller_sp);
+    ok(hres == S_OK, "InvokeEx failed: %08x\n", hres);
+    ok(V_VT(&v) == VT_BSTR, "V_VT(var)=%d\n", V_VT(&v));
+    ok(!V_BSTR(&v), "V_BSTR(&var) = %s\n", wine_dbgstr_w(V_BSTR(&v)));
+
     IDispatchEx_Release(dispex);
 }
 




More information about the wine-cvs mailing list