mirror of
https://github.com/reactos/reactos.git
synced 2025-02-21 16:04:57 +00:00
[HHCTRL.OCX] Sync with Wine Staging 4.18. CORE-16441
This commit is contained in:
parent
7046ddd63c
commit
6cbb644524
8 changed files with 75 additions and 67 deletions
|
@ -228,11 +228,11 @@ static WCHAR *FindHTMLHelpSetting(HHInfo *info, const WCHAR *extW)
|
|||
WCHAR *filename;
|
||||
HRESULT hr;
|
||||
|
||||
filename = heap_alloc( (strlenW(info->pCHMInfo->compiledFile)
|
||||
+ strlenW(periodW) + strlenW(extW) + 1) * sizeof(WCHAR) );
|
||||
strcpyW(filename, info->pCHMInfo->compiledFile);
|
||||
strcatW(filename, periodW);
|
||||
strcatW(filename, extW);
|
||||
filename = heap_alloc( (lstrlenW(info->pCHMInfo->compiledFile)
|
||||
+ lstrlenW(periodW) + lstrlenW(extW) + 1) * sizeof(WCHAR) );
|
||||
lstrcpyW(filename, info->pCHMInfo->compiledFile);
|
||||
lstrcatW(filename, periodW);
|
||||
lstrcatW(filename, extW);
|
||||
hr = IStorage_OpenStream(pStorage, filename, NULL, STGM_READ, 0, &pStream);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
|
@ -483,11 +483,11 @@ LPCWSTR skip_schema(LPCWSTR url)
|
|||
static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
|
||||
static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
|
||||
|
||||
if(!strncmpiW(its_schema, url, ARRAY_SIZE(its_schema)))
|
||||
if(!_wcsnicmp(its_schema, url, ARRAY_SIZE(its_schema)))
|
||||
return url + ARRAY_SIZE(its_schema);
|
||||
if(!strncmpiW(msits_schema, url, ARRAY_SIZE(msits_schema)))
|
||||
if(!_wcsnicmp(msits_schema, url, ARRAY_SIZE(msits_schema)))
|
||||
return url + ARRAY_SIZE(msits_schema);
|
||||
if(!strncmpiW(mk_schema, url, ARRAY_SIZE(mk_schema)))
|
||||
if(!_wcsnicmp(mk_schema, url, ARRAY_SIZE(mk_schema)))
|
||||
return url + ARRAY_SIZE(mk_schema);
|
||||
|
||||
return url;
|
||||
|
@ -500,15 +500,15 @@ void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
|
|||
|
||||
path = skip_schema(path);
|
||||
|
||||
ptr = strstrW(path, separatorW);
|
||||
ptr = wcsstr(path, separatorW);
|
||||
if(ptr) {
|
||||
WCHAR chm_file[MAX_PATH];
|
||||
WCHAR rel_path[MAX_PATH];
|
||||
WCHAR base_path[MAX_PATH];
|
||||
LPWSTR p;
|
||||
|
||||
strcpyW(base_path, base_file);
|
||||
p = strrchrW(base_path, '\\');
|
||||
lstrcpyW(base_path, base_file);
|
||||
p = wcsrchr(base_path, '\\');
|
||||
if(p)
|
||||
*p = 0;
|
||||
|
||||
|
@ -595,7 +595,7 @@ WCHAR *GetDocumentTitle(CHMInfo *info, LPCWSTR document)
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "title")) {
|
||||
if(!_strnicmp(node_name.buf, "title", -1)) {
|
||||
if(next_content(&stream, &content) && content.len > 1)
|
||||
{
|
||||
document_title = strdupnAtoW(&content.buf[1], content.len-1);
|
||||
|
|
|
@ -62,11 +62,11 @@ static void parse_obj_node_param(ContentItem *item, ContentItem *hhc_root, const
|
|||
return;
|
||||
}
|
||||
|
||||
if(!strncasecmp("name", ptr, len)) {
|
||||
if(!_strnicmp("name", ptr, len)) {
|
||||
param = &item->name;
|
||||
}else if(!strncasecmp("merge", ptr, len)) {
|
||||
}else if(!_strnicmp("merge", ptr, len)) {
|
||||
param = &merge;
|
||||
}else if(!strncasecmp("local", ptr, len)) {
|
||||
}else if(!_strnicmp("local", ptr, len)) {
|
||||
param = &item->local;
|
||||
}else {
|
||||
WARN("unhandled param %s\n", debugstr_an(ptr, len));
|
||||
|
@ -148,9 +148,9 @@ static ContentItem *parse_sitemap_object(HHInfo *info, stream_t *stream, Content
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "/object"))
|
||||
if(!_strnicmp(node_name.buf, "/object", -1))
|
||||
break;
|
||||
if(!strcasecmp(node_name.buf, "param"))
|
||||
if(!_strnicmp(node_name.buf, "param", -1))
|
||||
parse_obj_node_param(item, hhc_root, node.buf, info->pCHMInfo->codePage);
|
||||
|
||||
strbuf_zero(&node);
|
||||
|
@ -195,7 +195,7 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "object")) {
|
||||
if(!_strnicmp(node_name.buf, "object", -1)) {
|
||||
const char *ptr;
|
||||
int len;
|
||||
|
||||
|
@ -210,10 +210,10 @@ static ContentItem *parse_ul(HHInfo *info, stream_t *stream, ContentItem *hhc_ro
|
|||
if(!ret)
|
||||
ret = prev;
|
||||
}
|
||||
}else if(!strcasecmp(node_name.buf, "ul")) {
|
||||
}else if(!_strnicmp(node_name.buf, "ul", -1)) {
|
||||
new_item = parse_ul(info, stream, hhc_root);
|
||||
insert_item(prev, new_item, INSERT_CHILD);
|
||||
}else if(!strcasecmp(node_name.buf, "/ul")) {
|
||||
}else if(!_strnicmp(node_name.buf, "/ul", -1)) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -245,7 +245,7 @@ static ContentItem *parse_hhc(HHInfo *info, IStream *str, ContentItem *hhc_root,
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "ul")) {
|
||||
if(!_strnicmp(node_name.buf, "ul", -1)) {
|
||||
ContentItem *item = parse_ul(info, &stream, hhc_root);
|
||||
prev = insert_item(prev, item, INSERT_CHILD);
|
||||
if(!ret)
|
||||
|
@ -268,7 +268,7 @@ static void insert_content_item(HWND hwnd, ContentItem *parent, ContentItem *ite
|
|||
|
||||
memset(&tvis, 0, sizeof(tvis));
|
||||
tvis.u.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
|
||||
tvis.u.item.cchTextMax = strlenW(item->name)+1;
|
||||
tvis.u.item.cchTextMax = lstrlenW(item->name)+1;
|
||||
tvis.u.item.pszText = item->name;
|
||||
tvis.u.item.lParam = (LPARAM)item;
|
||||
tvis.u.item.iImage = item->child ? HHTV_FOLDER : HHTV_DOCUMENT;
|
||||
|
|
|
@ -216,7 +216,7 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
|
|||
|
||||
TRACE("%s\n", debugstr_w(surl));
|
||||
|
||||
if (strstrW(surl, url_indicator)) {
|
||||
if (wcsstr(surl, url_indicator)) {
|
||||
hres = navigate_url(info, surl);
|
||||
if(SUCCEEDED(hres))
|
||||
return TRUE;
|
||||
|
@ -288,7 +288,7 @@ static void DoSync(HHInfo *info)
|
|||
static const WCHAR delimW[] = {':',':','/',0};
|
||||
const WCHAR *index;
|
||||
|
||||
index = strstrW(url, delimW);
|
||||
index = wcsstr(url, delimW);
|
||||
|
||||
if (index)
|
||||
ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
|
||||
|
@ -639,7 +639,7 @@ static LRESULT OnTopicChange(HHInfo *info, void *user_data)
|
|||
memset(&lvi, 0, sizeof(lvi));
|
||||
lvi.iItem = i;
|
||||
lvi.mask = LVIF_TEXT|LVIF_PARAM;
|
||||
lvi.cchTextMax = strlenW(name)+1;
|
||||
lvi.cchTextMax = lstrlenW(name)+1;
|
||||
lvi.pszText = name;
|
||||
lvi.lParam = (LPARAM) item;
|
||||
SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
|
||||
|
@ -1025,7 +1025,7 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo)
|
|||
for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
|
||||
{
|
||||
LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
|
||||
DWORD dwLen = strlenW(szBuf);
|
||||
DWORD dwLen = lstrlenW(szBuf);
|
||||
szBuf[dwLen + 1] = 0; /* Double-null terminate */
|
||||
|
||||
buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
|
||||
|
@ -1958,7 +1958,7 @@ HHInfo *find_window(const WCHAR *window)
|
|||
|
||||
LIST_FOR_EACH_ENTRY(info, &window_list, HHInfo, entry)
|
||||
{
|
||||
if (strcmpW(info->WinType.pszType, window) == 0)
|
||||
if (lstrcmpW(info->WinType.pszType, window) == 0)
|
||||
return info;
|
||||
}
|
||||
return NULL;
|
||||
|
|
|
@ -97,38 +97,43 @@ static const char *command_to_string(UINT command)
|
|||
#undef X
|
||||
}
|
||||
|
||||
static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD buflen, WCHAR **index, WCHAR **window)
|
||||
static BOOL resolve_filename(const WCHAR *env_filename, WCHAR *fullname, DWORD buflen, WCHAR **index, WCHAR **window)
|
||||
{
|
||||
const WCHAR *extra;
|
||||
WCHAR chm_file[MAX_PATH];
|
||||
|
||||
static const WCHAR helpW[] = {'\\','h','e','l','p','\\',0};
|
||||
static const WCHAR delimW[] = {':',':',0};
|
||||
static const WCHAR delim2W[] = {'>',0};
|
||||
|
||||
filename = skip_schema(filename);
|
||||
DWORD env_len;
|
||||
WCHAR *filename, *extra;
|
||||
|
||||
env_filename = skip_schema(env_filename);
|
||||
|
||||
/* the format is "helpFile[::/index][>window]" */
|
||||
if (index) *index = NULL;
|
||||
if (window) *window = NULL;
|
||||
|
||||
extra = strstrW(filename, delim2W);
|
||||
env_len = ExpandEnvironmentStringsW(env_filename, NULL, 0);
|
||||
if (!env_len)
|
||||
return 0;
|
||||
|
||||
filename = heap_alloc(env_len * sizeof(WCHAR));
|
||||
if (filename == NULL)
|
||||
return 0;
|
||||
|
||||
ExpandEnvironmentStringsW(env_filename, filename, env_len);
|
||||
|
||||
extra = wcsstr(filename, delim2W);
|
||||
if (extra)
|
||||
{
|
||||
memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR));
|
||||
chm_file[extra-filename] = 0;
|
||||
filename = chm_file;
|
||||
*extra = 0;
|
||||
if (window)
|
||||
*window = strdupW(extra+1);
|
||||
}
|
||||
|
||||
extra = strstrW(filename, delimW);
|
||||
extra = wcsstr(filename, delimW);
|
||||
if (extra)
|
||||
{
|
||||
if (filename != chm_file)
|
||||
memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR));
|
||||
chm_file[extra-filename] = 0;
|
||||
filename = chm_file;
|
||||
*extra = 0;
|
||||
if (index)
|
||||
*index = strdupW(extra+2);
|
||||
}
|
||||
|
@ -137,9 +142,12 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle
|
|||
if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES)
|
||||
{
|
||||
GetWindowsDirectoryW(fullname, buflen);
|
||||
strcatW(fullname, helpW);
|
||||
strcatW(fullname, filename);
|
||||
lstrcatW(fullname, helpW);
|
||||
lstrcatW(fullname, filename);
|
||||
}
|
||||
|
||||
heap_free(filename);
|
||||
|
||||
return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES);
|
||||
}
|
||||
|
||||
|
@ -206,12 +214,12 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
|
|||
static const WCHAR delimW[] = {':',':',0};
|
||||
const WCHAR *i = (const WCHAR *)data;
|
||||
|
||||
index = strstrW(i, delimW);
|
||||
index = wcsstr(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);
|
||||
index += lstrlenW(delimW);
|
||||
}
|
||||
else
|
||||
index = i;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "wine/winternl.h"
|
||||
#include "winuser.h"
|
||||
#include "winnls.h"
|
||||
#include "htmlhelp.h"
|
||||
|
@ -39,7 +40,6 @@
|
|||
#endif
|
||||
|
||||
#include "wine/itss.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "wine/heap.h"
|
||||
#include "wine/list.h"
|
||||
|
||||
|
@ -258,7 +258,7 @@ static inline LPWSTR strdupW(LPCWSTR str)
|
|||
if(!str)
|
||||
return NULL;
|
||||
|
||||
size = (strlenW(str)+1)*sizeof(WCHAR);
|
||||
size = (lstrlenW(str)+1)*sizeof(WCHAR);
|
||||
ret = heap_alloc(size);
|
||||
memcpy(ret, str, size);
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ static void fill_index_tree(HWND hwnd, IndexItem *item)
|
|||
lvi.iItem = index++;
|
||||
lvi.mask = LVIF_TEXT|LVIF_PARAM|LVIF_INDENT;
|
||||
lvi.iIndent = item->indentLevel;
|
||||
lvi.cchTextMax = strlenW(item->keyword)+1;
|
||||
lvi.cchTextMax = lstrlenW(item->keyword)+1;
|
||||
lvi.pszText = item->keyword;
|
||||
lvi.lParam = (LPARAM)item;
|
||||
item->id = (HTREEITEM)SendMessageW(hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
|
||||
|
@ -83,20 +83,20 @@ static void parse_index_obj_node_param(IndexItem *item, const char *text, UINT c
|
|||
/* Allocate a new sub-item, either on the first run or whenever a
|
||||
* sub-topic has filled out both the "name" and "local" params.
|
||||
*/
|
||||
if(item->itemFlags == 0x11 && (!strncasecmp("name", ptr, len) || !strncasecmp("local", ptr, len)))
|
||||
if(item->itemFlags == 0x11 && (!_strnicmp("name", ptr, len) || !_strnicmp("local", ptr, len)))
|
||||
item_realloc(item, item->nItems+1);
|
||||
if(!strncasecmp("keyword", ptr, len)) {
|
||||
if(!_strnicmp("keyword", ptr, len)) {
|
||||
param = &item->keyword;
|
||||
}else if(!item->keyword && !strncasecmp("name", ptr, len)) {
|
||||
}else if(!item->keyword && !_strnicmp("name", ptr, len)) {
|
||||
/* Some HTML Help index files use an additional "name" parameter
|
||||
* rather than the "keyword" parameter. In this case, the first
|
||||
* occurrence of the "name" parameter is the keyword.
|
||||
*/
|
||||
param = &item->keyword;
|
||||
}else if(!strncasecmp("name", ptr, len)) {
|
||||
}else if(!_strnicmp("name", ptr, len)) {
|
||||
item->itemFlags |= 0x01;
|
||||
param = &item->items[item->nItems-1].name;
|
||||
}else if(!strncasecmp("local", ptr, len)) {
|
||||
}else if(!_strnicmp("local", ptr, len)) {
|
||||
item->itemFlags |= 0x10;
|
||||
param = &item->items[item->nItems-1].local;
|
||||
}else {
|
||||
|
@ -137,9 +137,9 @@ static IndexItem *parse_index_sitemap_object(HHInfo *info, stream_t *stream)
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "param")) {
|
||||
if(!_strnicmp(node_name.buf, "param", -1)) {
|
||||
parse_index_obj_node_param(item, node.buf, info->pCHMInfo->codePage);
|
||||
}else if(!strcasecmp(node_name.buf, "/object")) {
|
||||
}else if(!_strnicmp(node_name.buf, "/object", -1)) {
|
||||
break;
|
||||
}else {
|
||||
WARN("Unhandled tag! %s\n", node_name.buf);
|
||||
|
@ -173,7 +173,7 @@ static IndexItem *parse_li(HHInfo *info, stream_t *stream)
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "object")) {
|
||||
if(!_strnicmp(node_name.buf, "object", -1)) {
|
||||
const char *ptr;
|
||||
int len;
|
||||
|
||||
|
@ -228,11 +228,11 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
|
|||
|
||||
TRACE("%s\n", node.buf);
|
||||
|
||||
if(!strcasecmp(node_name.buf, "li")) {
|
||||
if(!_strnicmp(node_name.buf, "li", -1)) {
|
||||
IndexItem *new_item;
|
||||
|
||||
new_item = parse_li(info, &stream);
|
||||
if(new_item && item->keyword && strcmpW(new_item->keyword, item->keyword) == 0) {
|
||||
if(new_item && item->keyword && lstrcmpW(new_item->keyword, item->keyword) == 0) {
|
||||
int num_items = item->nItems;
|
||||
|
||||
item_realloc(item, num_items+1);
|
||||
|
@ -246,9 +246,9 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
|
|||
item = item->next;
|
||||
item->indentLevel = indent_level;
|
||||
}
|
||||
}else if(!strcasecmp(node_name.buf, "ul")) {
|
||||
}else if(!_strnicmp(node_name.buf, "ul", -1)) {
|
||||
indent_level++;
|
||||
}else if(!strcasecmp(node_name.buf, "/ul")) {
|
||||
}else if(!_strnicmp(node_name.buf, "/ul", -1)) {
|
||||
indent_level--;
|
||||
}else {
|
||||
WARN("Unhandled tag! %s\n", node_name.buf);
|
||||
|
|
|
@ -29,7 +29,7 @@ static SearchItem *SearchCHM_Folder(SearchItem *item, IStorage *pStorage,
|
|||
/* Allocate a ListView entry for a search result. */
|
||||
static SearchItem *alloc_search_item(WCHAR *title, const WCHAR *filename)
|
||||
{
|
||||
int filename_len = filename ? (strlenW(filename)+1)*sizeof(WCHAR) : 0;
|
||||
int filename_len = filename ? (lstrlenW(filename)+1)*sizeof(WCHAR) : 0;
|
||||
SearchItem *item;
|
||||
|
||||
item = heap_alloc_zero(sizeof(SearchItem));
|
||||
|
@ -56,7 +56,7 @@ static void fill_search_tree(HWND hwndList, SearchItem *item)
|
|||
memset(&lvi, 0, sizeof(lvi));
|
||||
lvi.iItem = index++;
|
||||
lvi.mask = LVIF_TEXT|LVIF_PARAM;
|
||||
lvi.cchTextMax = strlenW(item->title)+1;
|
||||
lvi.cchTextMax = lstrlenW(item->title)+1;
|
||||
lvi.pszText = item->title;
|
||||
lvi.lParam = (LPARAM)item;
|
||||
item->id = (HTREEITEM)SendMessageW(hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
|
||||
|
@ -102,7 +102,7 @@ static WCHAR *SearchCHM_File(IStorage *pStorage, const WCHAR *file, const char *
|
|||
char *text = &content.buf[1];
|
||||
int textlen = content.len-1;
|
||||
|
||||
if(!strcasecmp(node_name.buf, "title"))
|
||||
if(!_strnicmp(node_name.buf, "title", -1))
|
||||
{
|
||||
int wlen = MultiByteToWideChar(CP_ACP, 0, text, textlen, NULL, 0);
|
||||
title = heap_alloc((wlen+1)*sizeof(WCHAR));
|
||||
|
@ -168,14 +168,14 @@ static SearchItem *SearchCHM_Storage(SearchItem *item, IStorage *pStorage,
|
|||
while (IEnumSTATSTG_Next(elem, 1, &entries, &retr) == NOERROR)
|
||||
{
|
||||
filename = entries.pwcsName;
|
||||
while(strchrW(filename, '/'))
|
||||
filename = strchrW(filename, '/')+1;
|
||||
while(wcschr(filename, '/'))
|
||||
filename = wcschr(filename, '/')+1;
|
||||
switch(entries.type) {
|
||||
case STGTY_STORAGE:
|
||||
item = SearchCHM_Folder(item, pStorage, filename, needle);
|
||||
break;
|
||||
case STGTY_STREAM:
|
||||
if(strstrW(filename, szHTMext))
|
||||
if(wcsstr(filename, szHTMext))
|
||||
{
|
||||
WCHAR *title = SearchCHM_File(pStorage, filename, needle);
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ dll/win32/faultrep # Synced to WineStaging-4.18
|
|||
dll/win32/fontsub # Synced to WineStaging-2.9
|
||||
dll/win32/fusion # Synced to WineStaging-4.18
|
||||
dll/win32/gdiplus # Synced to WineStaging-4.0
|
||||
dll/win32/hhctrl.ocx # Synced to WineStaging-4.0
|
||||
dll/win32/hhctrl.ocx # Synced to WineStaging-4.18
|
||||
dll/win32/hlink # Synced to WineStaging-4.0
|
||||
dll/win32/hnetcfg # Synced to WineStaging-4.18
|
||||
dll/win32/httpapi # Synced to WineStaging-3.3
|
||||
|
|
Loading…
Reference in a new issue