This commit is contained in:
Igor Pavlov
2005-06-28 00:00:00 +00:00
committed by Kornel Lesiński
parent 3c510ba80b
commit ac2b563958
83 changed files with 3668 additions and 1316 deletions

View File

@@ -75,8 +75,8 @@ IDI_ICON1 ICON DISCARDABLE "7z.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,20,0,0
PRODUCTVERSION 4,20,0,0
FILEVERSION 4,23,0,0
PRODUCTVERSION 4,23,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -94,14 +94,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov\0"
VALUE "FileDescription", "7z Plugin for 7-Zip\0"
VALUE "FileVersion", "4, 20, 0, 0\0"
VALUE "FileVersion", "4, 23, 0, 0\0"
VALUE "InternalName", "7z\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2005 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "7z.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "4, 20, 0, 0\0"
VALUE "ProductVersion", "4, 23, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END

View File

@@ -19,14 +19,14 @@ typedef struct _CLzmaInCallbackImp
size_t Size;
} CLzmaInCallbackImp;
int LzmaReadImp(void *object, unsigned char **buffer, UInt32 *size)
int LzmaReadImp(void *object, const unsigned char **buffer, SizeT *size)
{
CLzmaInCallbackImp *cb = (CLzmaInCallbackImp *)object;
size_t processedSize;
SZ_RESULT res;
*size = 0;
res = cb->InStream->Read((void *)cb->InStream, (void **)buffer, cb->Size, &processedSize);
*size = (UInt32)processedSize;
*size = (SizeT)processedSize;
if (processedSize > cb->Size)
return (int)SZE_FAIL;
cb->Size -= processedSize;
@@ -37,11 +37,11 @@ int LzmaReadImp(void *object, unsigned char **buffer, UInt32 *size)
#endif
SZ_RESULT SzDecode(CFileSize *packSizes, CFolder *folder,
SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder,
#ifdef _LZMA_IN_CB
ISzInStream *inStream,
#else
Byte *inBuffer,
const Byte *inBuffer,
#endif
Byte *outBuffer, size_t outSize,
size_t *outSizeProcessed, ISzAlloc *allocMain)
@@ -91,13 +91,13 @@ SZ_RESULT SzDecode(CFileSize *packSizes, CFolder *folder,
{
#ifdef _LZMA_IN_CB
CLzmaInCallbackImp lzmaCallback;
#else
SizeT inProcessed;
#endif
int lc, lp, pb;
size_t lzmaInternalSize;
void *lzmaInternalData;
CLzmaDecoderState state; /* it's about 24-80 bytes structure, if int is 32-bit */
int result;
UInt32 outSizeProcessedLoc;
SizeT outSizeProcessedLoc;
#ifdef _LZMA_IN_CB
lzmaCallback.Size = inSize;
@@ -105,35 +105,36 @@ SZ_RESULT SzDecode(CFileSize *packSizes, CFolder *folder,
lzmaCallback.InCallback.Read = LzmaReadImp;
#endif
if (coder->Properties.Capacity < 5)
if (LzmaDecodeProperties(&state.Properties, coder->Properties.Items,
coder->Properties.Capacity) != LZMA_RESULT_OK)
return SZE_FAIL;
lc = (unsigned char)coder->Properties.Items[0];
if (lc >= (9 * 5 * 5))
return SZE_FAIL;
for (pb = 0; lc >= (9 * 5); pb++, lc -= (9 * 5));
for (lp = 0; lc >= 9; lp++, lc -= 9);
lzmaInternalSize = (LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp))) * sizeof(CProb);
lzmaInternalData = allocMain->Alloc(lzmaInternalSize);
if (lzmaInternalData == 0)
state.Probs = (CProb *)allocMain->Alloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
if (state.Probs == 0)
return SZE_OUTOFMEMORY;
result = LzmaDecode((Byte *)lzmaInternalData, (UInt32)lzmaInternalSize,
lc, lp, pb,
#ifdef _LZMA_OUT_READ
state.Dictionary = (unsigned char *)allocMain->Alloc(state.Properties.DictionarySize);
if (state.Dictionary == 0)
{
allocMain->Free(state.Probs);
return SZE_OUTOFMEMORY;
}
LzmaDecoderInit(&state);
#endif
result = LzmaDecode(&state,
#ifdef _LZMA_IN_CB
&lzmaCallback.InCallback,
#else
inBuffer, (UInt32)inSize,
inBuffer, (SizeT)inSize, &inProcessed,
#endif
outBuffer, (UInt32)outSize,
&outSizeProcessedLoc);
outBuffer, (SizeT)outSize, &outSizeProcessedLoc);
*outSizeProcessed = (size_t)outSizeProcessedLoc;
allocMain->Free(lzmaInternalData);
/*
NOT_ENOUGH_MEM error is impossible for this code
if (result = LZMA_RESULT_NOT_ENOUGH_MEM)
return SZE_OUTOFMEMORY;
*/
allocMain->Free(state.Probs);
#ifdef _LZMA_OUT_READ
allocMain->Free(state.Dictionary);
#endif
if (result == LZMA_RESULT_DATA_ERROR)
return SZE_DATA_ERROR;
if (result != LZMA_RESULT_OK)

View File

@@ -9,11 +9,11 @@
#include "7zIn.h"
#endif
SZ_RESULT SzDecode(CFileSize *packSizes, CFolder *folder,
SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder,
#ifdef _LZMA_IN_CB
ISzInStream *stream,
#else
Byte *inBuffer,
const Byte *inBuffer,
#endif
Byte *outBuffer, size_t outSize,
size_t *outSizeProcessed, ISzAlloc *allocMain);

View File

@@ -811,7 +811,9 @@ SZ_RESULT SzReadStreamsInfo(
{
UInt64 type;
RINOK(SzReadID(sd, &type));
switch(type)
if ((UInt64)(int)type != type)
return SZE_FAIL;
switch((int)type)
{
case k7zIdEnd:
return SZ_OK;
@@ -989,8 +991,13 @@ SZ_RESULT SzReadHeader2(
if (type == k7zIdEnd)
break;
RINOK(SzReadNumber(sd, &size));
switch(type)
if ((UInt64)(int)type != type)
{
RINOK(SzSkeepDataSize(sd, size));
}
else
switch((int)type)
{
case k7zIdName:
{

View File

@@ -75,8 +75,8 @@ IDI_ICON1 ICON DISCARDABLE "arj.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,13,0,0
PRODUCTVERSION 4,13,0,0
FILEVERSION 4,23,0,0
PRODUCTVERSION 4,23,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -94,14 +94,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov\0"
VALUE "FileDescription", "Arj Plugin for 7-Zip\0"
VALUE "FileVersion", "4, 13, 0, 0\0"
VALUE "FileVersion", "4, 23, 0, 0\0"
VALUE "InternalName", "arj\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2004 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "arj.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "4, 13, 0, 0\0"
VALUE "ProductVersion", "4, 23, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END

View File

@@ -21,8 +21,8 @@ CDecoder::CDecoder()
void CDecoder::ReleaseStreams()
{
// m_OutWindowStream.ReleaseStream();
// m_InBitStream.ReleaseStream();
m_OutWindowStream.ReleaseStream();
m_InBitStream.ReleaseStream();
m_i86TranslationOutStreamSpec->ReleaseStream();
}

View File

@@ -17,13 +17,11 @@ HRESULT CDecoder::Flush()
return m_OutWindowStream.Flush();
}
/*
void CDecoder::ReleaseStreams()
{
m_OutWindowStream.ReleaseStream();
m_InBitStream.ReleaseStream();
}
*/
void CDecoder::DeCodeLevelTable(Byte *newLevels, int numLevels)
{
@@ -169,7 +167,7 @@ public:
~CCoderReleaser()
{
m_Coder->Flush();
// m_Coder->ReleaseStreams();
m_Coder->ReleaseStreams();
}
};

View File

@@ -66,7 +66,7 @@ public:
MY_UNKNOWN_IMP
HRESULT Flush();
// void ReleaseStreams();
void ReleaseStreams();
STDMETHOD(Code)(ISequentialInStream *inStream,
ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,

View File

@@ -66,8 +66,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,19,0,0
PRODUCTVERSION 4,19,0,0
FILEVERSION 4,23,0,0
PRODUCTVERSION 4,23,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -85,14 +85,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov \0"
VALUE "FileDescription", "Cab Plugin for 7-Zip\0"
VALUE "FileVersion", "4, 19, 0, 0\0"
VALUE "FileVersion", "4, 23, 0, 0\0"
VALUE "InternalName", "cab\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2005 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "cab.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "4, 19, 0, 0\0"
VALUE "ProductVersion", "4, 23, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END

View File

@@ -75,8 +75,8 @@ IDI_ICON1 ICON DISCARDABLE "zip.ico"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,19,0,0
PRODUCTVERSION 4,19,0,0
FILEVERSION 4,23,0,0
PRODUCTVERSION 4,23,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -94,14 +94,14 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Igor Pavlov\0"
VALUE "FileDescription", "Zip Plugin for 7-Zip\0"
VALUE "FileVersion", "4, 19, 0, 0\0"
VALUE "FileVersion", "4, 23, 0, 0\0"
VALUE "InternalName", "zip\0"
VALUE "LegalCopyright", "Copyright (C) 1999-2005 Igor Pavlov\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "zip.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "7-Zip\0"
VALUE "ProductVersion", "4, 19, 0, 0\0"
VALUE "ProductVersion", "4, 23, 0, 0\0"
VALUE "SpecialBuild", "\0"
END
END