4.48 beta

This commit is contained in:
Igor Pavlov
2007-06-26 00:00:00 +00:00
committed by Kornel Lesiński
parent 0b33f700a6
commit fd8b1d78b4
249 changed files with 3224 additions and 2157 deletions

View File

@@ -290,6 +290,22 @@ SOURCE=..\..\..\Common\IntToString.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyString.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyString.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyVector.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyVector.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\NewHandler.cpp
# End Source File
# Begin Source File
@@ -298,14 +314,6 @@ SOURCE=..\..\..\Common\NewHandler.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\String.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\String.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\StringConvert.cpp
# End Source File
# Begin Source File
@@ -320,14 +328,6 @@ SOURCE=..\..\..\Common\StringToInt.cpp
SOURCE=..\..\..\Common\StringToInt.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\Vector.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\Vector.h
# End Source File
# End Group
# Begin Group "Archive Common"
@@ -358,6 +358,14 @@ SOURCE=..\Common\CrossThreadProgress.h
# End Source File
# Begin Source File
SOURCE=..\Common\HandlerOut.cpp
# End Source File
# Begin Source File
SOURCE=..\Common\HandlerOut.h
# End Source File
# Begin Source File
SOURCE=..\Common\InStreamWithCRC.cpp
# End Source File
# Begin Source File
@@ -450,6 +458,14 @@ SOURCE=..\..\Common\MethodId.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\MethodProps.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Common\MethodProps.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\OutBuffer.cpp
# End Source File
# Begin Source File
@@ -496,6 +512,14 @@ SOURCE=..\..\Common\StreamUtils.cpp
SOURCE=..\..\Common\StreamUtils.h
# End Source File
# Begin Source File
SOURCE=..\..\Common\VirtThread.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Common\VirtThread.h
# End Source File
# End Group
# Begin Group "Windows"
@@ -558,6 +582,14 @@ SOURCE=..\..\..\Windows\Synchronization.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Windows\System.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Windows\System.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Windows\Thread.h
# End Source File
# End Group
@@ -594,6 +626,15 @@ SOURCE=..\..\..\..\C\Alloc.c
SOURCE=..\..\..\..\C\Alloc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Threads.c
# SUBTRACT CPP /YX /Yc /Yu
# End Source File
# Begin Source File
SOURCE=..\..\..\..\C\Threads.h
# End Source File
# End Group
# Begin Source File

View File

@@ -3,28 +3,20 @@
#ifndef __7Z_COMPRESSION_MODE_H
#define __7Z_COMPRESSION_MODE_H
#include "../../../Common/String.h"
#include "../../../Common/MyString.h"
#include "../../../Windows/PropVariant.h"
#include "../../Common/MethodId.h"
#include "../../Common/MethodProps.h"
namespace NArchive {
namespace N7z {
struct CProperty
struct CMethodFull: public CMethod
{
PROPID PropID;
NWindows::NCOM::CPropVariant Value;
};
struct CMethodFull
{
CMethodId MethodID;
UInt32 NumInStreams;
UInt32 NumOutStreams;
bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); }
CObjectVector<CProperty> CoderProperties;
};
struct CBind

View File

