From b101a5c6e5a75964f90657ea1e7b393d8e41ef33 Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Sat, 21 Aug 1999 13:08:27 +0000 Subject: [PATCH] Fixed typelib reading to correctly use the offset of the typelib that is embedded in for example a dll file. --- ole/typelib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ole/typelib.c b/ole/typelib.c index b7a4c22741..107a9f88c5 100644 --- a/ole/typelib.c +++ b/ole/typelib.c @@ -528,7 +528,8 @@ DWORD TLB_Read(void *buffer, DWORD count, TLBContext *pcx, long where ) DWORD bytesread=0; if (( where != DO_NOT_SEEK && - (0xffffffff == SetFilePointer( pcx->hFile, where, 0,FILE_BEGIN)) + (0xffffffff == SetFilePointer( pcx->hFile, where + pcx->oStart, + 0,FILE_BEGIN)) ) || !ReadFile(pcx->hFile, buffer, count, &bytesread, NULL) ) { @@ -1041,6 +1042,7 @@ int TLB_ReadTypeLib(PCHAR file, ITypeLib **ppTypeLib) return E_FAIL; } /* get pointer to beginning of typelib data */ + cx.oStart=0; if((oStart=TLB_FindTlb(&cx))<0){ if(oStart==-1) ERR_(typelib)("cannot locate typelib in %s\n",file);