Fix some problems when Extract is used more than once.
diff --git a/dlls/cabinet/cabextract.c b/dlls/cabinet/cabextract.c
index 5754707..7c2a5d4 100644
--- a/dlls/cabinet/cabextract.c
+++ b/dlls/cabinet/cabextract.c
@@ -46,6 +46,8 @@
*/
cab_UBYTE search_buf[CAB_SEARCH_SIZE];
+cab_decomp_state decomp_state;
+
/* all the file IO is abstracted into these routines:
* cabinet_(open|close|read|seek|skip|getoffset)
* file_(open|close|write)
@@ -2771,6 +2773,8 @@
/* has the list-mode header been seen before? */
int viewhdr = 0;
+ ZeroMemory(&decomp_state, sizeof(cab_decomp_state));
+
TRACE("Extract %s\n", debugstr_a(cabname));
/* load the file requested */
diff --git a/dlls/cabinet/cabinet.h b/dlls/cabinet/cabinet.h
index 7593c4b..1a0f463 100644
--- a/dlls/cabinet/cabinet.h
+++ b/dlls/cabinet/cabinet.h
@@ -269,7 +269,7 @@
cab_UBYTE flags; /* header flags */
};
-struct {
+typedef struct {
struct cab_folder *current; /* current folder we're extracting from */
cab_ULONG offset; /* uncompressed offset within folder */
cab_UBYTE *outpos; /* (high level) start of data to use up */
@@ -283,7 +283,7 @@
struct QTMstate qtm;
struct LZXstate lzx;
} methods;
-} decomp_state;
+} cab_decomp_state;
/* from cabextract.c */
BOOL process_cabinet(LPCSTR cabname, LPCSTR dir, BOOL fix, BOOL lower);