@@ -22,7 +22,7 @@ static void ConvertFolderItemInfoToBindInfo(const CFolder &folder,
int i;
for (i = 0; i < folder.BindPairs.Size(); i++)
{
NCoderMixer2::CBindPair bindPair;
NCoderMixer::CBindPair bindPair;
bindPair.InIndex = (UInt32)folder.BindPairs[i].InIndex;
bindPair.OutIndex = (UInt32)folder.BindPairs[i].OutIndex;
bindInfo.BindPairs.Add(bindPair);
@@ -30,7 +30,7 @@ static void ConvertFolderItemInfoToBindInfo(const CFolder &folder,
UInt32 outStreamIndex = 0;
for (i = 0; i < folder.Coders.Size(); i++)
{
NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
NCoderMixer::CCoderStreamsInfo coderStreamsInfo;
const CCoderInfo &coderInfo = folder.Coders[i];
coderStreamsInfo.NumInStreams = (UInt32)coderInfo.NumInStreams;
coderStreamsInfo.NumOutStreams = (UInt32)coderInfo.NumOutStreams;
@@ -44,14 +44,14 @@ static void ConvertFolderItemInfoToBindInfo(const CFolder &folder,
bindInfo.InStreams.Add((UInt32)folder.PackStreams[i]);
}
static bool AreCodersEqual(const NCoderMixer2::CCoderStreamsInfo &a1,
const NCoderMixer2::CCoderStreamsInfo &a2)
static bool AreCodersEqual(const NCoderMixer::CCoderStreamsInfo &a1,
const NCoderMixer::CCoderStreamsInfo &a2)
{
return (a1.NumInStreams == a2.NumInStreams) &&
(a1.NumOutStreams == a2.NumOutStreams);
}
static bool AreBindPairsEqual(const NCoderMixer2::CBindPair &a1, const NCoderMixer2::CBindPair &a2)
static bool AreBindPairsEqual(const NCoderMixer::CBindPair &a1, const NCoderMixer::CBindPair &a2)
{
return (a1.InIndex == a2.InIndex) &&
(a1.OutIndex == a2.OutIndex);
@@ -145,14 +145,14 @@ HRESULT CDecoder::Decode(
if (_multiThread)
{
_mixerCoderMTSpec = new NCoderMixer2::CCoderMixer2MT;
_mixerCoderMTSpec = new NCoderMixer::CCoderMixer2MT;
_mixerCoder = _mixerCoderMTSpec;
_mixerCoderCommon = _mixerCoderMTSpec;
}
else
{
#ifdef _ST_MODE
_mixerCoderSTSpec = new NCoderMixer2::CCoderMixer2ST;
_mixerCoderSTSpec = new NCoderMixer::CCoderMixer2ST;
_mixerCoder = _mixerCoderSTSpec;
_mixerCoderCommon = _mixerCoderSTSpec;
#endif

View File

@@ -19,7 +19,7 @@
namespace NArchive {
namespace N7z {
struct CBindInfoEx: public NCoderMixer2::CBindInfo
struct CBindInfoEx: public NCoderMixer::CBindInfo
{
CRecordVector<CMethodId> CoderMethodIDs;
void Clear()
@@ -36,10 +36,10 @@ class CDecoder
bool _multiThread;
#ifdef _ST_MODE
NCoderMixer2::CCoderMixer2ST *_mixerCoderSTSpec;
NCoderMixer::CCoderMixer2ST *_mixerCoderSTSpec;
#endif
NCoderMixer2::CCoderMixer2MT *_mixerCoderMTSpec;
NCoderMixer2::CCoderMixer2 *_mixerCoderCommon;
NCoderMixer::CCoderMixer2MT *_mixerCoderMTSpec;
NCoderMixer::CCoderMixer2 *_mixerCoderCommon;
CMyComPtr<ICompressCoder2> _mixerCoder;
CObjectVector<CMyComPtr<IUnknown> > _decoders;

View File

@@ -13,14 +13,12 @@
#include "../../Common/CreateCoder.h"
#include "../../Common/FilterCoder.h"
static UInt64 k_LZMA = 0x030101;
// static UInt64 k_LZMA2 = 0x030102;
static UInt64 k_AES = 0x06F10701;
namespace NArchive {
namespace N7z {
static void ConvertBindInfoToFolderItemInfo(const NCoderMixer2::CBindInfo &bindInfo,
static void ConvertBindInfoToFolderItemInfo(const NCoderMixer::CBindInfo &bindInfo,
const CRecordVector<CMethodId> decompressionMethods,
CFolder &folder)
{
@@ -40,7 +38,7 @@ static void ConvertBindInfoToFolderItemInfo(const NCoderMixer2::CBindInfo &bindI
for (i = 0; i < bindInfo.Coders.Size(); i++)
{
CCoderInfo coderInfo;
const NCoderMixer2::CCoderStreamsInfo &coderStreamsInfo = bindInfo.Coders[i];
const NCoderMixer::CCoderStreamsInfo &coderStreamsInfo = bindInfo.Coders[i];
coderInfo.NumInStreams = coderStreamsInfo.NumInStreams;
coderInfo.NumOutStreams = coderStreamsInfo.NumOutStreams;
coderInfo.MethodID = decompressionMethods[i];
@@ -54,49 +52,25 @@ HRESULT CEncoder::CreateMixerCoder(
DECL_EXTERNAL_CODECS_LOC_VARS
const UInt64 *inSizeForReduce)
{
_mixerCoderSpec = new NCoderMixer2::CCoderMixer2MT;
_mixerCoderSpec = new NCoderMixer::CCoderMixer2MT;
_mixerCoder = _mixerCoderSpec;
RINOK(_mixerCoderSpec->SetBindInfo(_bindInfo));
for (int i = 0; i < _options.Methods.Size(); i++)
{
const CMethodFull &methodFull = _options.Methods[i];
_codersInfo.Add(CCoderInfo());
CCoderInfo &encodingInfo = _codersInfo.Back();
// CCoderInfo &encodingInfo = _codersInfo.Back();
CMyComPtr<ICompressCoder> encoder;
CMyComPtr<ICompressCoder2> encoder2;
RINOK(CreateCoder(
EXTERNAL_CODECS_LOC_VARS
methodFull.MethodID, encoder, encoder2, true));
methodFull.Id, encoder, encoder2, true));
if (!encoder && !encoder2)
return E_FAIL;
bool tryReduce = false;
UInt32 reducedDictionarySize = 1 << 10;
if (inSizeForReduce != 0 && (methodFull.MethodID == k_LZMA /* || methodFull.MethodID == k_LZMA2 */))
{
for (;;)
{
const UInt32 step = (reducedDictionarySize >> 1);
if (reducedDictionarySize >= *inSizeForReduce)
{
tryReduce = true;
break;
}
reducedDictionarySize += step;
if (reducedDictionarySize >= *inSizeForReduce)
{
tryReduce = true;
break;
}
if (reducedDictionarySize >= ((UInt32)11 << 30))
break;
reducedDictionarySize += step;
}
}
CMyComPtr<IUnknown> encoderCommon = encoder ? (IUnknown *)encoder : (IUnknown *)encoder2;
#ifdef COMPRESS_MT
@@ -110,50 +84,17 @@ HRESULT CEncoder::CreateMixerCoder(
}
#endif
if (methodFull.CoderProperties.Size() > 0)
RINOK(SetMethodProperties(methodFull, inSizeForReduce, encoderCommon));
/*
CMyComPtr<ICryptoResetSalt> resetSalt;
encoderCommon.QueryInterface(IID_ICryptoResetSalt, (void **)&resetSalt);
if (resetSalt != NULL)
{
CRecordVector<PROPID> propIDs;
int numProperties = methodFull.CoderProperties.Size();
NWindows::NCOM::CPropVariant *values = new NWindows::NCOM::CPropVariant[numProperties];
try
{
for (int i = 0; i < numProperties; i++)
{
const CProperty &property = methodFull.CoderProperties[i];
propIDs.Add(property.PropID);
NWindows::NCOM::CPropVariant value = property.Value;
if (tryReduce && property.PropID == NCoderPropID::kDictionarySize && value.vt == VT_UI4 && reducedDictionarySize < value.ulVal)
value.ulVal = reducedDictionarySize;
values[i] = value;
}
CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
RINOK(encoderCommon.QueryInterface(IID_ICompressSetCoderProperties, &setCoderProperties));
RINOK(setCoderProperties->SetCoderProperties(&propIDs.Front(), values, numProperties));
}
catch(...)
{
delete []values;
throw;
}
delete []values;
}
CMyComPtr<ICompressWriteCoderProperties> writeCoderProperties;
encoderCommon.QueryInterface(IID_ICompressWriteCoderProperties, &writeCoderProperties);
if (writeCoderProperties != NULL)
{
CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp;
CMyComPtr<ISequentialOutStream> outStream(outStreamSpec);
outStreamSpec->Init();
writeCoderProperties->WriteCoderProperties(outStream);
size_t size = outStreamSpec->GetSize();
encodingInfo.Properties.SetCapacity(size);
memmove(encodingInfo.Properties, outStreamSpec->GetBuffer(), size);
resetSalt->ResetSalt();
}
*/
#ifdef EXTERNAL_CODECS
CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo;
@@ -268,6 +209,31 @@ HRESULT CEncoder::Encode(
outStreamPointers.Add(outStreamSizeCount);
for (i = 1; i < _bindInfo.OutStreams.Size(); i++)
outStreamPointers.Add(tempBuffers[i - 1]);
for (i = 0; i < _codersInfo.Size(); i++)
{
CCoderInfo &encodingInfo = _codersInfo[i];
CMyComPtr<ICryptoResetInitVector> resetInitVector;
_mixerCoderSpec->_coders[i].QueryInterface(IID_ICryptoResetInitVector, (void **)&resetInitVector);
if (resetInitVector != NULL)
{
resetInitVector->ResetInitVector();
}
CMyComPtr<ICompressWriteCoderProperties> writeCoderProperties;
_mixerCoderSpec->_coders[i].QueryInterface(IID_ICompressWriteCoderProperties, (void **)&writeCoderProperties);
if (writeCoderProperties != NULL)
{
CSequentialOutStreamImp *outStreamSpec = new CSequentialOutStreamImp;
CMyComPtr<ISequentialOutStream> outStream(outStreamSpec);
outStreamSpec->Init();
writeCoderProperties->WriteCoderProperties(outStream);
size_t size = outStreamSpec->GetSize();
encodingInfo.Properties.SetCapacity(size);
memmove(encodingInfo.Properties, outStreamSpec->GetBuffer(), size);
}
}
RINOK(_mixerCoder->Code(&inStreamPointers.Front(), NULL, 1,
&outStreamPointers.Front(), NULL, outStreamPointers.Size(), compressProgress));
@@ -325,14 +291,14 @@ HRESULT CEncoder::EncoderConstr()
throw 1;
if (!_options.Binds.IsEmpty())
throw 1;
NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
NCoderMixer::CCoderStreamsInfo coderStreamsInfo;
CMethodFull method;
method.NumInStreams = 1;
method.NumOutStreams = 1;
coderStreamsInfo.NumInStreams = 1;
coderStreamsInfo.NumOutStreams = 1;
method.MethodID = k_AES;
method.Id = k_AES;
_options.Methods.Add(method);
_bindInfo.Coders.Add(coderStreamsInfo);
@@ -348,14 +314,14 @@ HRESULT CEncoder::EncoderConstr()
for (i = 0; i < _options.Methods.Size(); i++)
{
const CMethodFull &methodFull = _options.Methods[i];
NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
NCoderMixer::CCoderStreamsInfo coderStreamsInfo;
coderStreamsInfo.NumInStreams = methodFull.NumOutStreams;
coderStreamsInfo.NumOutStreams = methodFull.NumInStreams;
if (_options.Binds.IsEmpty())
{
if (i < _options.Methods.Size() - 1)
{
NCoderMixer2::CBindPair bindPair;
NCoderMixer::CBindPair bindPair;
bindPair.InIndex = numInStreams + coderStreamsInfo.NumInStreams;
bindPair.OutIndex = numOutStreams;
_bindInfo.BindPairs.Add(bindPair);
@@ -376,7 +342,7 @@ HRESULT CEncoder::EncoderConstr()
{
for (i = 0; i < _options.Binds.Size(); i++)
{
NCoderMixer2::CBindPair bindPair;
NCoderMixer::CBindPair bindPair;
const CBind &bind = _options.Binds[i];
bindPair.InIndex = _bindInfo.GetCoderInStreamIndex(bind.InCoder) + bind.InStream;
bindPair.OutIndex = _bindInfo.GetCoderOutStreamIndex(bind.OutCoder) + bind.OutStream;
@@ -423,7 +389,7 @@ HRESULT CEncoder::EncoderConstr()
for (i = 0; i < numCryptoStreams; i++)
{
NCoderMixer2::CBindPair bindPair;
NCoderMixer::CBindPair bindPair;
bindPair.InIndex = numInStreams + i;
bindPair.OutIndex = _bindInfo.OutStreams[i];
_bindInfo.BindPairs.Add(bindPair);
@@ -437,13 +403,13 @@ HRESULT CEncoder::EncoderConstr()
for (i = 0; i < numCryptoStreams; i++)
{
NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
NCoderMixer::CCoderStreamsInfo coderStreamsInfo;
CMethodFull method;
method.NumInStreams = 1;
method.NumOutStreams = 1;
coderStreamsInfo.NumInStreams = method.NumOutStreams;
coderStreamsInfo.NumOutStreams = method.NumInStreams;
method.MethodID = k_AES;
method.Id = k_AES;
_options.Methods.Add(method);
_bindInfo.Coders.Add(coderStreamsInfo);
@@ -456,10 +422,10 @@ HRESULT CEncoder::EncoderConstr()
for (int i = _options.Methods.Size() - 1; i >= 0; i--)
{
const CMethodFull &methodFull = _options.Methods[i];
_decompressionMethods.Add(methodFull.MethodID);
_decompressionMethods.Add(methodFull.Id);
}
_bindReverseConverter = new NCoderMixer2::CBindReverseConverter(_bindInfo);
_bindReverseConverter = new NCoderMixer::CBindReverseConverter(_bindInfo);
_bindReverseConverter->CreateReverseBindInfo(_decompressBindInfo);
_constructed = true;
return S_OK;

View File

@@ -21,15 +21,15 @@ namespace N7z {
class CEncoder
{
NCoderMixer2::CCoderMixer2MT *_mixerCoderSpec;
NCoderMixer::CCoderMixer2MT *_mixerCoderSpec;
CMyComPtr<ICompressCoder2> _mixerCoder;
CObjectVector<CCoderInfo> _codersInfo;
CCompressionMethodMode _options;
NCoderMixer2::CBindInfo _bindInfo;
NCoderMixer2::CBindInfo _decompressBindInfo;
NCoderMixer2::CBindReverseConverter *_bindReverseConverter;
NCoderMixer::CBindInfo _bindInfo;
NCoderMixer::CBindInfo _decompressBindInfo;
NCoderMixer::CBindReverseConverter *_bindReverseConverter;
CRecordVector<CMethodId> _decompressionMethods;
HRESULT CreateMixerCoder(DECL_EXTERNAL_CODECS_LOC_VARS

View File

@@ -20,6 +20,10 @@
#endif
#endif
#ifdef COMPRESS_MT
#include "../../../Windows/System.h"
#endif
using namespace NWindows;
extern UString ConvertMethodIdToString(UInt64 id);
@@ -29,10 +33,11 @@ namespace N7z {
CHandler::CHandler()
{
#ifdef EXTRACT_ONLY
#ifdef COMPRESS_MT
_numThreads = NWindows::NSystem::GetNumberOfProcessors();
#endif
#ifndef EXTRACT_ONLY
#else
Init();
#endif
}

View File

@@ -9,12 +9,12 @@
#include "7zCompressionMode.h"
#ifdef COMPRESS_MT
#include "../../../Windows/System.h"
#endif
#include "../../Common/CreateCoder.h"
#ifndef EXTRACT_ONLY
#include "../Common/HandlerOut.h"
#endif
namespace NArchive {
namespace N7z {
@@ -44,15 +44,6 @@ struct CVolume
};
#endif
#ifndef EXTRACT_ONLY
struct COneMethodInfo
{
CObjectVector<CProperty> CoderProperties;
UString MethodName;
};
#endif
// {23170F69-40C1-278A-1000-000110070000}
DEFINE_GUID(CLSID_CFormat7z,
0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
@@ -71,6 +62,9 @@ DEFINE_GUID(CLSID_CFormat7z,
class CHandler:
#ifndef EXTRACT_ONLY
public NArchive::COutHandler,
#endif
public IInArchive,
#ifdef _7Z_VOL
public IInArchiveGetStream,
@@ -137,8 +131,6 @@ public:
// ISetProperties
HRESULT SetSolidSettings(const UString &s);
HRESULT SetSolidSettings(const PROPVARIANT &value);
#endif
DECL_ISetCompressCodecsInfo
@@ -154,37 +146,15 @@ private:
NArchive::N7z::CArchiveDatabaseEx _database;
#endif
#ifdef EXTRACT_ONLY
#ifdef COMPRESS_MT
UInt32 _numThreads;
#endif
#ifndef EXTRACT_ONLY
CObjectVector<COneMethodInfo> _methods;
#else
CRecordVector<CBind> _binds;
bool _removeSfxBlock;
UInt64 _numSolidFiles;
UInt64 _numSolidBytes;
bool _numSolidBytesDefined;
bool _solidExtension;
bool _compressHeaders;
bool _encryptHeaders;
bool WriteModified;
bool WriteCreated;
bool WriteAccessed;
bool _autoFilter;
UInt32 _level;
bool _volumeMode;
DECL_EXTERNAL_CODECS_VARS
HRESULT SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value);
HRESULT SetParams(COneMethodInfo &oneMethodInfo, const UString &srcString);
HRESULT SetPassword(CCompressionMethodMode &methodMode, IArchiveUpdateCallback *updateCallback);
@@ -208,39 +178,6 @@ private:
void FillPopIDs();
#endif
#ifndef EXTRACT_ONLY
void InitSolidFiles() { _numSolidFiles = UInt64(Int64(-1)); }
void InitSolidSize() { _numSolidBytes = UInt64(Int64(-1)); }
void InitSolid()
{
InitSolidFiles();
InitSolidSize();
_solidExtension = false;
_numSolidBytesDefined = false;
}
void Init()
{
_removeSfxBlock = false;
_compressHeaders = true;
_encryptHeaders = false;
WriteModified = true;
WriteCreated = false;
WriteAccessed = false;
#ifdef COMPRESS_MT
_numThreads = NWindows::NSystem::GetNumberOfProcessors();
#endif
_level = 5;
_autoFilter = true;
_volumeMode = false;
InitSolid();
}
#endif
};
}}

View File

@@ -1,4 +1,4 @@
// 7z/OutHandler.cpp
// 7zHandlerOut.cpp
#include "StdAfx.h"
@@ -21,90 +21,19 @@ using namespace NWindows;
namespace NArchive {
namespace N7z {
const wchar_t *kCopyMethod = L"Copy";
const wchar_t *kLZMAMethodName = L"LZMA";
const wchar_t *kLZMA2MethodName = L"LZMA2";
const wchar_t *kBZip2MethodName = L"BZip2";
const wchar_t *kPpmdMethodName = L"PPMd";
const wchar_t *kDeflateMethodName = L"Deflate";
const wchar_t *kDeflate64MethodName = L"Deflate64";
static const wchar_t *kLZMAMethodName = L"LZMA";
static const wchar_t *kCopyMethod = L"Copy";
static const wchar_t *kDefaultMethodName = kLZMAMethodName;
static const wchar_t *kLzmaMatchFinderX1 = L"HC4";
static const wchar_t *kLzmaMatchFinderX5 = L"BT4";
static const UInt32 kLzmaAlgorithmX1 = 0;
static const UInt32 kLzmaAlgorithmX5 = 1;
static const UInt32 kLzmaDicSizeX1 = 1 << 16;
static const UInt32 kLzmaDicSizeX3 = 1 << 20;
static const UInt32 kLzmaDicSizeX5 = 1 << 24;
static const UInt32 kLzmaDicSizeX7 = 1 << 25;
static const UInt32 kLzmaDicSizeX9 = 1 << 26;
static const UInt32 kLzmaFastBytesX1 = 32;
static const UInt32 kLzmaFastBytesX7 = 64;
static const UInt32 kPpmdMemSizeX1 = (1 << 22);
static const UInt32 kPpmdMemSizeX5 = (1 << 24);
static const UInt32 kPpmdMemSizeX7 = (1 << 26);
static const UInt32 kPpmdMemSizeX9 = (192 << 20);
static const UInt32 kPpmdOrderX1 = 4;
static const UInt32 kPpmdOrderX5 = 6;
static const UInt32 kPpmdOrderX7 = 16;
static const UInt32 kPpmdOrderX9 = 32;
static const UInt32 kDeflateAlgoX1 = 0;
static const UInt32 kDeflateAlgoX5 = 1;
static const UInt32 kDeflateFastBytesX1 = 32;
static const UInt32 kDeflateFastBytesX7 = 64;
static const UInt32 kDeflateFastBytesX9 = 128;
static const UInt32 kDeflatePassesX1 = 1;
static const UInt32 kDeflatePassesX7 = 3;
static const UInt32 kDeflatePassesX9 = 10;
static const UInt32 kBZip2NumPassesX1 = 1;
static const UInt32 kBZip2NumPassesX7 = 2;
static const UInt32 kBZip2NumPassesX9 = 7;
static const UInt32 kBZip2DicSizeX1 = 100000;
static const UInt32 kBZip2DicSizeX3 = 500000;
static const UInt32 kBZip2DicSizeX5 = 900000;
const wchar_t *kDefaultMethodName = kLZMAMethodName;
static const wchar_t *kLzmaMatchFinderForHeaders = L"BT2";
static const UInt32 kDictionaryForHeaders = 1 << 20;
static const UInt32 kNumFastBytesForHeaders = 273;
static const UInt32 kAlgorithmForHeaders = kLzmaAlgorithmX5;
static bool IsCopyMethod(const UString &methodName)
static inline bool IsCopyMethod(const UString &methodName)
{ return (methodName.CompareNoCase(kCopyMethod) == 0); }
static bool IsLZMAMethod(const UString &methodName)
{
return
(methodName.CompareNoCase(kLZMAMethodName) == 0) ||
(methodName.CompareNoCase(kLZMA2MethodName) == 0);
}
/*
static bool IsLZMethod(const UString &methodName)
{ return IsLZMAMethod(methodName); }
*/
static bool IsBZip2Method(const UString &methodName)
{ return (methodName.CompareNoCase(kBZip2MethodName) == 0); }
static bool IsPpmdMethod(const UString &methodName)
{ return (methodName.CompareNoCase(kPpmdMethodName) == 0); }
static bool IsDeflateMethod(const UString &methodName)
{ return (methodName.CompareNoCase(kDeflateMethodName) == 0) ||
(methodName.CompareNoCase(kDeflate64MethodName) == 0); }
STDMETHODIMP CHandler::GetFileTimeType(UInt32 *type)
{
*type = NFileTimeType::kWindows;
@@ -136,60 +65,6 @@ HRESULT CHandler::SetPassword(CCompressionMethodMode &methodMode,
return S_OK;
}
struct CNameToPropID
{
PROPID PropID;
VARTYPE VarType;
const wchar_t *Name;
};
CNameToPropID g_NameToPropID[] =
{
{ NCoderPropID::kOrder, VT_UI4, L"O" },
{ NCoderPropID::kPosStateBits, VT_UI4, L"PB" },
{ NCoderPropID::kLitContextBits, VT_UI4, L"LC" },
{ NCoderPropID::kLitPosBits, VT_UI4, L"LP" },
{ NCoderPropID::kNumPasses, VT_UI4, L"Pass" },
{ NCoderPropID::kNumFastBytes, VT_UI4, L"fb" },
{ NCoderPropID::kMatchFinderCycles, VT_UI4, L"mc" },
{ NCoderPropID::kAlgorithm, VT_UI4, L"a" },
{ NCoderPropID::kMatchFinder, VT_BSTR, L"mf" },
{ NCoderPropID::kNumThreads, VT_UI4, L"mt" }
};
bool ConvertProperty(PROPVARIANT srcProp, VARTYPE varType,
NCOM::CPropVariant &destProp)
{
if (varType == srcProp.vt)
{
destProp = srcProp;
return true;
}
if (varType == VT_UI1)
{
if(srcProp.vt == VT_UI4)
{
UInt32 value = srcProp.ulVal;
if (value > 0xFF)
return false;
destProp = Byte(value);
return true;
}
}
return false;
}
const int kNumNameToPropIDItems = sizeof(g_NameToPropID) / sizeof(g_NameToPropID[0]);
int FindPropIdFromStringName(const UString &name)
{
for (int i = 0; i < kNumNameToPropIDItems; i++)
if (name.CompareNoCase(g_NameToPropID[i].Name) == 0)
return i;
return -1;
}
HRESULT CHandler::SetCompressionMethod(
CCompressionMethodMode &methodMode,
CCompressionMethodMode &headerMethod)
@@ -210,28 +85,28 @@ HRESULT CHandler::SetCompressionMethod(
COneMethodInfo oneMethodInfo;
oneMethodInfo.MethodName = kLZMAMethodName;
{
CProperty property;
property.PropID = NCoderPropID::kMatchFinder;
CProp property;
property.Id = NCoderPropID::kMatchFinder;
property.Value = kLzmaMatchFinderForHeaders;
oneMethodInfo.CoderProperties.Add(property);
oneMethodInfo.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kAlgorithm;
CProp property;
property.Id = NCoderPropID::kAlgorithm;
property.Value = kAlgorithmForHeaders;
oneMethodInfo.CoderProperties.Add(property);
oneMethodInfo.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kNumFastBytes;
CProp property;
property.Id = NCoderPropID::kNumFastBytes;
property.Value = UInt32(kNumFastBytesForHeaders);
oneMethodInfo.CoderProperties.Add(property);
oneMethodInfo.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kDictionarySize;
CProp property;
property.Id = NCoderPropID::kDictionarySize;
property.Value = UInt32(kDictionaryForHeaders);
oneMethodInfo.CoderProperties.Add(property);
oneMethodInfo.Properties.Add(property);
}
headerMethodInfoVector.Add(oneMethodInfo);
HRESULT res = SetCompressionMethod(headerMethod, headerMethodInfoVector
@@ -244,21 +119,6 @@ HRESULT CHandler::SetCompressionMethod(
return S_OK;
}
static void SetOneMethodProp(COneMethodInfo &oneMethodInfo, PROPID propID,
const NWindows::NCOM::CPropVariant &value)
{
int j;
for (j = 0; j < oneMethodInfo.CoderProperties.Size(); j++)
if (oneMethodInfo.CoderProperties[j].PropID == propID)
break;
if (j != oneMethodInfo.CoderProperties.Size())
return;
CProperty property;
property.PropID = propID;
property.Value = value;
oneMethodInfo.CoderProperties.Add(property);
}
HRESULT CHandler::SetCompressionMethod(
CCompressionMethodMode &methodMode,
CObjectVector<COneMethodInfo> &methodsInfo
@@ -280,113 +140,31 @@ HRESULT CHandler::SetCompressionMethod(
for(int i = 0; i < methodsInfo.Size(); i++)
{
COneMethodInfo &oneMethodInfo = methodsInfo[i];
if (oneMethodInfo.MethodName.IsEmpty())
oneMethodInfo.MethodName = kDefaultMethodName;
SetCompressionMethod2(oneMethodInfo
#ifdef COMPRESS_MT
, numThreads
#endif
);
if (!IsCopyMethod(oneMethodInfo.MethodName))
needSolid = true;
if (IsLZMAMethod(oneMethodInfo.MethodName))
{
UInt32 dicSize =
(level >= 9 ? kLzmaDicSizeX9 :
(level >= 7 ? kLzmaDicSizeX7 :
(level >= 5 ? kLzmaDicSizeX5 :
(level >= 3 ? kLzmaDicSizeX3 :
kLzmaDicSizeX1))));
UInt32 algorithm =
(level >= 5 ? kLzmaAlgorithmX5 :
kLzmaAlgorithmX1);
UInt32 fastBytes =
(level >= 7 ? kLzmaFastBytesX7 :
kLzmaFastBytesX1);
const wchar_t *matchFinder =
(level >= 5 ? kLzmaMatchFinderX5 :
kLzmaMatchFinderX1);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kDictionarySize, dicSize);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kAlgorithm, algorithm);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumFastBytes, fastBytes);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kMatchFinder, matchFinder);
#ifdef COMPRESS_MT
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumThreads, numThreads);
#endif
}
else if (IsDeflateMethod(oneMethodInfo.MethodName))
{
UInt32 fastBytes =
(level >= 9 ? kDeflateFastBytesX9 :
(level >= 7 ? kDeflateFastBytesX7 :
kDeflateFastBytesX1));
UInt32 numPasses =
(level >= 9 ? kDeflatePassesX9 :
(level >= 7 ? kDeflatePassesX7 :
kDeflatePassesX1));
UInt32 algo =
(level >= 5 ? kDeflateAlgoX5 :
kDeflateAlgoX1);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kAlgorithm, algo);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumFastBytes, fastBytes);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumPasses, numPasses);
}
else if (IsBZip2Method(oneMethodInfo.MethodName))
{
UInt32 numPasses =
(level >= 9 ? kBZip2NumPassesX9 :
(level >= 7 ? kBZip2NumPassesX7 :
kBZip2NumPassesX1));
UInt32 dicSize =
(level >= 5 ? kBZip2DicSizeX5 :
(level >= 3 ? kBZip2DicSizeX3 :
kBZip2DicSizeX1));
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumPasses, numPasses);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kDictionarySize, dicSize);
#ifdef COMPRESS_MT
SetOneMethodProp(oneMethodInfo, NCoderPropID::kNumThreads, numThreads);
#endif
}
else if (IsPpmdMethod(oneMethodInfo.MethodName))
{
UInt32 useMemSize =
(level >= 9 ? kPpmdMemSizeX9 :
(level >= 7 ? kPpmdMemSizeX7 :
(level >= 5 ? kPpmdMemSizeX5 :
kPpmdMemSizeX1)));
UInt32 order =
(level >= 9 ? kPpmdOrderX9 :
(level >= 7 ? kPpmdOrderX7 :
(level >= 5 ? kPpmdOrderX5 :
kPpmdOrderX1)));
SetOneMethodProp(oneMethodInfo, NCoderPropID::kUsedMemorySize, useMemSize);
SetOneMethodProp(oneMethodInfo, NCoderPropID::kOrder, order);
}
CMethodFull methodFull;
if (!FindMethod(
EXTERNAL_CODECS_VARS
oneMethodInfo.MethodName, methodFull.MethodID, methodFull.NumInStreams, methodFull.NumOutStreams))
oneMethodInfo.MethodName, methodFull.Id, methodFull.NumInStreams, methodFull.NumOutStreams))
return E_INVALIDARG;
methodFull.CoderProperties = oneMethodInfo.CoderProperties;
methodFull.Properties = oneMethodInfo.Properties;
methodMode.Methods.Add(methodFull);
if (!_numSolidBytesDefined)
{
for (int j = 0; j < methodFull.CoderProperties.Size(); j++)
for (int j = 0; j < methodFull.Properties.Size(); j++)
{
const CProperty &prop = methodFull.CoderProperties[j];
if ((prop.PropID == NCoderPropID::kDictionarySize ||
prop.PropID == NCoderPropID::kUsedMemorySize) && prop.Value.vt == VT_UI4)
const CProp &prop = methodFull.Properties[j];
if ((prop.Id == NCoderPropID::kDictionarySize ||
prop.Id == NCoderPropID::kUsedMemorySize) && prop.Value.vt == VT_UI4)
{
_numSolidBytes = ((UInt64)prop.Value.ulVal) << 7;
const UInt64 kMinSize = (1 << 24);
@@ -652,198 +430,11 @@ static HRESULT GetBindInfo(UString &srcString, CBind &bind)
return S_OK;
}
static void SplitParams(const UString &srcString, UStringVector &subStrings)
{
subStrings.Clear();
UString name;
int len = srcString.Length();
if (len == 0)
return;
for (int i = 0; i < len; i++)
{
wchar_t c = srcString[i];
if (c == L':')
{
subStrings.Add(name);
name.Empty();
}
else
name += c;
}
subStrings.Add(name);
}
static void SplitParam(const UString &param, UString &name, UString &value)
{
int eqPos = param.Find(L'=');
if (eqPos >= 0)
{
name = param.Left(eqPos);
value = param.Mid(eqPos + 1);
return;
}
for(int i = 0; i < param.Length(); i++)
{
wchar_t c = param[i];
if (c >= L'0' && c <= L'9')
{
name = param.Left(i);
value = param.Mid(i);
return;
}
}
name = param;
}
HRESULT CHandler::SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value)
{
CProperty property;
if (name.CompareNoCase(L"D") == 0 || name.CompareNoCase(L"MEM") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(value, dicSize));
if (name.CompareNoCase(L"D") == 0)
property.PropID = NCoderPropID::kDictionarySize;
else
property.PropID = NCoderPropID::kUsedMemorySize;
property.Value = dicSize;
oneMethodInfo.CoderProperties.Add(property);
}
else
{
int index = FindPropIdFromStringName(name);
if (index < 0)
return E_INVALIDARG;
const CNameToPropID &nameToPropID = g_NameToPropID[index];
property.PropID = nameToPropID.PropID;
NCOM::CPropVariant propValue;
if (nameToPropID.VarType == VT_BSTR)
propValue = value;
else
{
UInt32 number;
if (ParseStringToUInt32(value, number) == value.Length())
propValue = number;
else
propValue = value;
}
if (!ConvertProperty(propValue, nameToPropID.VarType, property.Value))
return E_INVALIDARG;
oneMethodInfo.CoderProperties.Add(property);
}
return S_OK;
}
HRESULT CHandler::SetParams(COneMethodInfo &oneMethodInfo, const UString &srcString)
{
UStringVector params;
SplitParams(srcString, params);
if (params.Size() > 0)
oneMethodInfo.MethodName = params[0];
for (int i = 1; i < params.Size(); i++)
{
const UString &param = params[i];
UString name, value;
SplitParam(param, name, value);
RINOK(SetParam(oneMethodInfo, name, value));
}
return S_OK;
}
HRESULT CHandler::SetSolidSettings(const UString &s)
{
UString s2 = s;
s2.MakeUpper();
if (s2.IsEmpty() || s2.Compare(L"ON") == 0)
{
InitSolid();
return S_OK;
}
if (s2.Compare(L"OFF") == 0)
{
_numSolidFiles = 1;
return S_OK;
}
for (int i = 0; i < s2.Length();)
{
const wchar_t *start = ((const wchar_t *)s2) + i;
const wchar_t *end;
UInt64 v = ConvertStringToUInt64(start, &end);
if (start == end)
{
if (s2[i++] != 'E')
return E_INVALIDARG;
_solidExtension = true;
continue;
}
i += (int)(end - start);
if (i == s2.Length())
return E_INVALIDARG;
wchar_t c = s2[i++];
switch(c)
{
case 'F':
if (v < 1)
v = 1;
_numSolidFiles = v;
break;
case 'B':
_numSolidBytes = v;
_numSolidBytesDefined = true;
break;
case 'K':
_numSolidBytes = (v << 10);
_numSolidBytesDefined = true;
break;
case 'M':
_numSolidBytes = (v << 20);
_numSolidBytesDefined = true;
break;
case 'G':
_numSolidBytes = (v << 30);
_numSolidBytesDefined = true;
break;
default:
return E_INVALIDARG;
}
}
return S_OK;
}
HRESULT CHandler::SetSolidSettings(const PROPVARIANT &value)
{
switch(value.vt)
{
case VT_EMPTY:
InitSolid();
return S_OK;
case VT_BSTR:
return SetSolidSettings(value.bstrVal);
default:
return E_INVALIDARG;
}
}
STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties)
{
COM_TRY_BEGIN
_methods.Clear();
_binds.Clear();
Init();
#ifdef COMPRESS_MT
const UInt32 numProcessors = NSystem::GetNumberOfProcessors();
#endif
UInt32 mainDicSize = 0xFFFFFFFF;
UInt32 mainDicMethodIndex = 0xFFFFFFFF;
UInt32 minNumber = 0;
BeforeSetProperty();
for (int i = 0; i < numProperties; i++)
{
@@ -854,14 +445,6 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
const PROPVARIANT &value = values[i];
if (name[0] == 'X')
{
name.Delete(0);
_level = 9;
RINOK(ParsePropValue(name, value, _level));
continue;
}
if (name[0] == 'B')
{
name.Delete(0);
@@ -871,142 +454,7 @@ STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *v
continue;
}
if (name[0] == L'S')
{
name.Delete(0);
if (name.IsEmpty())
{
RINOK(SetSolidSettings(value));
}
else
{
RINOK(SetSolidSettings(name));
}
continue;
}
UInt32 number;
int index = ParseStringToUInt32(name, number);
UString realName = name.Mid(index);
if (index == 0)
{
if(name.Left(2).CompareNoCase(L"MT") == 0)
{
#ifdef COMPRESS_MT
RINOK(ParseMtProp(name.Mid(2), value, numProcessors, _numThreads));
#endif
continue;
}
else if (name.CompareNoCase(L"RSFX") == 0)
{
RINOK(SetBoolProperty(_removeSfxBlock, value));
continue;
}
else if (name.CompareNoCase(L"F") == 0)
{
RINOK(SetBoolProperty(_autoFilter, value));
continue;
}
else if (name.CompareNoCase(L"HC") == 0)
{
RINOK(SetBoolProperty(_compressHeaders, value));
continue;
}
else if (name.CompareNoCase(L"HCF") == 0)
{
bool compressHeadersFull = true;
RINOK(SetBoolProperty(compressHeadersFull, value));
if (!compressHeadersFull)
return E_INVALIDARG;
continue;
}
else if (name.CompareNoCase(L"HE") == 0)
{
RINOK(SetBoolProperty(_encryptHeaders, value));
continue;
}
else if (name.CompareNoCase(L"TM") == 0)
{
RINOK(SetBoolProperty(WriteModified, value));
continue;
}
else if (name.CompareNoCase(L"TC") == 0)
{
RINOK(SetBoolProperty(WriteCreated, value));
continue;
}
else if (name.CompareNoCase(L"TA") == 0)
{
RINOK(SetBoolProperty(WriteAccessed, value));
continue;
}
else if (name.CompareNoCase(L"V") == 0)
{
RINOK(SetBoolProperty(_volumeMode, value));
continue;
}
number = 0;
}
if (number > 10000)
return E_FAIL;
if (number < minNumber)
return E_INVALIDARG;
number -= minNumber;
for(int j = _methods.Size(); j <= (int)number; j++)
{
COneMethodInfo oneMethodInfo;
_methods.Add(oneMethodInfo);
}
COneMethodInfo &oneMethodInfo = _methods[number];
if (realName.Length() == 0)
{
if (value.vt != VT_BSTR)
return E_INVALIDARG;
// oneMethodInfo.MethodName = UnicodeStringToMultiByte(UString(value.bstrVal));
RINOK(SetParams(oneMethodInfo, value.bstrVal));
}
else
{
CProperty property;
if (realName.Left(1).CompareNoCase(L"D") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(1), value, dicSize));
property.PropID = NCoderPropID::kDictionarySize;
property.Value = dicSize;
oneMethodInfo.CoderProperties.Add(property);
if (number <= mainDicMethodIndex)
mainDicSize = dicSize;
}
else if (realName.Left(3).CompareNoCase(L"MEM") == 0)
{
UInt32 dicSize;
RINOK(ParsePropDictionaryValue(realName.Mid(3), value, dicSize));
property.PropID = NCoderPropID::kUsedMemorySize;
property.Value = dicSize;
oneMethodInfo.CoderProperties.Add(property);
if (number <= mainDicMethodIndex)
mainDicSize = dicSize;
}
else
{
int index = FindPropIdFromStringName(realName);
if (index < 0)
return E_INVALIDARG;
const CNameToPropID &nameToPropID = g_NameToPropID[index];
property.PropID = nameToPropID.PropID;
if (!ConvertProperty(value, nameToPropID.VarType, property.Value))
return E_INVALIDARG;
oneMethodInfo.CoderProperties.Add(property);
}
}
RINOK(SetProperty(name, value));
}
return S_OK;

View File

@@ -7,12 +7,20 @@ namespace NArchive {
namespace N7z {
Byte kSignature[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C};
#ifdef _7Z_VOL
Byte kFinishSignature[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C + 1};
#endif
class SignatureInitializer
{
public:
SignatureInitializer() { kSignature[0]--; kFinishSignature[0]--;};
SignatureInitializer()
{
kSignature[0]--;
#ifdef _7Z_VOL
kFinishSignature[0]--;
#endif
};
} g_SignatureInitializer;
}}

View File

@@ -12,7 +12,9 @@ extern "C"
}
// define FORMAT_7Z_RECOVERY if you want to recover multivolume archives with empty StartHeader
// #define FORMAT_7Z_RECOVERY
#ifndef _SFX
#define FORMAT_7Z_RECOVERY
#endif
namespace NArchive {
namespace N7z {
@@ -1268,13 +1270,13 @@ HRESULT CInArchive::ReadDatabase(
return S_FALSE;
nextHeaderSize = realProcessedSize - i;
nextHeaderOffset = cur2 - cur + i;
nextHeaderCRC = CCRC::CalculateDigest(buf + i, (size_t)nextHeaderSize);
nextHeaderCRC = CrcCalc(buf + i, (size_t)nextHeaderSize);
RINOK(_stream->Seek(cur, STREAM_SEEK_SET, &_position));
}
#endif
#ifdef FORMAT_7Z_RECOVERY
crcFromArchive = crc.GetDigest();
crcFromArchive = CRC_GET_DIGEST(crc);
#endif
#ifdef _7Z_VOL

View File

@@ -4,7 +4,7 @@
#define __7Z_ITEM_H
#include "../../../Common/Buffer.h"
#include "../../../Common/String.h"
#include "../../../Common/MyString.h"
#include "../../Common/MethodId.h"
#include "7zHeader.h"

View File

@@ -151,7 +151,7 @@ HRESULT COutArchive::Create(ISequentialOutStream *stream, bool endMarker)
{
if (!Stream)
return E_FAIL;
WriteSignature();
RINOK(WriteSignature());
RINOK(Stream->Seek(0, STREAM_SEEK_CUR, &_prefixHeaderPos));
}
return S_OK;

View File

@@ -357,7 +357,7 @@ static const UInt64 k_BCJ2 = 0x0303011B;
static bool GetMethodFull(UInt64 methodID,
UInt32 numInStreams, CMethodFull &methodResult)
{
methodResult.MethodID = methodID;
methodResult.Id = methodID;
methodResult.NumInStreams = numInStreams;
methodResult.NumOutStreams = 1;
return true;
@@ -376,28 +376,28 @@ static bool MakeExeMethod(const CCompressionMethodMode &method,
if (!GetMethodFull(k_LZMA, 1, methodFull))
return false;
{
CProperty property;
property.PropID = NCoderPropID::kAlgorithm;
CProp property;
property.Id = NCoderPropID::kAlgorithm;
property.Value = kAlgorithmForBCJ2_LZMA;
methodFull.CoderProperties.Add(property);
methodFull.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kMatchFinder;
CProp property;
property.Id = NCoderPropID::kMatchFinder;
property.Value = kMatchFinderForBCJ2_LZMA;
methodFull.CoderProperties.Add(property);
methodFull.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kDictionarySize;
CProp property;
property.Id = NCoderPropID::kDictionarySize;
property.Value = kDictionaryForBCJ2_LZMA;
methodFull.CoderProperties.Add(property);
methodFull.Properties.Add(property);
}
{
CProperty property;
property.PropID = NCoderPropID::kNumFastBytes;
CProp property;
property.Id = NCoderPropID::kNumFastBytes;
property.Value = kNumFastBytesForBCJ2_LZMA;
methodFull.CoderProperties.Add(property);
methodFull.Properties.Add(property);
}
exeMethod.Methods.Add(methodFull);

View File

@@ -31,10 +31,10 @@ COMMON_OBJS = \
$O\CRC.obj \
$O\IntToString.obj \
$O\NewHandler.obj \
$O\String.obj \
$O\MyString.obj \
$O\StringConvert.obj \
$O\StringToInt.obj \
$O\Vector.obj \
$O\MyVector.obj \
WIN_OBJS = \
$O\DLL.obj \
@@ -42,7 +42,8 @@ WIN_OBJS = \
$O\FileFind.obj \
$O\FileIO.obj \
$O\PropVariant.obj \
$O\Synchronization.obj
$O\Synchronization.obj \
$O\System.obj \
7ZIP_COMMON_OBJS = \
$O\CreateCoder.obj \
@@ -51,16 +52,19 @@ WIN_OBJS = \
$O\LimitedStreams.obj \
$O\LockedStream.obj \
$O\MethodId.obj \
$O\MethodProps.obj \
$O\OutBuffer.obj \
$O\ProgressUtils.obj \
$O\StreamBinder.obj \
$O\StreamObjects.obj \
$O\StreamUtils.obj \
$O\VirtThread.obj \
AR_COMMON_OBJS = \
$O\CoderMixer2.obj \
$O\CoderMixer2MT.obj \
$O\CrossThreadProgress.obj \
$O\HandlerOut.obj \
$O\InStreamWithCRC.obj \
$O\ItemNameUtils.obj \
$O\MultiStream.obj \
@@ -69,6 +73,7 @@ AR_COMMON_OBJS = \
C_OBJS = \
$O\Alloc.obj \
$O\Threads.obj \
!include "../../Crc2.mak"