Improvement for v1 typelibs

Huw D M Davies h.davies1 at physics.ox.ac.uk
Mon Jun 10 17:37:35 CDT 2002


	Huw D M Davies <h.davies1 at physics.ox.ac.uk>
	Add more magic to find the start of the nametable.

Licence: LGPL.
-------------- next part --------------
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.70
diff -u -r1.70 typelib.c
--- dlls/oleaut32/typelib.c	4 Jun 2002 00:50:11 -0000	1.70
+++ dlls/oleaut32/typelib.c	10 Jun 2002 22:32:08 -0000
@@ -2884,11 +2884,25 @@
     /* Skip this WORD and get the next DWORD */
     len = *(DWORD*)(pAfterOTIBlks + 2);
 
-    /* Now add this to pLibBLk and then add 0x216, sprinkle a bit a
-       magic dust and we should be pointing at the beginning of the name
+    /* Now add this to pLibBLk look at what we're pointing at and
+       possibly add 0x20, then add 0x216, sprinkle a bit a magic
+       dust and we should be pointing at the beginning of the name
        table */
+ 
+    pNameTable = (char*)pLibBlk + len;
 
-    pNameTable = (char*)pLibBlk + len + 0x216;
+   switch(*(WORD*)pNameTable) {
+   case 0xffff:
+       break;
+   case 0x0200:
+       pNameTable += 0x20;
+       break;
+   default:
+       FIXME("pNameTable jump = %x\n", *(WORD*)pNameTable);
+       break;
+   }
+
+    pNameTable += 0x216;
 
     pNameTable += 2;
 
Index: dlls/oleaut32/typelib.h
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.h,v
retrieving revision 1.10
diff -u -r1.10 typelib.h
--- dlls/oleaut32/typelib.h	31 May 2002 23:25:50 -0000	1.10
+++ dlls/oleaut32/typelib.h	10 Jun 2002 22:32:08 -0000
@@ -303,7 +303,7 @@
 #define SLTG_DIR_MAGIC "dir"
 
 /* Next we have SLTG_Header.nrOfFileBlks - 2 of Index strings.  These
-are persumbably unique to within the file and look something like
+are presumably unique to within the file and look something like
 "AAAAAAAAAA" with the first character incremented from 'A' to ensure
 uniqueness.  I guess successive chars increment when we need to wrap
 the first one. */


More information about the wine-patches mailing list