Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4150b666
Commit
4150b666
authored
Jun 05, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c06ca29d
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
33 additions
and
32 deletions
+33
-32
Makefile.in
dlls/hhctrl.ocx/Makefile.in
+2
-0
chm.c
dlls/hhctrl.ocx/chm.c
+11
-11
content.c
dlls/hhctrl.ocx/content.c
+1
-1
help.c
dlls/hhctrl.ocx/help.c
+5
-5
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+6
-6
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+1
-2
index.c
dlls/hhctrl.ocx/index.c
+2
-2
search.c
dlls/hhctrl.ocx/search.c
+5
-5
No files found.
dlls/hhctrl.ocx/Makefile.in
View file @
4150b666
...
...
@@ -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
\
...
...
dlls/hhctrl.ocx/chm.c
View file @
4150b666
...
...
@@ -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
(
(
l
strlenW
(
info
->
pCHMInfo
->
compiledFile
)
+
lstrlenW
(
periodW
)
+
l
strlenW
(
extW
)
+
1
)
*
sizeof
(
WCHAR
)
);
l
strcpyW
(
filename
,
info
->
pCHMInfo
->
compiledFile
);
l
strcatW
(
filename
,
periodW
);
l
strcatW
(
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
,
'\\'
);
l
strcpyW
(
base_path
,
base_file
);
p
=
wcsrchr
(
base_path
,
'\\'
);
if
(
p
)
*
p
=
0
;
...
...
dlls/hhctrl.ocx/content.c
View file @
4150b666
...
...
@@ -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
=
l
strlenW
(
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
;
...
...
dlls/hhctrl.ocx/help.c
View file @
4150b666
...
...
@@ -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
=
l
strlenW
(
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
=
l
strlenW
(
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
(
l
strcmpW
(
info
->
WinType
.
pszType
,
window
)
==
0
)
return
info
;
}
return
NULL
;
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
4150b666
...
...
@@ -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
);
l
strcatW
(
fullname
,
helpW
);
l
strcatW
(
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
+=
l
strlenW
(
delimW
);
}
else
index
=
i
;
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
4150b666
...
...
@@ -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
=
(
l
strlenW
(
str
)
+
1
)
*
sizeof
(
WCHAR
);
ret
=
heap_alloc
(
size
);
memcpy
(
ret
,
str
,
size
);
...
...
dlls/hhctrl.ocx/index.c
View file @
4150b666
...
...
@@ -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
=
l
strlenW
(
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
&&
l
strcmpW
(
new_item
->
keyword
,
item
->
keyword
)
==
0
)
{
int
num_items
=
item
->
nItems
;
item_realloc
(
item
,
num_items
+
1
);
...
...
dlls/hhctrl.ocx/search.c
View file @
4150b666
...
...
@@ -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
?
(
l
strlenW
(
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
=
l
strlenW
(
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment