Commit b101a5c6 authored by Rein Klazes's avatar Rein Klazes Committed by Alexandre Julliard

Fixed typelib reading to correctly use the offset of the typelib that

is embedded in for example a dll file.
parent 3e473f3e
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment