Alex Villací­s Lasso wrote:
Here is a patch that implements my hunch. This patch fixes the problem on both my test app at bug #6638 and the tax app I try to run.

There are a lot of wrong ways to fix the particular bug you are looking at, but only one right way. If you have a doubt, then you should write a test program.

Anyway, does the attached patch fix the test app for you?

--
Rob Shearman

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index a12deb1..263d2c2 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5562,11 +5562,15 @@ 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;
+                        if (rgvt[i] == (VT_VARIANT | VT_BYREF))
+                        {
+                            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];
+                            arg = &missing_arg[i];
+                        }
+                        V_VT(arg) = VT_ERROR;
+                        V_ERROR(arg) = DISP_E_PARAMNOTFOUND;
                     }
                 }
                 else
-- 
1.4.4.rc2



Reply via email to