oleview: Account for unnamed right hand side parameter of propput.

Misha Koshelev mk144210 at bcm.tmc.edu
Thu Feb 22 00:39:52 CST 2007


Okay, so while my previous patch stopped oleview from crashing on
viewing the native MSI type library (or any type library with a propput,
which has the "right-hand side" of the expression, the value the
property is being set to, as an unnamed parameter, which my previous
patch just happily ignored), this patch will show that parameter's type
correctly with the name "rhs" (which is what native oleview seems to
do). I believe this to be a proper fix for the problem.

Changelog:

	* oleview: Account for unnamed right hand side parameter of propput.
-------------- next part --------------
From b9a053ec744676649a24c4b07cb9154b70cddae0 Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at bcm.tmc.edu>
Date: Thu, 22 Feb 2007 00:35:34 -0600
Subject: oleview: Account for unnamed right hand side parameter of propput.
---
 programs/oleview/typelib.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c
index 91c1775..c452343 100644
--- a/programs/oleview/typelib.c
+++ b/programs/oleview/typelib.c
@@ -437,6 +437,7 @@ int EnumFuncs(ITypeInfo *pTypeInfo, int 
     BSTR bstrName, *bstrParamNames;
     WCHAR wszText[MAX_LOAD_STRING];
     WCHAR wszAfter[MAX_LOAD_STRING];
+    WCHAR szRhs[] = {'r','h','s',0};    /* Right-hand side of a propput */
     BOOL bFirst;
 
     U(tvis).item.mask = TVIF_TEXT|TVIF_PARAM;
@@ -531,10 +532,10 @@ int EnumFuncs(ITypeInfo *pTypeInfo, int 
         AddToTLDataStrW(tld, bstrName);
         AddToTLDataStrW(tld, wszOpenBrackets2);
 
-        for(j=0; j<namesNo-1; j++)
+        for(j=0; j<pFuncDesc->cParams; j++)
         {
             if(j != 0) AddToTLDataStrW(tld, wszComa);
-            if(namesNo-1 != 1)
+            if(pFuncDesc->cParams != 1)
             {
                 AddToTLDataStrW(tld, wszNewLine);
                 AddSpaces(tld, tabSize);
@@ -574,8 +575,12 @@ #define ENUM_PARAM_FLAG(x)\
             AddToTLDataStrW(tld, wszText);
             AddToTLDataStrW(tld, wszAfter);
             AddToTLDataStrW(tld, wszSpace);
-            AddToTLDataStrW(tld, bstrParamNames[j+1]);
-            SysFreeString(bstrParamNames[j+1]);
+            if (j+1 < namesNo) {
+                AddToTLDataStrW(tld, bstrParamNames[j+1]);
+                SysFreeString(bstrParamNames[j+1]);
+            } else {
+                AddToTLDataStrW(tld, szRhs);
+            }
         }
         AddToTLDataStrW(tld, wszCloseBrackets2);
         AddToTLDataStrW(tld, wszSemicolon);
-- 
1.4.1



More information about the wine-patches mailing list