Commit 4150b666 authored by Alexandre Julliard's avatar Alexandre Julliard

hhctrl.ocx: Build with msvcrt.

parent c06ca29d
...@@ -2,6 +2,8 @@ MODULE = hhctrl.ocx ...@@ -2,6 +2,8 @@ MODULE = hhctrl.ocx
IMPORTLIB = htmlhelp IMPORTLIB = htmlhelp
IMPORTS = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32 IMPORTS = uuid advapi32 comctl32 shlwapi ole32 oleaut32 user32 gdi32
EXTRADLLFLAGS = -mno-cygwin
C_SRCS = \ C_SRCS = \
chm.c \ chm.c \
content.c \ content.c \
......
...@@ -228,11 +228,11 @@ static WCHAR *FindHTMLHelpSetting(HHInfo *info, const WCHAR *extW) ...@@ -228,11 +228,11 @@ static WCHAR *FindHTMLHelpSetting(HHInfo *info, const WCHAR *extW)
WCHAR *filename; WCHAR *filename;
HRESULT hr; HRESULT hr;
filename = heap_alloc( (strlenW(info->pCHMInfo->compiledFile) filename = heap_alloc( (lstrlenW(info->pCHMInfo->compiledFile)
+ strlenW(periodW) + strlenW(extW) + 1) * sizeof(WCHAR) ); + lstrlenW(periodW) + lstrlenW(extW) + 1) * sizeof(WCHAR) );
strcpyW(filename, info->pCHMInfo->compiledFile); lstrcpyW(filename, info->pCHMInfo->compiledFile);
strcatW(filename, periodW); lstrcatW(filename, periodW);
strcatW(filename, extW); lstrcatW(filename, extW);
hr = IStorage_OpenStream(pStorage, filename, NULL, STGM_READ, 0, &pStream); hr = IStorage_OpenStream(pStorage, filename, NULL, STGM_READ, 0, &pStream);
if (FAILED(hr)) if (FAILED(hr))
{ {
...@@ -483,11 +483,11 @@ LPCWSTR skip_schema(LPCWSTR url) ...@@ -483,11 +483,11 @@ LPCWSTR skip_schema(LPCWSTR url)
static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'}; 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',':'}; 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); 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); 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 + ARRAY_SIZE(mk_schema);
return url; return url;
...@@ -500,15 +500,15 @@ void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path) ...@@ -500,15 +500,15 @@ void SetChmPath(ChmPath *file, LPCWSTR base_file, LPCWSTR path)
path = skip_schema(path); path = skip_schema(path);
ptr = strstrW(path, separatorW); ptr = wcsstr(path, separatorW);
if(ptr) { if(ptr) {
WCHAR chm_file[MAX_PATH]; WCHAR chm_file[MAX_PATH];
WCHAR rel_path[MAX_PATH]; WCHAR rel_path[MAX_PATH];
WCHAR base_path[MAX_PATH]; WCHAR base_path[MAX_PATH];
LPWSTR p; LPWSTR p;
strcpyW(base_path, base_file); lstrcpyW(base_path, base_file);
p = strrchrW(base_path, '\\'); p = wcsrchr(base_path, '\\');
if(p) if(p)
*p = 0; *p = 0;
......
...@@ -268,7 +268,7 @@ static void insert_content_item(HWND hwnd, ContentItem *parent, ContentItem *ite ...@@ -268,7 +268,7 @@ static void insert_content_item(HWND hwnd, ContentItem *parent, ContentItem *ite
memset(&tvis, 0, sizeof(tvis)); memset(&tvis, 0, sizeof(tvis));
tvis.u.item.mask = TVIF_TEXT|TVIF_PARAM|TVIF_IMAGE|TVIF_SELECTEDIMAGE; 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.pszText = item->name;
tvis.u.item.lParam = (LPARAM)item; tvis.u.item.lParam = (LPARAM)item;
tvis.u.item.iImage = item->child ? HHTV_FOLDER : HHTV_DOCUMENT; tvis.u.item.iImage = item->child ? HHTV_FOLDER : HHTV_DOCUMENT;
......
...@@ -216,7 +216,7 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl) ...@@ -216,7 +216,7 @@ BOOL NavigateToUrl(HHInfo *info, LPCWSTR surl)
TRACE("%s\n", debugstr_w(surl)); TRACE("%s\n", debugstr_w(surl));
if (strstrW(surl, url_indicator)) { if (wcsstr(surl, url_indicator)) {
hres = navigate_url(info, surl); hres = navigate_url(info, surl);
if(SUCCEEDED(hres)) if(SUCCEEDED(hres))
return TRUE; return TRUE;
...@@ -288,7 +288,7 @@ static void DoSync(HHInfo *info) ...@@ -288,7 +288,7 @@ static void DoSync(HHInfo *info)
static const WCHAR delimW[] = {':',':','/',0}; static const WCHAR delimW[] = {':',':','/',0};
const WCHAR *index; const WCHAR *index;
index = strstrW(url, delimW); index = wcsstr(url, delimW);
if (index) if (index)
ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */ ActivateContentTopic(info->tabs[TAB_CONTENTS].hwnd, index + 3, info->content); /* skip over ::/ */
...@@ -639,7 +639,7 @@ static LRESULT OnTopicChange(HHInfo *info, void *user_data) ...@@ -639,7 +639,7 @@ static LRESULT OnTopicChange(HHInfo *info, void *user_data)
memset(&lvi, 0, sizeof(lvi)); memset(&lvi, 0, sizeof(lvi));
lvi.iItem = i; lvi.iItem = i;
lvi.mask = LVIF_TEXT|LVIF_PARAM; lvi.mask = LVIF_TEXT|LVIF_PARAM;
lvi.cchTextMax = strlenW(name)+1; lvi.cchTextMax = lstrlenW(name)+1;
lvi.pszText = name; lvi.pszText = name;
lvi.lParam = (LPARAM) item; lvi.lParam = (LPARAM) item;
SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi); SendMessageW(info->popup.hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
...@@ -1025,7 +1025,7 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo) ...@@ -1025,7 +1025,7 @@ static BOOL HH_AddToolbar(HHInfo *pHHInfo)
for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++) for (dwIndex = 0; dwIndex < dwNumButtons; dwIndex++)
{ {
LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand); LPWSTR szBuf = HH_LoadString(buttons[dwIndex].idCommand);
DWORD dwLen = strlenW(szBuf); DWORD dwLen = lstrlenW(szBuf);
szBuf[dwLen + 1] = 0; /* Double-null terminate */ szBuf[dwLen + 1] = 0; /* Double-null terminate */
buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf); buttons[dwIndex].iString = (DWORD)SendMessageW(hToolbar, TB_ADDSTRINGW, 0, (LPARAM)szBuf);
...@@ -1958,7 +1958,7 @@ HHInfo *find_window(const WCHAR *window) ...@@ -1958,7 +1958,7 @@ HHInfo *find_window(const WCHAR *window)
LIST_FOR_EACH_ENTRY(info, &window_list, HHInfo, entry) 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 info;
} }
return NULL; return NULL;
......
...@@ -112,7 +112,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle ...@@ -112,7 +112,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle
if (index) *index = NULL; if (index) *index = NULL;
if (window) *window = NULL; if (window) *window = NULL;
extra = strstrW(filename, delim2W); extra = wcsstr(filename, delim2W);
if (extra) if (extra)
{ {
memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR)); memcpy(chm_file, filename, (extra-filename)*sizeof(WCHAR));
...@@ -122,7 +122,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle ...@@ -122,7 +122,7 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle
*window = strdupW(extra+1); *window = strdupW(extra+1);
} }
extra = strstrW(filename, delimW); extra = wcsstr(filename, delimW);
if (extra) if (extra)
{ {
if (filename != chm_file) if (filename != chm_file)
...@@ -137,8 +137,8 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle ...@@ -137,8 +137,8 @@ static BOOL resolve_filename(const WCHAR *filename, WCHAR *fullname, DWORD bufle
if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES) if (GetFileAttributesW(fullname) == INVALID_FILE_ATTRIBUTES)
{ {
GetWindowsDirectoryW(fullname, buflen); GetWindowsDirectoryW(fullname, buflen);
strcatW(fullname, helpW); lstrcatW(fullname, helpW);
strcatW(fullname, filename); lstrcatW(fullname, filename);
} }
return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES); return (GetFileAttributesW(fullname) != INVALID_FILE_ATTRIBUTES);
} }
...@@ -206,12 +206,12 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat ...@@ -206,12 +206,12 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
static const WCHAR delimW[] = {':',':',0}; static const WCHAR delimW[] = {':',':',0};
const WCHAR *i = (const WCHAR *)data; const WCHAR *i = (const WCHAR *)data;
index = strstrW(i, delimW); index = wcsstr(i, delimW);
if(index) if(index)
{ {
if(memcmp(info->pCHMInfo->szFile, i, index-i)) if(memcmp(info->pCHMInfo->szFile, i, index-i))
FIXME("Opening a CHM file in the context of another is not supported.\n"); FIXME("Opening a CHM file in the context of another is not supported.\n");
index += strlenW(delimW); index += lstrlenW(delimW);
} }
else else
index = i; index = i;
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#endif #endif
#include "wine/itss.h" #include "wine/itss.h"
#include "wine/unicode.h"
#include "wine/heap.h" #include "wine/heap.h"
#include "wine/list.h" #include "wine/list.h"
...@@ -259,7 +258,7 @@ static inline LPWSTR strdupW(LPCWSTR str) ...@@ -259,7 +258,7 @@ static inline LPWSTR strdupW(LPCWSTR str)
if(!str) if(!str)
return NULL; return NULL;
size = (strlenW(str)+1)*sizeof(WCHAR); size = (lstrlenW(str)+1)*sizeof(WCHAR);
ret = heap_alloc(size); ret = heap_alloc(size);
memcpy(ret, str, size); memcpy(ret, str, size);
......
...@@ -43,7 +43,7 @@ static void fill_index_tree(HWND hwnd, IndexItem *item) ...@@ -43,7 +43,7 @@ static void fill_index_tree(HWND hwnd, IndexItem *item)
lvi.iItem = index++; lvi.iItem = index++;
lvi.mask = LVIF_TEXT|LVIF_PARAM|LVIF_INDENT; lvi.mask = LVIF_TEXT|LVIF_PARAM|LVIF_INDENT;
lvi.iIndent = item->indentLevel; lvi.iIndent = item->indentLevel;
lvi.cchTextMax = strlenW(item->keyword)+1; lvi.cchTextMax = lstrlenW(item->keyword)+1;
lvi.pszText = item->keyword; lvi.pszText = item->keyword;
lvi.lParam = (LPARAM)item; lvi.lParam = (LPARAM)item;
item->id = (HTREEITEM)SendMessageW(hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvi); item->id = (HTREEITEM)SendMessageW(hwnd, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
...@@ -232,7 +232,7 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item) ...@@ -232,7 +232,7 @@ static void parse_hhindex(HHInfo *info, IStream *str, IndexItem *item)
IndexItem *new_item; IndexItem *new_item;
new_item = parse_li(info, &stream); 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; int num_items = item->nItems;
item_realloc(item, num_items+1); item_realloc(item, num_items+1);
......
...@@ -29,7 +29,7 @@ static SearchItem *SearchCHM_Folder(SearchItem *item, IStorage *pStorage, ...@@ -29,7 +29,7 @@ static SearchItem *SearchCHM_Folder(SearchItem *item, IStorage *pStorage,
/* Allocate a ListView entry for a search result. */ /* Allocate a ListView entry for a search result. */
static SearchItem *alloc_search_item(WCHAR *title, const WCHAR *filename) 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; SearchItem *item;
item = heap_alloc_zero(sizeof(SearchItem)); item = heap_alloc_zero(sizeof(SearchItem));
...@@ -56,7 +56,7 @@ static void fill_search_tree(HWND hwndList, SearchItem *item) ...@@ -56,7 +56,7 @@ static void fill_search_tree(HWND hwndList, SearchItem *item)
memset(&lvi, 0, sizeof(lvi)); memset(&lvi, 0, sizeof(lvi));
lvi.iItem = index++; lvi.iItem = index++;
lvi.mask = LVIF_TEXT|LVIF_PARAM; lvi.mask = LVIF_TEXT|LVIF_PARAM;
lvi.cchTextMax = strlenW(item->title)+1; lvi.cchTextMax = lstrlenW(item->title)+1;
lvi.pszText = item->title; lvi.pszText = item->title;
lvi.lParam = (LPARAM)item; lvi.lParam = (LPARAM)item;
item->id = (HTREEITEM)SendMessageW(hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi); item->id = (HTREEITEM)SendMessageW(hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvi);
...@@ -168,14 +168,14 @@ static SearchItem *SearchCHM_Storage(SearchItem *item, IStorage *pStorage, ...@@ -168,14 +168,14 @@ static SearchItem *SearchCHM_Storage(SearchItem *item, IStorage *pStorage,
while (IEnumSTATSTG_Next(elem, 1, &entries, &retr) == NOERROR) while (IEnumSTATSTG_Next(elem, 1, &entries, &retr) == NOERROR)
{ {
filename = entries.pwcsName; filename = entries.pwcsName;
while(strchrW(filename, '/')) while(wcschr(filename, '/'))
filename = strchrW(filename, '/')+1; filename = wcschr(filename, '/')+1;
switch(entries.type) { switch(entries.type) {
case STGTY_STORAGE: case STGTY_STORAGE:
item = SearchCHM_Folder(item, pStorage, filename, needle); item = SearchCHM_Folder(item, pStorage, filename, needle);
break; break;
case STGTY_STREAM: case STGTY_STREAM:
if(strstrW(filename, szHTMext)) if(wcsstr(filename, szHTMext))
{ {
WCHAR *title = SearchCHM_File(pStorage, filename, needle); WCHAR *title = SearchCHM_File(pStorage, filename, needle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment