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
7f2c7249
Commit
7f2c7249
authored
Dec 04, 2007
by
Kirill K. Smirnov
Committed by
Alexandre Julliard
Dec 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhelp: There are files without Phrases or Phrases40 compression, add support for them.
parent
c1b35491
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
27 deletions
+32
-27
hlpfile.c
programs/winhelp/hlpfile.c
+30
-26
hlpfile.h
programs/winhelp/hlpfile.h
+2
-1
No files found.
programs/winhelp/hlpfile.c
View file @
7f2c7249
...
...
@@ -412,11 +412,13 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned off
{
HLPFILE_PAGE
*
page
;
BYTE
*
title
;
UINT
titlesize
;
UINT
titlesize
,
blocksize
,
datalen
;
char
*
ptr
;
HLPFILE_MACRO
*
macro
;
title
=
buf
+
GET_UINT
(
buf
,
0x10
);
blocksize
=
GET_UINT
(
buf
,
0
);
datalen
=
GET_UINT
(
buf
,
0x10
);
title
=
buf
+
datalen
;
if
(
title
>
end
)
{
WINE_WARN
(
"page2
\n
"
);
return
FALSE
;};
titlesize
=
GET_UINT
(
buf
,
4
);
...
...
@@ -424,23 +426,22 @@ static BOOL HLPFILE_AddPage(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigned off
if
(
!
page
)
return
FALSE
;
page
->
lpszTitle
=
(
char
*
)
page
+
sizeof
(
HLPFILE_PAGE
);
if
(
hlpfile
->
hasPhrases
)
if
(
titlesize
>
blocksize
-
datalen
)
{
HLPFILE_Uncompress2
(
title
,
end
,
(
BYTE
*
)
page
->
lpszTitle
,
(
BYTE
*
)
page
->
lpszTitle
+
titlesize
);
}
else
{
if
(
GET_UINT
(
buf
,
0x4
)
>
GET_UINT
(
buf
,
0
)
-
GET_UINT
(
buf
,
0x10
))
{
/* need to decompress */
HLPFILE_Uncompress3
(
page
->
lpszTitle
,
page
->
lpszTitle
+
titlesize
,
title
,
end
);
}
/* need to decompress */
if
(
hlpfile
->
hasPhrases
)
HLPFILE_Uncompress2
(
title
,
end
,
(
BYTE
*
)
page
->
lpszTitle
,
(
BYTE
*
)
page
->
lpszTitle
+
titlesize
);
else
if
(
hlpfile
->
hasPhrases40
)
HLPFILE_Uncompress3
(
page
->
lpszTitle
,
page
->
lpszTitle
+
titlesize
,
title
,
end
);
else
{
WINE_FIXME
(
"Text size is too long, splitting
\n
"
);
titlesize
=
blocksize
-
datalen
;
memcpy
(
page
->
lpszTitle
,
title
,
titlesize
);
}
}
else
memcpy
(
page
->
lpszTitle
,
title
,
titlesize
);
page
->
lpszTitle
[
titlesize
]
=
'\0'
;
...
...
@@ -888,7 +889,7 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
UINT
textsize
;
BYTE
*
format
,
*
format_end
;
char
*
text
,
*
text_base
,
*
text_end
;
long
size
;
long
size
,
blocksize
,
datalen
;
unsigned
short
bits
;
unsigned
nc
,
ncol
=
1
;
...
...
@@ -900,25 +901,28 @@ static BOOL HLPFILE_AddParagraph(HLPFILE *hlpfile, BYTE *buf, BYTE *end, unsigne
if
(
buf
+
0x19
>
end
)
{
WINE_WARN
(
"header too small
\n
"
);
return
FALSE
;};
blocksize
=
GET_UINT
(
buf
,
0
);
size
=
GET_UINT
(
buf
,
0x4
);
datalen
=
GET_UINT
(
buf
,
0x10
);
text
=
text_base
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
text
)
return
FALSE
;
if
(
hlpfile
->
hasPhrases
)
if
(
size
>
blocksize
-
datalen
)
{
HLPFILE_Uncompress2
(
buf
+
GET_UINT
(
buf
,
0x10
),
end
,
(
BYTE
*
)
text
,
(
BYTE
*
)
text
+
size
);
}
else
{
if
(
GET_UINT
(
buf
,
0x4
)
>
GET_UINT
(
buf
,
0
)
-
GET_UINT
(
buf
,
0x10
))
{
/* block is compressed */
HLPFILE_Uncompress3
(
text
,
text
+
size
,
buf
+
GET_UINT
(
buf
,
0x10
),
end
);
}
/* need to decompress */
if
(
hlpfile
->
hasPhrases
)
HLPFILE_Uncompress2
(
buf
+
datalen
,
end
,
(
BYTE
*
)
text
,
(
BYTE
*
)
text
+
size
);
else
if
(
hlpfile
->
hasPhrases40
)
HLPFILE_Uncompress3
(
text
,
text
+
size
,
buf
+
datalen
,
end
);
else
{
text
=
(
char
*
)
buf
+
GET_UINT
(
buf
,
0x10
);
WINE_FIXME
(
"Text size is too long, splitting
\n
"
);
size
=
blocksize
-
datalen
;
memcpy
(
text
,
buf
+
datalen
,
size
);
}
}
else
memcpy
(
text
,
buf
+
datalen
,
size
);
text_end
=
text
+
size
;
format
=
buf
+
0x15
;
...
...
@@ -1694,7 +1698,7 @@ static BOOL HLPFILE_Uncompress_Phrases40(HLPFILE* hlpfile)
else
HLPFILE_UncompressLZ77
(
buf_phs
+
9
,
end_phs
,
(
BYTE
*
)
phrases
.
buffer
);
hlpfile
->
hasPhrases
=
FALS
E
;
hlpfile
->
hasPhrases
40
=
TRU
E
;
return
TRUE
;
}
...
...
programs/winhelp/hlpfile.h
View file @
7f2c7249
...
...
@@ -137,7 +137,8 @@ typedef struct tagHlpFileFile
unsigned
short
tbsize
;
/* topic block size */
unsigned
short
dsize
;
/* decompress size */
unsigned
short
compressed
;
unsigned
hasPhrases
;
/* Phrases or PhrIndex/PhrImage */
unsigned
hasPhrases
;
/* file has |Phrases */
unsigned
hasPhrases40
;
/* file has |PhrIndex/|PhrImage */
unsigned
numBmps
;
HBITMAP
*
bmps
;
...
...
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