widl #13: add VT_VARIANT and a couple of fixes

Huw D M Davies h.davies1 at physics.ox.ac.uk
Sat Jan 15 04:57:33 CST 2005


        Huw Davies <huw at codeweavers.com>
        Add VT_VARIANT support
        Fix for the case when there is no helpstringdll
        Fix for parameter arrays

Index: tools/widl/write_msft.c
===================================================================
RCS file: /home/wine/wine/tools/widl/write_msft.c,v
retrieving revision 1.9
diff -u -p -r1.9 write_msft.c
--- tools/widl/write_msft.c	14 Jan 2005 17:20:43 -0000	1.9
+++ tools/widl/write_msft.c	15 Jan 2005 10:53:27 -0000
@@ -752,6 +752,10 @@ static int encode_type(
         *alignment = 4;
         break;
 
+    case VT_VARIANT:
+        *encoded_type = default_type;
+        break;
+
     case VT_PTR:
       {
         int next_vt;
@@ -919,8 +923,9 @@ static int encode_var(
     *decoded_size = 0;
 
     chat("encode_var: var %p var->tname %s var->type %p var->ptr_level %d var->type->ref %p\n", var, var->tname, var->type, var->ptr_level, var->type->ref);
-    if(var->ptr_level--) {
+    if(var->ptr_level) {
         int skip_ptr;
+        var->ptr_level--;
 	skip_ptr = encode_var(typelib, var, &target_type, NULL, NULL, &child_size);
         var->ptr_level++;
 
@@ -1808,7 +1813,10 @@ static int save_all_changes(msft_typelib
     ctl2_finalize_typeinfos(typelib, filepos);
 
     if (!ctl2_write_chunk(fd, &typelib->typelib_header, sizeof(typelib->typelib_header))) return retval;
-    if (!ctl2_write_chunk(fd, &typelib->help_string_dll_offset, sizeof(typelib->help_string_dll_offset))) return retval;    
+    if(typelib->typelib_header.varflags & 0x100)
+        if (!ctl2_write_chunk(fd, &typelib->help_string_dll_offset, sizeof(typelib->help_string_dll_offset)))
+            return retval;
+
     if (!ctl2_write_chunk(fd, typelib->typelib_typeinfo_offsets, typelib->typelib_header.nrtypeinfos * 4)) return retval;
     if (!ctl2_write_chunk(fd, &typelib->typelib_segdir, sizeof(typelib->typelib_segdir))) return retval;
     if (!ctl2_write_segment(typelib, fd, MSFT_SEG_TYPEINFO    )) return retval;



More information about the wine-patches mailing list