winhelp: Read keywords.
This commit is contained in:
parent
af21361dbf
commit
6a2ad1b479
|
@ -86,6 +86,7 @@ static BOOL HLPFILE_UncompressLZ77_Phrases(HLPFILE*);
|
||||||
static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE*);
|
static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE*);
|
||||||
static BOOL HLPFILE_Uncompress_Topic(HLPFILE*);
|
static BOOL HLPFILE_Uncompress_Topic(HLPFILE*);
|
||||||
static BOOL HLPFILE_GetContext(HLPFILE*);
|
static BOOL HLPFILE_GetContext(HLPFILE*);
|
||||||
|
static BOOL HLPFILE_GetKeywords(HLPFILE*);
|
||||||
static BOOL HLPFILE_GetMap(HLPFILE*);
|
static BOOL HLPFILE_GetMap(HLPFILE*);
|
||||||
static BOOL HLPFILE_AddPage(HLPFILE*, BYTE*, BYTE*, unsigned);
|
static BOOL HLPFILE_AddPage(HLPFILE*, BYTE*, BYTE*, unsigned);
|
||||||
static BOOL HLPFILE_AddParagraph(HLPFILE*, BYTE *, BYTE*, unsigned*);
|
static BOOL HLPFILE_AddParagraph(HLPFILE*, BYTE *, BYTE*, unsigned*);
|
||||||
|
@ -393,6 +394,7 @@ static BOOL HLPFILE_DoReadHlpFile(HLPFILE *hlpfile, LPCSTR lpszPath)
|
||||||
ref = GET_UINT(buf, 0xc);
|
ref = GET_UINT(buf, 0xc);
|
||||||
} while (ref != 0xffffffff);
|
} while (ref != 0xffffffff);
|
||||||
|
|
||||||
|
HLPFILE_GetKeywords(hlpfile);
|
||||||
HLPFILE_GetMap(hlpfile);
|
HLPFILE_GetMap(hlpfile);
|
||||||
if (hlpfile->version <= 16) return TRUE;
|
if (hlpfile->version <= 16) return TRUE;
|
||||||
return HLPFILE_GetContext(hlpfile);
|
return HLPFILE_GetContext(hlpfile);
|
||||||
|
@ -2024,6 +2026,39 @@ static BOOL HLPFILE_GetContext(HLPFILE *hlpfile)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
*
|
||||||
|
* HLPFILE_GetKeywords
|
||||||
|
*/
|
||||||
|
static BOOL HLPFILE_GetKeywords(HLPFILE *hlpfile)
|
||||||
|
{
|
||||||
|
BYTE *cbuf, *cend;
|
||||||
|
unsigned clen;
|
||||||
|
|
||||||
|
if (!HLPFILE_FindSubFile("|KWBTREE", &cbuf, &cend)) return FALSE;
|
||||||
|
clen = cend - cbuf;
|
||||||
|
hlpfile->kwbtree = HeapAlloc(GetProcessHeap(), 0, clen);
|
||||||
|
if (!hlpfile->kwbtree) return FALSE;
|
||||||
|
memcpy(hlpfile->kwbtree, cbuf, clen);
|
||||||
|
|
||||||
|
if (!HLPFILE_FindSubFile("|KWDATA", &cbuf, &cend))
|
||||||
|
{
|
||||||
|
WINE_ERR("corrupted help file: kwbtree present but kwdata absent\n");
|
||||||
|
HeapFree(GetProcessHeap(), 0, hlpfile->kwbtree);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
clen = cend - cbuf;
|
||||||
|
hlpfile->kwdata = HeapAlloc(GetProcessHeap(), 0, clen);
|
||||||
|
if (!hlpfile->kwdata)
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(), 0, hlpfile->kwdata);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
memcpy(hlpfile->kwdata, cbuf, clen);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
*
|
*
|
||||||
* HLPFILE_GetMap
|
* HLPFILE_GetMap
|
||||||
|
|
|
@ -124,6 +124,8 @@ typedef struct tagHlpFileFile
|
||||||
HLPFILE_PAGE* first_page;
|
HLPFILE_PAGE* first_page;
|
||||||
HLPFILE_MACRO* first_macro;
|
HLPFILE_MACRO* first_macro;
|
||||||
BYTE* Context;
|
BYTE* Context;
|
||||||
|
BYTE* kwbtree;
|
||||||
|
BYTE* kwdata;
|
||||||
unsigned wMapLen;
|
unsigned wMapLen;
|
||||||
HLPFILE_MAP* Map;
|
HLPFILE_MAP* Map;
|
||||||
unsigned long contents_start;
|
unsigned long contents_start;
|
||||||
|
|
Loading…
Reference in New Issue