Rob Shearman : oleaut32: Fix the missing argument handling for non-byref variant arguments.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 6 15:23:22 CST 2007


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

Author: Rob Shearman <rob at codeweavers.com>
Date:   Tue Feb  6 19:24:12 2007 +0000

oleaut32: Fix the missing argument handling for non-byref variant arguments.

---

 dlls/oleaut32/typelib.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 47f721b..8cd4a79 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5569,11 +5569,20 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
                     }
                     else
                     {
-                        VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams);
-                        V_VT(arg) = VT_VARIANT | VT_BYREF;
-                        V_VARIANTREF(arg) = &missing_arg[i];
-                        V_VT(V_VARIANTREF(arg)) = VT_ERROR;
-                        V_ERROR(V_VARIANTREF(arg)) = DISP_E_PARAMNOTFOUND;
+                        VARIANTARG *missing_arg;
+                        /* if the function wants a pointer to a variant then
+                         * set that up, otherwise just pass the VT_ERROR in
+                         * the argument by value */
+                        if (rgvt[i] & VT_BYREF)
+                        {
+                            missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams) + i;
+                            V_VT(arg) = VT_VARIANT | VT_BYREF;
+                            V_VARIANTREF(arg) = missing_arg;
+                        }
+                        else
+                            missing_arg = arg;
+                        V_VT(missing_arg) = VT_ERROR;
+                        V_ERROR(missing_arg) = DISP_E_PARAMNOTFOUND;
                     }
                 }
                 else




More information about the wine-cvs mailing list