From 4150b6660e3fbcf89ce2ad7f1e1ec1fb1ea83536 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 5 Jun 2019 08:35:40 +0200 Subject: [PATCH] hhctrl.ocx: Build with msvcrt. Signed-off-by: Alexandre Julliard --- dlls/hhctrl.ocx/Makefile.in | 2 ++ dlls/hhctrl.ocx/chm.c | 22 +++++++++++----------- dlls/hhctrl.ocx/content.c | 2 +- dlls/hhctrl.ocx/help.c | 10 +++++----- dlls/hhctrl.ocx/hhctrl.c | 12 ++++++------ dlls/hhctrl.ocx/hhctrl.h | 3 +-- dlls/hhctrl.ocx/index.c | 4 ++-- dlls/hhctrl.ocx/search.c | 10 +++++----- 8 files changed, 33 insertions(+), 32 deletions(-) diff --git a/dlls/hhctrl.ocx/Makefile.in b/dlls/hhctrl.ocx/Makefile.in index ef1876648c9..7036a702f30 100644 --- a/dlls/hhctrl.ocx/Makefile.in +++ b/dlls/hhctrl.ocx/Makefile.in @@ -2,6 +2,8 @@ MODULE = hhctrl.ocx IMPORTLIB = htmlhelp IMPORTS = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32 +EXTRADLLFLAGS = -mno-cygwin + C_SRCS = \ chm.c \ content.c \ diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c index 48500cac5d7..2d329b9d56b 100644 --- a/dlls/hhctrl.ocx/chm.c +++ b/dlls/hhctrl.ocx/chm.c @@ -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; diff --git a/dlls/hhctrl.ocx/content.c b/dlls/hhctrl.ocx/content.c index a20d48682cb..0bf374344d0 100644 --- a/dlls/hhctrl.ocx/content.c +++ b/dlls/hhctrl.ocx/content.c @@ -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; diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c index 75b28f2f57d..06f73358f44 100644 --- a/dlls/hhctrl.ocx/help.c +++ b/dlls/hhctrl.ocx/help.c @@ -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; diff --git a/dlls/hhctrl.ocx/hhctrl.c b/dlls/hhctrl.ocx/hhctrl.c index 7efca002f9f..e75716731c3 100644 --- a/dlls/hhctrl.ocx/hhctrl.c +++ b/dlls/hhctrl.ocx/hhctrl.c @@ -112,7 +112,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle if (index) *index = NULL; if (window) *window = NULL; - extra = strstrW(filename, delim2W); + extra = wcsstr(filename, delim2W); if (extra) { memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR)); @@ -122,7 +122,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle *window = strdupW(extra+1); } - extra = strstrW(filename, delimW); + extra = wcsstr(filename, delimW); if (extra) { if (filename != chm_file) @@ -137,8 +137,8 @@ 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); } return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES); } @@ -206,12 +206,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; diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index ae525cf152d..729cdd23de9 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -40,7 +40,6 @@ #endif #include "wine/itss.h" -#include "wine/unicode.h" #include "wine/heap.h" #include "wine/list.h" @@ -259,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); diff --git a/dlls/hhctrl.ocx/index.c b/dlls/hhctrl.ocx/index.c index 375f3e42624..54151d0821e 100644 --- a/dlls/hhctrl.ocx/index.c +++ b/dlls/hhctrl.ocx/index.c @@ -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); @@ -232,7 +232,7 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item) 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); diff --git a/dlls/hhctrl.ocx/search.c b/dlls/hhctrl.ocx/search.c index 0c38f1d623d..f9c13a91312 100644 --- a/dlls/hhctrl.ocx/search.c +++ b/dlls/hhctrl.ocx/search.c @@ -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); @@ -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);