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
c479ea63
Commit
c479ea63
authored
Aug 06, 2008
by
Juan Lang
Committed by
Alexandre Julliard
Sep 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabinet: Use helper function to remove duplicate code.
parent
70cfa0c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
55 deletions
+35
-55
fdi.c
dlls/cabinet/fdi.c
+35
-55
No files found.
dlls/cabinet/fdi.c
View file @
c479ea63
...
@@ -2277,6 +2277,39 @@ static void free_decompression_temps(HFDI hfdi, struct fdi_folder *fol,
...
@@ -2277,6 +2277,39 @@ static void free_decompression_temps(HFDI hfdi, struct fdi_folder *fol,
}
}
}
}
static
void
free_decompression_mem
(
HFDI
hfdi
,
struct
fdi_folder
*
fol
,
fdi_decomp_state
*
decomp_state
,
fdi_decomp_state
*
sentinel_decomp_state
,
struct
fdi_file
*
file
)
{
while
(
decomp_state
)
{
fdi_decomp_state
*
prev_fds
;
PFDI_CLOSE
(
hfdi
,
CAB
(
cabhf
));
/* free the storage remembered by mii */
if
(
CAB
(
mii
).
nextname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextname
);
if
(
CAB
(
mii
).
nextinfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextinfo
);
if
(
CAB
(
mii
).
prevname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
prevname
);
if
(
CAB
(
mii
).
previnfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
previnfo
);
while
(
CAB
(
firstfol
))
{
fol
=
CAB
(
firstfol
);
CAB
(
firstfol
)
=
CAB
(
firstfol
)
->
next
;
PFDI_FREE
(
hfdi
,
fol
);
}
while
(
CAB
(
firstfile
))
{
file
=
CAB
(
firstfile
);
if
(
file
->
filename
)
PFDI_FREE
(
hfdi
,
(
void
*
)
file
->
filename
);
CAB
(
firstfile
)
=
CAB
(
firstfile
)
->
next
;
PFDI_FREE
(
hfdi
,
file
);
}
prev_fds
=
decomp_state
;
decomp_state
=
CAB
(
next
);
if
(
prev_fds
!=
sentinel_decomp_state
)
PFDI_FREE
(
hfdi
,
prev_fds
);
}
}
/***********************************************************************
/***********************************************************************
* FDICopy (CABINET.22)
* FDICopy (CABINET.22)
*
*
...
@@ -2859,34 +2892,7 @@ BOOL __cdecl FDICopy(
...
@@ -2859,34 +2892,7 @@ BOOL __cdecl FDICopy(
}
}
free_decompression_temps
(
hfdi
,
fol
,
decomp_state
);
free_decompression_temps
(
hfdi
,
fol
,
decomp_state
);
free_decompression_mem
(
hfdi
,
fol
,
decomp_state
,
&
_decomp_state
,
file
);
while
(
decomp_state
)
{
fdi_decomp_state
*
prev_fds
;
PFDI_CLOSE
(
hfdi
,
CAB
(
cabhf
));
/* free the storage remembered by mii */
if
(
CAB
(
mii
).
nextname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextname
);
if
(
CAB
(
mii
).
nextinfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextinfo
);
if
(
CAB
(
mii
).
prevname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
prevname
);
if
(
CAB
(
mii
).
previnfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
previnfo
);
while
(
CAB
(
firstfol
))
{
fol
=
CAB
(
firstfol
);
CAB
(
firstfol
)
=
CAB
(
firstfol
)
->
next
;
PFDI_FREE
(
hfdi
,
fol
);
}
while
(
CAB
(
firstfile
))
{
file
=
CAB
(
firstfile
);
if
(
file
->
filename
)
PFDI_FREE
(
hfdi
,
(
void
*
)
file
->
filename
);
CAB
(
firstfile
)
=
CAB
(
firstfile
)
->
next
;
PFDI_FREE
(
hfdi
,
file
);
}
prev_fds
=
decomp_state
;
decomp_state
=
CAB
(
next
);
if
(
prev_fds
!=
&
_decomp_state
)
PFDI_FREE
(
hfdi
,
prev_fds
);
}
return
TRUE
;
return
TRUE
;
...
@@ -2896,33 +2902,7 @@ BOOL __cdecl FDICopy(
...
@@ -2896,33 +2902,7 @@ BOOL __cdecl FDICopy(
if
(
filehf
)
PFDI_CLOSE
(
hfdi
,
filehf
);
if
(
filehf
)
PFDI_CLOSE
(
hfdi
,
filehf
);
while
(
decomp_state
)
{
free_decompression_mem
(
hfdi
,
fol
,
decomp_state
,
&
_decomp_state
,
file
);
fdi_decomp_state
*
prev_fds
;
PFDI_CLOSE
(
hfdi
,
CAB
(
cabhf
));
/* free the storage remembered by mii */
if
(
CAB
(
mii
).
nextname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextname
);
if
(
CAB
(
mii
).
nextinfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
nextinfo
);
if
(
CAB
(
mii
).
prevname
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
prevname
);
if
(
CAB
(
mii
).
previnfo
)
PFDI_FREE
(
hfdi
,
CAB
(
mii
).
previnfo
);
while
(
CAB
(
firstfol
))
{
fol
=
CAB
(
firstfol
);
CAB
(
firstfol
)
=
CAB
(
firstfol
)
->
next
;
PFDI_FREE
(
hfdi
,
fol
);
}
while
(
CAB
(
firstfile
))
{
file
=
CAB
(
firstfile
);
if
(
file
->
filename
)
PFDI_FREE
(
hfdi
,
(
void
*
)
file
->
filename
);
CAB
(
firstfile
)
=
CAB
(
firstfile
)
->
next
;
PFDI_FREE
(
hfdi
,
file
);
}
prev_fds
=
decomp_state
;
decomp_state
=
CAB
(
next
);
if
(
prev_fds
!=
&
_decomp_state
)
PFDI_FREE
(
hfdi
,
prev_fds
);
}
return
FALSE
;
return
FALSE
;
}
}
...
...
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