[PATCH 3/3] oleaut32: Only copy previous function name if both are property accessors

Andrew Eikum aeikum at codeweavers.com
Tue Jun 4 08:18:58 CDT 2013


---
 dlls/oleaut32/typelib.c | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 843283a..b38243c 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -2240,6 +2240,13 @@ static void MSFT_ResolveReferencedTypes(TLBContext *pcx, ITypeInfoImpl *pTI, TYP
     }
 }
 
+static int TLB_is_propgetput(INVOKEKIND invkind)
+{
+    return (invkind == INVOKE_PROPERTYGET ||
+        invkind == INVOKE_PROPERTYPUT ||
+        invkind == INVOKE_PROPERTYPUTREF);
+}
+
 static void
 MSFT_DoFuncs(TLBContext*     pcx,
 	    ITypeInfoImpl*  pTI,
@@ -2294,13 +2301,6 @@ MSFT_DoFuncs(TLBContext*     pcx,
         MSFT_ReadLEDWords(&nameoffset, sizeof(INT), pcx,
                           offset + infolen + (cFuncs + cVars + i + 1) * sizeof(INT));
 
-        /* nameoffset is sometimes -1 on the second half of a propget/propput
-         * pair of functions */
-        if ((nameoffset == -1) && (i > 0))
-            ptfd->Name = ptfd_prev->Name;
-        else
-            ptfd->Name = MSFT_ReadName(pcx, nameoffset);
-
         /* read the function information record */
         MSFT_ReadLEDWords(&reclength, sizeof(pFuncRec->Info), pcx, recoffset);
 
@@ -2351,6 +2351,15 @@ MSFT_DoFuncs(TLBContext*     pcx,
         ptfd->funcdesc.oVft       =   pFuncRec->VtableOffset & ~1;
         ptfd->funcdesc.wFuncFlags =   LOWORD(pFuncRec->Flags) ;
 
+        /* nameoffset is sometimes -1 on the second half of a propget/propput
+         * pair of functions */
+        if ((nameoffset == -1) && (i > 0) &&
+                TLB_is_propgetput(ptfd_prev->funcdesc.invkind) &&
+                TLB_is_propgetput(ptfd->funcdesc.invkind))
+            ptfd->Name = ptfd_prev->Name;
+        else
+            ptfd->Name = MSFT_ReadName(pcx, nameoffset);
+
         MSFT_GetTdesc(pcx,
 		      pFuncRec->DataType,
 		      &ptfd->funcdesc.elemdescFunc.tdesc,
-- 
1.8.3




More information about the wine-patches mailing list