[PATCH 8/9] oleaut32: Add support for named arguments in ITypeInfo::Invoke.

Robert Shearman rob at codeweavers.com
Tue Feb 6 13:25:27 CST 2007


---
  dlls/oleaut32/typelib.c |   26 ++++++++++++++++++++++++--
  1 files changed, 24 insertions(+), 2 deletions(-)
-------------- next part --------------
diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 311cda9..566a756 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5478,6 +5478,29 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
             for (i = 0; i < func_desc->cParams; i++)
             {
                 USHORT wParamFlags = func_desc->lprgelemdescParam[i].u.paramdesc.wParamFlags;
+                VARIANTARG *src_arg;
+
+                if (pDispParams->cNamedArgs)
+                {
+                    USHORT j;
+                    src_arg = NULL;
+                    for (j = 0; j < pDispParams->cNamedArgs; j++)
+                    {
+                        if ((func_desc->invkind & INVOKE_PROPERTYPUT) &&
+                            (pDispParams->rgdispidNamedArgs[j] == DISPID_PROPERTYPUT))
+                        {
+                            src_arg = &pDispParams->rgvarg[0];
+                            break;
+                        }
+                        if (pDispParams->rgdispidNamedArgs[j] == i)
+                        {
+                            src_arg = &pDispParams->rgvarg[j];
+                            break;
+                        }
+                    }
+                }
+                else
+                    src_arg = i < pDispParams->cArgs ? &pDispParams->rgvarg[pDispParams->cArgs - 1 - i] : NULL;
 
                 if (wParamFlags & PARAMFLAG_FRETVAL)
                 {
@@ -5500,9 +5523,8 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
                         break;
                     }
                 }
-                else if (i < pDispParams->cArgs)
+                else if (src_arg)
                 {
-                    VARIANTARG *src_arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - i];
                     dump_Variant(src_arg);
 
                     if (rgvt[i] == VT_VARIANT)


More information about the wine-patches mailing list