diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl.c b/reactos/dll/win32/hhctrl.ocx/hhctrl.c index a73d0789638..5e97c8cbdd8 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl.c +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl.c @@ -188,7 +188,20 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat case HH_DISPLAY_TOPIC: case HH_DISPLAY_TOC: if (data) - index = (const WCHAR *)data; + { + static const WCHAR delimW[] = {':',':',0}; + const WCHAR *i = (const WCHAR *)data; + + index = strstrW(i, delimW); + if(index) + { + if(memcmp(info->pCHMInfo->szFile, i, index-i)) + FIXME("Opening a CHM file in the context of another is not supported.\n"); + index += strlenW(delimW); + } + else + index = i; + } break; } @@ -258,6 +271,8 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat url = FindContextAlias(info->pCHMInfo, data); if(!url) { + if(!data) /* there may legitimately be no context alias for id 0 */ + return info->WinType.hwndHelp; ReleaseHelpViewer(info); return NULL; } diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl b/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl index c2f8a242b6b..58a4b1e80d1 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl_tlb.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep regtypelib + import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl"; diff --git a/reactos/dll/win32/hhctrl.ocx/stream.c b/reactos/dll/win32/hhctrl.ocx/stream.c index 828c8d43dc2..cdefef7af84 100644 --- a/reactos/dll/win32/hhctrl.ocx/stream.c +++ b/reactos/dll/win32/hhctrl.ocx/stream.c @@ -105,12 +105,52 @@ BOOL next_content(stream_t *stream, strbuf_t *buf) return TRUE; } +static BOOL find_node_end(stream_t *stream, strbuf_t *buf) +{ + int tag_count = 0, b = buf->len; + char *p; + + while(1) + { + if(!stream_chr(stream, buf, '>')) + return FALSE; + if(buf->len == 0) + break; + p = &buf->buf[b]; + while((p = memchr(p+1, '"', buf->len-(p-buf->buf))) != NULL) + tag_count++; + b = buf->len; + if(tag_count % 2 != 0) + { + if(!stream_chr(stream, buf, '"')) + return FALSE; + tag_count++; + } + else + break; + } + return TRUE; +} + BOOL next_node(stream_t *stream, strbuf_t *buf) { + strbuf_t tmpbuf; + + /* search through the end of the current node */ + strbuf_init(&tmpbuf); + if(!find_node_end(stream, &tmpbuf)) + { + strbuf_free(&tmpbuf); + return FALSE; + } + strbuf_free(&tmpbuf); + + /* find the beginning of the next node */ if(!stream_chr(stream, NULL, '<')) return FALSE; - if(!stream_chr(stream, buf, '>')) + /* read out the data of the next node */ + if(!find_node_end(stream, buf)) return FALSE; strbuf_append(buf, ">", 2); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 89cfc8657e2..b162b26dc8d 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -75,7 +75,7 @@ reactos/dll/win32/dwmapi # Synced to Wine-1.7.17 reactos/dll/win32/faultrep # Synced to Wine-1.7.1 reactos/dll/win32/fusion # Synced to Wine-1.7.1 reactos/dll/win32/gdiplus # Synced to Wine-1.7.17 -reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.1 +reactos/dll/win32/hhctrl.ocx # Synced to Wine-1.7.17 reactos/dll/win32/hlink # Synced to Wine-1.7.1 reactos/dll/win32/hnetcfg # Synced to Wine-1.7.1 reactos/dll/win32/httpapi # Synced to Wine-1.7.1