From 840e00a95751e1a0d150b792b0a8706855ff16e7 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 20 Jan 2020 19:36:49 -0600 Subject: [PATCH 1/2] with help_multikey just display the first result and use the 0 index in the tomap for the contents --- winhlp32/hlpfile.c | 5 ++++- winhlp32/winhelp.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/winhlp32/hlpfile.c b/winhlp32/hlpfile.c index 6c751eed51f..01b4a5ddf65 100644 --- a/winhlp32/hlpfile.c +++ b/winhlp32/hlpfile.c @@ -411,7 +411,10 @@ static HLPFILE_PAGE* HLPFILE_Contents(HLPFILE *hlpfile, ULONG* relative) if (!hlpfile) return NULL; - page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start, relative); + if (hlpfile->version <= 16) + page = HLPFILE_PageByOffset(hlpfile, hlpfile->TOMap[0], relative); + else + page = HLPFILE_PageByOffset(hlpfile, hlpfile->contents_start, relative); if (!page) { page = hlpfile->first_page; diff --git a/winhlp32/winhelp.c b/winhlp32/winhelp.c index 9f163d7e460..000c46bb586 100644 --- a/winhlp32/winhelp.c +++ b/winhlp32/winhelp.c @@ -141,7 +141,7 @@ BOOL WINHELP_SearchKey(char keyfile, LPCSTR keywords, LONG type, LPCSTR topic, L key = strtok(NULL, ";"); } if (!idn) return FALSE; - if ((type != 1) || (idn > 1)) + if (type && ((type != 1) || (idn > 1))) { struct index_data idx; idx.hlpfile = page->file; @@ -558,7 +558,7 @@ static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, WINEHELP *wh, BOOL w32) break; } MULTIKEYHELPA *mkhelp = (MULTIKEYHELPA *)((char *)wh + wh->ofsData); - if (!WINHELP_SearchKey(mkhelp->mkKeylist, mkhelp->szKeyphrase, 1, NULL, NULL, Globals.active_win, hlpfile)) + if (!WINHELP_SearchKey(mkhelp->mkKeylist, mkhelp->szKeyphrase, 0, NULL, NULL, Globals.active_win, hlpfile)) { HLPFILE_FreeHlpFile(hlpfile); if (!WINHELP_HasWorkingWindow()) MACRO_Exit(); From 71c4e4073f4a442e31f0a0025ff73e0dcf875271 Mon Sep 17 00:00:00 2001 From: cracyc Date: Mon, 20 Jan 2020 19:42:29 -0600 Subject: [PATCH 2/2] same for help_key --- winhlp32/winhelp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/winhlp32/winhelp.c b/winhlp32/winhelp.c index 000c46bb586..e6b0cbc8dfb 100644 --- a/winhlp32/winhelp.c +++ b/winhlp32/winhelp.c @@ -532,7 +532,7 @@ static LRESULT WINHELP_HandleCommand(HWND hSrcWnd, WINEHELP *wh, BOOL w32) break; } char *keywords = ((char *)wh + wh->ofsData); - if (!WINHELP_SearchKey('K', keywords, 1, NULL, NULL, Globals.active_win, hlpfile)) + if (!WINHELP_SearchKey('K', keywords, 0, NULL, NULL, Globals.active_win, hlpfile)) { HLPFILE_FreeHlpFile(hlpfile); if (!WINHELP_HasWorkingWindow()) MACRO_Exit();