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
b8675b43
Commit
b8675b43
authored
Aug 02, 2003
by
Gregory M. Turner
Committed by
Alexandre Julliard
Aug 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remember decompression state during extraction, so as to avoid
unnecessary work.
parent
9e2b15da
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
25 deletions
+51
-25
fdi.c
dlls/cabinet/fdi.c
+51
-25
No files found.
dlls/cabinet/fdi.c
View file @
b8675b43
...
...
@@ -234,7 +234,7 @@ char *FDI_read_string(HFDI hfdi, INT_PTR hf, long cabsize)
if
(
!
ok
)
{
if
(
len
==
maxlen
)
{
ERR
(
"
WARNING:
cabinet is truncated
\n
"
);
ERR
(
"cabinet is truncated
\n
"
);
break
;
}
len
+=
256
;
...
...
@@ -2216,6 +2216,7 @@ BOOL __cdecl FDICopy(
if
(
filehf
)
{
cab_UWORD
comptype
=
fol
->
comp_type
;
int
ct1
=
comptype
&
cffoldCOMPTYPE_MASK
;
int
ct2
=
CAB
(
current
)
?
(
CAB
(
current
)
->
comp_type
&
cffoldCOMPTYPE_MASK
)
:
0
;
int
err
=
0
;
TRACE
(
"Extracting file %s as requested by callee.
\n
"
,
debugstr_a
(
file
->
filename
));
...
...
@@ -2224,10 +2225,34 @@ BOOL __cdecl FDICopy(
CAB
(
hfdi
)
=
hfdi
;
CAB
(
filehf
)
=
filehf
;
CAB
(
cabhf
)
=
cabhf
;
CAB
(
current
)
=
fol
;
/* Was there a change of folder? Compression type? Did we somehow go backwards? */
if
((
ct1
!=
ct2
)
||
(
CAB
(
current
)
!=
fol
)
||
(
file
->
offset
<
CAB
(
offset
)))
{
TRACE
(
"Resetting folder for file %s.
\n
"
,
debugstr_a
(
file
->
filename
));
/* free stuff for the old decompressor */
switch
(
ct2
)
{
case
cffoldCOMPTYPE_LZX
:
if
(
LZX
(
window
))
{
PFDI_FREE
(
hfdi
,
LZX
(
window
));
LZX
(
window
)
=
NULL
;
}
break
;
case
cffoldCOMPTYPE_QUANTUM
:
if
(
QTM
(
window
))
{
PFDI_FREE
(
hfdi
,
QTM
(
window
));
QTM
(
window
)
=
NULL
;
}
break
;
}
CAB
(
decomp_cab
)
=
NULL
;
PFDI_SEEK
(
CAB
(
hfdi
),
CAB
(
cabhf
),
fol
->
offset
,
SEEK_SET
);
CAB
(
offset
)
=
0
;
CAB
(
outlen
)
=
0
;
/* set up the appropriate
decompressor */
/* initialize the new
decompressor */
switch
(
ct1
)
{
case
cffoldCOMPTYPE_NONE
:
CAB
(
decompress
)
=
NONEfdi_decomp
;
...
...
@@ -2246,6 +2271,9 @@ BOOL __cdecl FDICopy(
default:
err
=
DECR_DATAFORMAT
;
}
}
CAB
(
current
)
=
fol
;
switch
(
err
)
{
case
DECR_OK
:
...
...
@@ -2263,10 +2291,6 @@ BOOL __cdecl FDICopy(
goto
bail_and_fail
;
}
PFDI_SEEK
(
CAB
(
hfdi
),
CAB
(
cabhf
),
fol
->
offset
,
SEEK_SET
);
CAB
(
offset
)
=
0
;
CAB
(
outlen
)
=
0
;
if
(
file
->
offset
>
CAB
(
offset
))
{
/* decode bytes and send them to /dev/null */
switch
((
err
=
fdi_decomp
(
file
,
0
,
decomp_state
,
pszCabPath
,
pfnfdin
,
pvUser
)))
{
...
...
@@ -2317,24 +2341,6 @@ BOOL __cdecl FDICopy(
goto
bail_and_fail
;
}
/* free decompression temps */
switch
(
ct1
)
{
case
cffoldCOMPTYPE_LZX
:
if
(
LZX
(
window
))
{
PFDI_FREE
(
hfdi
,
LZX
(
window
));
LZX
(
window
)
=
NULL
;
}
break
;
case
cffoldCOMPTYPE_QUANTUM
:
if
(
QTM
(
window
))
{
PFDI_FREE
(
hfdi
,
QTM
(
window
));
QTM
(
window
)
=
NULL
;
}
break
;
default:
break
;
}
/* fdintCLOSE_FILE_INFO notification */
ZeroMemory
(
&
fdin
,
sizeof
(
FDINOTIFICATION
));
fdin
.
pv
=
pvUser
;
...
...
@@ -2359,6 +2365,16 @@ BOOL __cdecl FDICopy(
}
}
/* free decompression temps */
if
(
LZX
(
window
))
{
PFDI_FREE
(
hfdi
,
LZX
(
window
));
LZX
(
window
)
=
NULL
;
}
if
(
QTM
(
window
))
{
PFDI_FREE
(
hfdi
,
QTM
(
window
));
QTM
(
window
)
=
NULL
;
}
while
(
decomp_state
)
{
fdi_decomp_state
*
prev_fds
;
...
...
@@ -2391,6 +2407,16 @@ BOOL __cdecl FDICopy(
bail_and_fail:
/* here we free ram before error returns */
/* free decompression temps */
if
(
LZX
(
window
))
{
PFDI_FREE
(
hfdi
,
LZX
(
window
));
LZX
(
window
)
=
NULL
;
}
if
(
QTM
(
window
))
{
PFDI_FREE
(
hfdi
,
QTM
(
window
));
QTM
(
window
)
=
NULL
;
}
while
(
decomp_state
)
{
fdi_decomp_state
*
prev_fds
;
...
...
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