From 61fc6f8cd3b5bfb9221b39bb22bfdc88ce2e4996 Mon Sep 17 00:00:00 2001 From: Huw D M Davies Date: Mon, 10 Jun 2002 23:01:34 +0000 Subject: [PATCH] Add more magic to find the start of the nametable. --- dlls/oleaut32/typelib.c | 22 ++++++++++++++++++---- dlls/oleaut32/typelib.h | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index 83967653dee..9f3968cbc12 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -2920,11 +2920,25 @@ static ITypeLib2* ITypeLib2_Constructor_SLTG(LPVOID pLib, DWORD dwTLBLength) /* 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 + 0x216; + + pNameTable = (char*)pLibBlk + len; + + switch(*(WORD*)pNameTable) { + case 0xffff: + break; + case 0x0200: + pNameTable += 0x20; + break; + default: + FIXME("pNameTable jump = %x\n", *(WORD*)pNameTable); + break; + } + + pNameTable += 0x216; pNameTable += 2; diff --git a/dlls/oleaut32/typelib.h b/dlls/oleaut32/typelib.h index d1032d5297e..9366fe31827 100644 --- a/dlls/oleaut32/typelib.h +++ b/dlls/oleaut32/typelib.h @@ -303,7 +303,7 @@ typedef struct { #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. */ -- 2.11.4.GIT