From 92cc5868aecbd2468b5cee6b54f705d097d0008b Mon Sep 17 00:00:00 2001 From: Greg Turner Date: Thu, 23 Jan 2003 21:22:24 +0000 Subject: [PATCH] Fix some problems when Extract is used more than once. --- dlls/cabinet/cabextract.c | 4 ++++ dlls/cabinet/cabinet.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/cabinet/cabextract.c b/dlls/cabinet/cabextract.c index 57547077088..7c2a5d4242a 100644 --- a/dlls/cabinet/cabextract.c +++ b/dlls/cabinet/cabextract.c @@ -46,6 +46,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(cabinet); */ 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 @@ BOOL process_cabinet(LPCSTR cabname, LPCSTR dir, BOOL fix, BOOL lower) /* 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 7593c4b3782..1a0f4634979 100644 --- a/dlls/cabinet/cabinet.h +++ b/dlls/cabinet/cabinet.h @@ -269,7 +269,7 @@ struct cabinet { 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 { 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);