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
5ed9be80
Commit
5ed9be80
authored
Feb 23, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hhctrl.ocx: Added beginning #SYSTEM parsing code.
parent
1711c3a5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
chm.c
dlls/hhctrl.ocx/chm.c
+79
-0
No files found.
dlls/hhctrl.ocx/chm.c
View file @
5ed9be80
...
...
@@ -72,6 +72,80 @@ static LPCSTR GetChmString(CHMInfo *chm, DWORD offset)
return
chm
->
strings
[
offset
>>
BLOCK_BITS
]
+
(
offset
&
BLOCK_MASK
);
}
static
BOOL
ReadChmSystem
(
CHMInfo
*
chm
)
{
IStream
*
stream
;
DWORD
ver
=
0xdeadbeef
,
read
,
buf_size
;
char
*
buf
;
HRESULT
hres
;
struct
{
WORD
code
;
WORD
len
;
}
entry
;
static
const
WCHAR
wszSYSTEM
[]
=
{
'#'
,
'S'
,
'Y'
,
'S'
,
'T'
,
'E'
,
'M'
,
0
};
hres
=
IStorage_OpenStream
(
chm
->
pStorage
,
wszSYSTEM
,
NULL
,
STGM_READ
,
0
,
&
stream
);
if
(
FAILED
(
hres
))
{
WARN
(
"Could not open #SYSTEM stream: %08x
\n
"
,
hres
);
return
FALSE
;
}
IStream_Read
(
stream
,
&
ver
,
sizeof
(
ver
),
&
read
);
TRACE
(
"version is %x
\n
"
,
ver
);
buf
=
hhctrl_alloc
(
8
*
sizeof
(
DWORD
));
buf_size
=
8
*
sizeof
(
DWORD
);
while
(
1
)
{
hres
=
IStream_Read
(
stream
,
&
entry
,
sizeof
(
entry
),
&
read
);
if
(
hres
!=
S_OK
)
break
;
if
(
entry
.
len
>
buf_size
)
buf
=
hhctrl_realloc
(
buf
,
buf_size
=
entry
.
len
);
hres
=
IStream_Read
(
stream
,
buf
,
entry
.
len
,
&
read
);
if
(
hres
!=
S_OK
)
break
;
switch
(
entry
.
code
)
{
case
0x2
:
TRACE
(
"Default topic is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
case
0x3
:
TRACE
(
"Title is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
case
0x5
:
TRACE
(
"Default window is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
case
0x6
:
TRACE
(
"Compiled file is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
case
0x9
:
TRACE
(
"Version is %s
\n
"
,
debugstr_an
(
buf
,
entry
.
len
));
break
;
case
0xa
:
TRACE
(
"Time is %08x
\n
"
,
*
(
DWORD
*
)
buf
);
break
;
case
0xc
:
TRACE
(
"Number of info types: %d
\n
"
,
*
(
DWORD
*
)
buf
);
break
;
case
0xf
:
TRACE
(
"Check sum: %x
\n
"
,
*
(
DWORD
*
)
buf
);
break
;
default:
TRACE
(
"unhandled code %x, size %x
\n
"
,
entry
.
code
,
entry
.
len
);
}
}
hhctrl_free
(
buf
);
IStream_Release
(
stream
);
return
SUCCEEDED
(
hres
);
}
/* Loads the HH_WINTYPE data from the CHM file
*
* FIXME: There may be more than one window type in the file, so
...
...
@@ -158,6 +232,11 @@ CHMInfo *OpenCHM(LPCWSTR szFile)
return
CloseCHM
(
ret
);
}
if
(
!
ReadChmSystem
(
ret
))
{
WARN
(
"Could not read #SYSTEM
\n
"
);
return
CloseCHM
(
ret
);
}
return
ret
;
}
...
...
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