[1/4] oleview: Report default values.

Misha Koshelev mk144210 at bcm.tmc.edu
Sun Feb 25 01:35:10 CST 2007


This is the first of my four patches to oleview (I will also likely be
sending a fifth one tomorrow dealing with safearrays). Basically I was
forced to go to a native oleview to get the type interface for MSI and I
don't think this is necessary at all. These patches add/fix a few things
so that wine's oleview can produce a valid .tlb file.

Changelog:

	* oleview: Report default values.
-------------- next part --------------
From 66db2db481308dce9e60f4dbfbbe8dfd54ce05cb Mon Sep 17 00:00:00 2001
From: Misha Koshelev <mk144210 at bcm.tmc.edu>
Date: Sun, 25 Feb 2007 00:10:49 -0600
Subject: oleview: Report default values.
---
 programs/oleview/typelib.c |   29 ++++++++++++++++++++++++++---
 1 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/programs/oleview/typelib.c b/programs/oleview/typelib.c
index c452343..4f5b59e 100644
--- a/programs/oleview/typelib.c
+++ b/programs/oleview/typelib.c
@@ -87,10 +87,10 @@ static const WCHAR wszPARAMFLAG_FOUT[] =
 static const WCHAR wszPARAMFLAG_FLCID[] = { 'c','i','d','\0' };
 static const WCHAR wszPARAMFLAG_FRETVAL[] = { 'r','e','t','v','a','l','\0' };
 static const WCHAR wszPARAMFLAG_FOPT[] = { 'o','p','t','\0' };
-static const WCHAR wszPARAMFLAG_FHASDEFAULT[]
-    = { 'h','a','s','d','e','f','a','u','l','t','\0' };
 static const WCHAR wszPARAMFLAG_FHASCUSTDATA[]
     = { 'h','a','s','c','u','s','t','d','a','t','a','\0' };
+static const WCHAR wszDefaultValue[]
+    = { 'd','e','f','a','u','l','t','v','a','l','u','e','\0' };
 
 static const WCHAR wszReadOnly[] = { 'r','e','a','d','o','n','l','y','\0' };
 
@@ -559,9 +559,32 @@ #define ENUM_PARAM_FLAG(x)\
             ENUM_PARAM_FLAG(PARAMFLAG_FLCID);
             ENUM_PARAM_FLAG(PARAMFLAG_FRETVAL);
             ENUM_PARAM_FLAG(PARAMFLAG_FOPT);
-            ENUM_PARAM_FLAG(PARAMFLAG_FHASDEFAULT);
             ENUM_PARAM_FLAG(PARAMFLAG_FHASCUSTDATA);
 
+            if(U(pFuncDesc->lprgelemdescParam[j]).paramdesc.wParamFlags & PARAMFLAG_FHASDEFAULT) 
+            {
+		VARIANT var, *param=&U(pFuncDesc->lprgelemdescParam[j]).paramdesc.pparamdescex->varDefaultValue;
+		VariantInit(&var);
+                if(bFirst) AddToTLDataStrW(tld,
+                        wszOpenBrackets1);
+                else
+                {
+                    AddToTLDataStrW(tld, wszComa);
+                    AddToTLDataStrW(tld, wszSpace);
+                }
+                bFirst = FALSE;
+                AddToTLDataStrW(tld, wszDefaultValue);
+                AddToTLDataStrW(tld, wszOpenBrackets2);
+		if (V_VT(param) == VT_BSTR)
+		{
+		    AddToTLDataStrW(tld, wszInvertedComa);
+		    AddToTLDataStrW(tld, V_BSTR(&var));
+		    AddToTLDataStrW(tld, wszInvertedComa);
+		} else if (VariantChangeType(&var, param, 0, VT_BSTR) == S_OK) 
+		    AddToTLDataStrW(tld, V_BSTR(&var));
+                AddToTLDataStrW(tld, wszCloseBrackets2);
+            }
+
             if(!bFirst)
             {
                 AddToTLDataStrW(tld, wszCloseBrackets1);
-- 
1.4.1



More information about the wine-patches mailing list