Module: wine Branch: master Commit: 4c387a9567870173ea3b5c6540fe2d0b8f63fafa URL: http://source.winehq.org/git/wine.git/?a=commit;h=4c387a9567870173ea3b5c6540...
Author: Kirill K. Smirnov lich@math.spbu.ru Date: Wed Aug 6 19:48:03 2008 +0400
winhlp32: Fix offsets handling for old 3.0 files.
---
programs/winhlp32/hlpfile.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c index c941bbd..e54d3bf 100644 --- a/programs/winhlp32/hlpfile.c +++ b/programs/winhlp32/hlpfile.c @@ -283,7 +283,7 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) OFSTRUCT ofs; BYTE* buf; DWORD ref = 0x0C; - unsigned index, old_index, offset, len, offs; + unsigned index, old_index, offset, len, offs, topicoffset;
hFile = OpenFile(lpszPath, &ofs, OF_READ); if (hFile == HFILE_ERROR) return FALSE; @@ -339,7 +339,11 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath) switch (buf[0x14]) { case 0x02: - if (!HLPFILE_AddPage(hlpfile, buf, end, ref, index * 0x8000L + offs)) return FALSE; + if (hlpfile->version <= 16) + topicoffset = ref + index * 12; + else + topicoffset = index * 0x8000 + offs; + if (!HLPFILE_AddPage(hlpfile, buf, end, ref, topicoffset)) return FALSE; break;
case 0x01: