Alex Villacís Lasso : oleaut32: Support for VT_DISPATCH in VarMul.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jan 3 05:37:36 CST 2007


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

Author: Alex Villacís Lasso <a_villacis at palosanto.com>
Date:   Tue Jan  2 18:50:41 2007 -0500

oleaut32: Support for VT_DISPATCH in VarMul.

---

 dlls/oleaut32/variant.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index a1102d3..570b299 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -3345,6 +3345,7 @@ HRESULT WINAPI VarMul(LPVARIANT left, LP
     HRESULT hres;
     VARTYPE lvt, rvt, resvt, tvt;
     VARIANT lv, rv, tv;
+    VARIANT tempLeft, tempRight;
     double r8res;
 
     /* Variant priority for coercion. Sorted from lowest to highest.
@@ -3374,6 +3375,23 @@ HRESULT WINAPI VarMul(LPVARIANT left, LP
     VariantInit(&lv);
     VariantInit(&rv);
     VariantInit(&tv);
+    VariantInit(&tempLeft);
+    VariantInit(&tempRight);
+
+    /* Handle VT_DISPATCH by storing and taking address of returned value */
+    if ((V_VT(left) & VT_TYPEMASK) == VT_DISPATCH)
+    {
+        hres = VARIANT_FetchDispatchValue(left, &tempLeft);
+        if (FAILED(hres)) goto end;
+        left = &tempLeft;
+    }
+    if ((V_VT(right) & VT_TYPEMASK) == VT_DISPATCH)
+    {
+        hres = VARIANT_FetchDispatchValue(right, &tempRight);
+        if (FAILED(hres)) goto end;
+        right = &tempRight;
+    }
+
     lvt = V_VT(left)&VT_TYPEMASK;
     rvt = V_VT(right)&VT_TYPEMASK;
 
@@ -3482,6 +3500,8 @@ end:
     VariantClear(&lv);
     VariantClear(&rv);
     VariantClear(&tv);
+    VariantClear(&tempLeft);
+    VariantClear(&tempRight);
     TRACE("returning 0x%8x (variant type %s)\n", hres, debugstr_VT(result));
     return hres;
 }




More information about the wine-cvs mailing list