Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
3414d0ea
Commit
3414d0ea
authored
Jun 29, 2011
by
Aric Stewart
Committed by
Alexandre Julliard
Jun 29, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Improve parsing of incoming file specs to HtmlHelp.
parent
a700f9e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
16 deletions
+43
-16
chm.c
dlls/hhctrl.ocx/chm.c
+1
-1
hhctrl.c
dlls/hhctrl.ocx/hhctrl.c
+40
-15
hhctrl.h
dlls/hhctrl.ocx/hhctrl.h
+2
-0
No files found.
dlls/hhctrl.ocx/chm.c
View file @
3414d0ea
...
...
@@ -282,7 +282,7 @@ done:
return
SUCCEEDED
(
hr
);
}
static
LPCWSTR
skip_schema
(
LPCWSTR
url
)
LPCWSTR
skip_schema
(
LPCWSTR
url
)
{
static
const
WCHAR
its_schema
[]
=
{
'i'
,
't'
,
's'
,
':'
};
static
const
WCHAR
msits_schema
[]
=
{
'm'
,
's'
,
'-'
,
'i'
,
't'
,
's'
,
':'
};
...
...
dlls/hhctrl.ocx/hhctrl.c
View file @
3414d0ea
...
...
@@ -98,9 +98,41 @@ static const char *command_to_string(UINT command)
#undef X
}
static
BOOL
resolve_filename
(
const
WCHAR
*
filename
,
WCHAR
*
fullname
,
DWORD
buflen
)
static
BOOL
resolve_filename
(
const
WCHAR
*
filename
,
WCHAR
*
fullname
,
DWORD
buflen
,
const
WCHAR
**
index
,
const
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
);
/* the format is "helpFile[::/index][>window]" */
if
(
index
)
*
index
=
NULL
;
if
(
window
)
*
window
=
NULL
;
extra
=
strstrW
(
filename
,
delim2W
);
if
(
extra
)
{
memcpy
(
chm_file
,
filename
,
(
extra
-
filename
)
*
sizeof
(
WCHAR
));
chm_file
[
extra
-
filename
]
=
0
;
filename
=
chm_file
;
if
(
window
)
*
window
=
strdupW
(
extra
+
1
);
}
extra
=
strstrW
(
filename
,
delimW
);
if
(
extra
)
{
if
(
filename
!=
chm_file
);
memcpy
(
chm_file
,
filename
,
(
extra
-
filename
)
*
sizeof
(
WCHAR
));
chm_file
[
extra
-
filename
]
=
0
;
filename
=
chm_file
;
if
(
index
)
*
index
=
strdupW
(
extra
+
2
);
}
GetFullPathNameW
(
filename
,
buflen
,
fullname
,
NULL
);
if
(
GetFileAttributesW
(
fullname
)
==
INVALID_FILE_ATTRIBUTES
)
...
...
@@ -128,27 +160,16 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
case
HH_DISPLAY_TOPIC
:
case
HH_DISPLAY_TOC
:
case
HH_DISPLAY_SEARCH
:{
static
const
WCHAR
delimW
[]
=
{
':'
,
':'
,
0
};
HHInfo
*
info
;
BOOL
res
;
WCHAR
chm_file
[
MAX_PATH
];
const
WCHAR
*
index
;
const
WCHAR
*
index
=
NULL
;
FIXME
(
"Not all HH cases handled correctly
\n
"
);
if
(
!
filename
)
return
NULL
;
index
=
strstrW
(
filename
,
delimW
);
if
(
index
)
{
memcpy
(
chm_file
,
filename
,
(
index
-
filename
)
*
sizeof
(
WCHAR
));
chm_file
[
index
-
filename
]
=
0
;
filename
=
chm_file
;
index
+=
2
;
/* advance beyond "::" for calling NavigateToChm() later */
}
if
(
!
resolve_filename
(
filename
,
fullname
,
MAX_PATH
))
if
(
!
resolve_filename
(
filename
,
fullname
,
MAX_PATH
,
&
index
,
NULL
))
{
WARN
(
"can't find %s
\n
"
,
debugstr_w
(
filename
));
return
0
;
...
...
@@ -162,6 +183,10 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
index
=
info
->
WinType
.
pszFile
;
res
=
NavigateToChm
(
info
,
info
->
pCHMInfo
->
szFile
,
index
);
if
(
index
!=
info
->
WinType
.
pszFile
)
heap_free
((
WCHAR
*
)
index
);
if
(
!
res
)
{
ReleaseHelpViewer
(
info
);
...
...
@@ -176,7 +201,7 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
if
(
!
filename
)
return
NULL
;
if
(
!
resolve_filename
(
filename
,
fullname
,
MAX_PATH
))
if
(
!
resolve_filename
(
filename
,
fullname
,
MAX_PATH
,
NULL
,
NULL
))
{
WARN
(
"can't find %s
\n
"
,
debugstr_w
(
filename
));
return
0
;
...
...
dlls/hhctrl.ocx/hhctrl.h
View file @
3414d0ea
...
...
@@ -189,6 +189,8 @@ BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR) DECLSPEC_HIDDEN;
void
InitSearch
(
HHInfo
*
info
,
const
char
*
needle
)
DECLSPEC_HIDDEN
;
void
ReleaseSearch
(
HHInfo
*
info
)
DECLSPEC_HIDDEN
;
LPCWSTR
skip_schema
(
LPCWSTR
url
)
DECLSPEC_HIDDEN
;
/* memory allocation functions */
static
inline
void
*
__WINE_ALLOC_SIZE
(
1
)
heap_alloc
(
size_t
len
)
...
...
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