Guess what this is a patch for...

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Oct 3 11:08:06 CDT 2001


I'm thinking of timestamping my typelib patches...

	Huw D M Davies <hdavies at codeweavers.com>
	Looks like the SLTG_ImplInfo struct isn't a fixed size.
-------------- next part --------------
Index: dlls/oleaut32/typelib.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v
retrieving revision 1.48
diff -u -r1.48 typelib.c
--- dlls/oleaut32/typelib.c	2001/10/02 17:25:55	1.48
+++ dlls/oleaut32/typelib.c	2001/10/03 14:48:59
@@ -2365,11 +2365,19 @@
     dump_TLBRefType(pTI->reflist);
 }
 
-static char *SLTG_DoImpls(SLTG_ImplInfo *info, ITypeInfoImpl *pTI,
+static char *SLTG_DoImpls(char *pBlk, ITypeInfoImpl *pTI,
 			  BOOL OneOnly)
 {
+    SLTG_ImplInfo *info;
     TLBImplType **ppImplType = &pTI->impltypelist;
+    /* I don't really get this structure, usually it's 0x16 bytes
+       long, but iuser.tlb contains some that are 0x18 bytes long.
+       That's ok because we can use the next ptr to jump to the next
+       one. But how do we know the length of the last one?  The WORD
+       at offs 0x8 might be the clue.  For now I'm just assuming that
+       the last one is the regular 0x16 bytes. */
 
+    info = (SLTG_ImplInfo*)pBlk;
     while(1) {
 	*ppImplType = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
 				sizeof(**ppImplType));
@@ -2382,9 +2390,9 @@
 	    break;
 	if(OneOnly)
 	    FIXME("Interface inheriting more than one interface\n");
-	info++;
+	info = (SLTG_ImplInfo*)(pBlk + info->next);
     }
-    info++;
+    info++; /* see comment at top of function */
     return (char*)info;
 }
 
@@ -2406,7 +2414,7 @@
     pFirstItem = pNextItem = (char*)(pMemHeader + 1);
 
     if(*(WORD*)pFirstItem == SLTG_IMPL_MAGIC) {
-        pNextItem = SLTG_DoImpls((SLTG_ImplInfo*)pFirstItem, pTI, FALSE);
+        pNextItem = SLTG_DoImpls(pFirstItem, pTI, FALSE);
     }
 
     return (SLTG_TypeInfoTail*)(pFirstItem + pMemHeader->cbExtra);
@@ -2433,7 +2441,7 @@
     pFirstItem = pNextItem = (char*)(pMemHeader + 1);
 
     if(*(WORD*)pFirstItem == SLTG_IMPL_MAGIC) {
-        pNextItem = SLTG_DoImpls((SLTG_ImplInfo*)pFirstItem, pTI, TRUE);
+        pNextItem = SLTG_DoImpls(pFirstItem, pTI, TRUE);
     }
 
     for(pFunc = (SLTG_Function*)pNextItem, num = 1; 1;


More information about the wine-patches mailing list