widl #20: don't write [local] functions

Huw D M Davies h.davies1 at physics.ox.ac.uk
Fri Jan 21 06:49:01 CST 2005


        Huw Davies <huw at codeweavers.com>
        [local] functions should not be written to the typelib.
-- 
Huw Davies
huw at codeweavers.com
Index: tools/widl/write_msft.c
===================================================================
RCS file: /home/wine/wine/tools/widl/write_msft.c,v
retrieving revision 1.15
diff -u -p -r1.15 write_msft.c
--- tools/widl/write_msft.c	20 Jan 2005 20:33:48 -0000	1.15
+++ tools/widl/write_msft.c	21 Jan 2005 12:46:43 -0000
@@ -1139,11 +1139,11 @@ static HRESULT set_custdata(msft_typelib
     return S_OK;
 }
 
-static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func)
+static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, func_t *func, int index)
 {
     int offset;
     int *typedata;
-    int i, index = func->idx, id;
+    int i, id;
     int decoded_size, extra_attr = 0;
     int num_params = 0, num_defaults = 0;
     var_t *arg, *last_arg = NULL;
@@ -1155,8 +1155,15 @@ static HRESULT add_func_desc(msft_typein
 
     id = ((0x6000 | typeinfo->typeinfo->cImplTypes) << 16) | index;
 
-    chat("(%p,%d)\n", typeinfo, index);
-    
+    chat("add_func_desc(%p,%d)\n", typeinfo, index);
+
+    for(attr = func->def->attrs; attr; attr = NEXT_LINK(attr)) {
+        if(attr->type == ATTR_LOCAL) {
+            chat("add_func_desc: skipping local function\n");
+            return S_FALSE;
+        }
+    }
+
     if (!typeinfo->typedata) {
 	typeinfo->typedata = xmalloc(0x2000);
 	typeinfo->typedata[0] = 0;
@@ -1950,10 +1957,8 @@ int create_msft_typelib(typelib_t *typel
             func_t *cur = entry->u.interface->funcs;
             while(NEXT_LINK(cur)) cur = NEXT_LINK(cur);
             while(cur) {
-                if(cur->idx == -1) cur->idx = idx;
-                else if(cur->idx != idx) error("method index mismatch\n");
-                add_func_desc(msft_typeinfo, cur);
-                idx++;
+                if(add_func_desc(msft_typeinfo, cur, idx) == S_OK)
+                    idx++;
                 cur = PREV_LINK(cur);
             }
             break;



More information about the wine-patches mailing list