From f52df44c1930e62fa9096f24ba8b1b84765c0e34 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Mon, 25 Jan 2016 15:05:03 +0800
Subject: widl: Set the lowest bit in the param name to indicate whether type
 description follows the name.

It looks like the lowest bit in the param name offset actually indicates
whether type description follows the name, and since the name offsets are
always aligned that makes sense.

This makes oleview.exe from PSDK running under Windows7 correctly show mix
of different very complex and relatively simple type descriptions generated
by widl's SLTG generator.
---
 tools/widl/write_sltg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/widl/write_sltg.c b/tools/widl/write_sltg.c
index acfc039..2ec1770 100644
--- a/tools/widl/write_sltg.c
+++ b/tools/widl/write_sltg.c
@@ -1307,7 +1307,6 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v
             short name, type_offset;
 
             name = base_offset != -1 ? add_name(typelib, arg->name) : -1;
-            append_data(data, &name, sizeof(name));
 
             if (arg_data[i].size > sizeof(short))
             {
@@ -1315,8 +1314,12 @@ static int add_func_desc(struct sltg_typelib *typelib, struct sltg_data *data, v
                 arg_offset += arg_data[i].size;
             }
             else
+            {
+                name |= 1;
                 type_offset = *(short *)arg_data[i].data;
+            }
 
+            append_data(data, &name, sizeof(name));
             append_data(data, &type_offset, sizeof(type_offset));
 
             if (base_offset != -1)
-- 
2.6.4

