This commit is contained in:
Igor Pavlov
2015-10-05 00:00:00 +00:00
committed by Kornel Lesiński
parent f6444c3256
commit 6543c28020
113 changed files with 3101 additions and 382 deletions

View File

@@ -1,5 +1,5 @@
/* 7zArcIn.c -- 7z Input functions
2015-05-16 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */
#include "Precomp.h"

View File

@@ -1,9 +1,9 @@
#define MY_VER_MAJOR 15
#define MY_VER_MINOR 07
#define MY_VER_BUILD 00
#define MY_VERSION_NUMBERS "15.07"
#define MY_VERSION "15.07 beta"
#define MY_DATE "2015-09-17"
#define MY_VER_MINOR 8
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "15.08"
#define MY_VERSION "15.08 beta"
#define MY_DATE "2015-10-01"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"

View File

@@ -1,5 +1,5 @@
/* MtCoder.c -- Multi-thread Coder
2010-09-24 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */
#include "Precomp.h"

View File

@@ -1,5 +1,5 @@
/* Ppmd7.c -- PPMdH codec
2010-03-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
#include "Precomp.h"

View File

@@ -1,5 +1,5 @@
/* Ppmd7Enc.c -- PPMdH Encoder
2010-03-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
#include "Precomp.h"

View File

@@ -1,5 +1,5 @@
/* Ppmd8.c -- PPMdI codec
2013-11-12 : Igor Pavlov : Public domain
2015-09-28 : Igor Pavlov : Public domain
This code is based on PPMd var.I (2002): Dmitry Shkarin : Public domain */
#include "Precomp.h"

View File

@@ -1,5 +1,5 @@
/* 7zipInstall.c - 7-Zip Installer
2015-08-04 : Igor Pavlov : Public domain */
2015-09-28 : Igor Pavlov : Public domain */
#include "Precomp.h"

View File

@@ -1338,7 +1338,7 @@ HRESULT CInArchive::ReadHeader(
db.UnsupportedFeatureWarning = true;
_inByteBack->SkipRem();
}
// SkipData worked incorrectly in some versions before v4.59 (7zVer <= 00.02)
// SkipData worked incorrectly in some versions before v4.59 (7zVer <= 0.02)
if (_inByteBack->GetRem() != 0)
ThrowIncorrect();
}

View File

@@ -14,7 +14,7 @@ namespace N7z {
struct CPropMap
{
UInt32 FilePropID;
STATPROPSTG StatPROPSTG;
CStatProp StatProp;
};
static const CPropMap kPropMap[] =
@@ -24,11 +24,11 @@ static const CPropMap kPropMap[] =
{ NID::kPackInfo, { NULL, kpidPackSize, VT_UI8 } },
#ifdef _MULTI_PACK
{ 100, { L"Pack0", kpidPackedSize0, VT_UI8 } },
{ 101, { L"Pack1", kpidPackedSize1, VT_UI8 } },
{ 102, { L"Pack2", kpidPackedSize2, VT_UI8 } },
{ 103, { L"Pack3", kpidPackedSize3, VT_UI8 } },
{ 104, { L"Pack4", kpidPackedSize4, VT_UI8 } },
{ 100, { "Pack0", kpidPackedSize0, VT_UI8 } },
{ 101, { "Pack1", kpidPackedSize1, VT_UI8 } },
{ 102, { "Pack2", kpidPackedSize2, VT_UI8 } },
{ 103, { "Pack3", kpidPackedSize3, VT_UI8 } },
{ 104, { "Pack4", kpidPackedSize4, VT_UI8 } },
#endif
{ NID::kCTime, { NULL, kpidCTime, VT_FILETIME } },
@@ -156,8 +156,8 @@ STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID,
const CPropMap &pr = kPropMap[i];
if (pr.FilePropID == id)
{
const STATPROPSTG &st = pr.StatPROPSTG;
*propID = st.propid;
const CStatProp &st = pr.StatProp;
*propID = st.PropID;
*varType = st.vt;
/*
if (st.lpwstrName)

View File

@@ -119,7 +119,7 @@ HRESULT COutVolumeStream::Flush()
/*
STDMETHODIMP COutMultiStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
{
if(processedSize != NULL)
if (processedSize)
*processedSize = 0;
while (size > 0)
{
@@ -157,7 +157,7 @@ STDMETHODIMP COutMultiStream::Write(const void *data, UInt32 size, UInt32 *proce
_absPos += realProcessed;
if (_absPos > _length)
_length = _absPos;
if(processedSize != NULL)
if (processedSize)
*processedSize += realProcessed;
if (subStream.Pos == subStream.Size)
{

View File

@@ -5,6 +5,7 @@
#include "../../../C/CpuArch.h"
#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/StringConvert.h"
#include "../../Common/StringToInt.h"
#include "../../Common/UTFConvert.h"
@@ -121,7 +122,7 @@ struct CItem
bool IsBin() const { return Type == k_Type_BinLe || Type == k_Type_BinBe; }
bool IsCrcFormat() const { return Type == k_Type_HexCrc; }
bool IsDir() const { return (Mode & 0170000) == 0040000; }
bool IsDir() const { return MY_LIN_S_ISDIR(Mode); }
bool IsTrailer() const { return strcmp(Name, kName_TRAILER) == 0; }
UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; }
};

View File

@@ -8,6 +8,7 @@
#include "../../../C/LzmaDec.h"
#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/StringConvert.h"
#include "../../Windows/PropVariantUtils.h"
@@ -98,7 +99,7 @@ struct CNode
#define Get32(p) (be ? GetBe32(p) : GetUi32(p))
static UInt32 GetMode(const Byte *p, bool be) { return be ? GetBe16(p) : GetUi16(p); }
static bool IsDir(const Byte *p, bool be) { return (GetMode(p, be) & 0xF000) == 0x4000; }
static bool IsDir(const Byte *p, bool be) { return MY_LIN_S_ISDIR(GetMode(p, be)); }
static UInt32 GetSize(const Byte *p, bool be)
{
@@ -660,10 +661,6 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
CMyComPtr<ICompressProgressInfo> progress = lps;
lps->Init(extractCallback, false);
CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
CMyComPtr<ISequentialInStream> inStream(streamSpec);
streamSpec->SetStream(_stream);
for (i = 0; i < numItems; i++)
{
lps->InSize = totalPackSize;
@@ -701,20 +698,16 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
int res = NExtract::NOperationResult::kDataError;
{
CMyComPtr<ISequentialInStream> inSeqStream;
CMyComPtr<IInStream> inStream;
HRESULT hres = GetStream(index, &inSeqStream);
if (inSeqStream)
inSeqStream.QueryInterface(IID_IInStream, &inStream);
if (hres == E_OUTOFMEMORY)
return E_OUTOFMEMORY;
if (hres == S_FALSE || !inStream)
if (hres == S_FALSE || !inSeqStream)
res = NExtract::NOperationResult::kUnsupportedMethod;
else
{
RINOK(hres);
if (inStream)
{
HRESULT hres = copyCoder->Code(inStream, outStream, NULL, NULL, progress);
HRESULT hres = copyCoder->Code(inSeqStream, outStream, NULL, NULL, progress);
if (hres == S_OK)
{
if (copyCoderSpec->TotalSize == curSize)
@@ -729,6 +722,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
}
RINOK(extractCallback->SetOperationResult(res));
}
return S_OK;
COM_TRY_END
}

View File

@@ -632,7 +632,7 @@ enum
kpidInfoSection
};
static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR },
{ NULL, kpidSize, VT_UI8 },
@@ -641,8 +641,8 @@ static const STATPROPSTG kProps[] =
{ NULL, kpidVa, VT_UI8 },
{ NULL, kpidType, VT_BSTR },
{ NULL, kpidCharacts, VT_BSTR }
, { (LPOLESTR)L"Link Section", kpidLinkSection, VT_BSTR}
, { (LPOLESTR)L"Info Section", kpidInfoSection, VT_BSTR}
, { "Link Section", kpidLinkSection, VT_BSTR}
, { "Info Section", kpidInfoSection, VT_BSTR}
};
IMP_IInArchive_Props_WITH_NAME

View File

File diff suppressed because it is too large Load Diff

View File

@@ -805,7 +805,7 @@ enum
// kpidFileSysType
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
{ NULL, kpidFileSystem, VT_BSTR},
{ NULL, kpidClusterSize, VT_UI4},
@@ -814,12 +814,12 @@ static const STATPROPSTG kArcProps[] =
{ NULL, kpidMTime, VT_FILETIME},
{ NULL, kpidVolumeName, VT_BSTR},
{ (LPOLESTR)L"FATs", kpidNumFats, VT_UI4},
{ "FATs", kpidNumFats, VT_UI4},
{ NULL, kpidSectorSize, VT_UI4},
{ NULL, kpidId, VT_UI4},
// { (LPOLESTR)L"OEM Name", kpidOemName, VT_BSTR},
// { (LPOLESTR)L"Volume Name", kpidVolName, VT_BSTR},
// { (LPOLESTR)L"File System Type", kpidFileSysType, VT_BSTR}
// { "OEM Name", kpidOemName, VT_BSTR},
// { "Volume Name", kpidVolName, VT_BSTR},
// { "File System Type", kpidFileSysType, VT_BSTR}
// { NULL, kpidSectorsPerTrack, VT_UI4},
// { NULL, kpidNumHeads, VT_UI4},
// { NULL, kpidHiddenSectors, VT_UI4}

View File

@@ -227,4 +227,30 @@ STDMETHODIMP CHandlerImg::Extract(const UInt32 *indices, UInt32 numItems,
COM_TRY_END
}
HRESULT ReadZeroTail(ISequentialInStream *stream, bool &areThereNonZeros, UInt64 &numZeros, UInt64 maxSize)
{
areThereNonZeros = false;
numZeros = 0;
const size_t kBufSize = 1 << 11;
Byte buf[kBufSize];
for (;;)
{
UInt32 size = 0;
HRESULT(stream->Read(buf, kBufSize, &size));
if (size == 0)
return S_OK;
for (UInt32 i = 0; i < size; i++)
if (buf[i] != 0)
{
areThereNonZeros = true;
numZeros += i;
return S_OK;
}
numZeros += size;
if (numZeros > maxSize)
return S_OK;
}
}
}

View File

@@ -85,6 +85,9 @@ public:
STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
};
HRESULT ReadZeroTail(ISequentialInStream *stream, bool &areThereNonZeros, UInt64 &numZeros, UInt64 maxSize);
}
#endif

View File

@@ -293,12 +293,14 @@ namespace NPropDataType
const UInt32 kMask_ZeroEnd = 1 << 4;
// const UInt32 kMask_BigEndian = 1 << 5;
const UInt32 kMask_Utf = 1 << 6;
// const UInt32 kMask_Utf8 = kMask_Utf | 0;
const UInt32 kMask_Utf8 = kMask_Utf | 0;
const UInt32 kMask_Utf16 = kMask_Utf | 1;
// const UInt32 kMask_Utf32 = kMask_Utf | 2;
const UInt32 kNotDefined = 0;
const UInt32 kRaw = 1;
const UInt32 kUtf8z = kMask_Utf8 | kMask_ZeroEnd;
const UInt32 kUtf16z = kMask_Utf16 | kMask_ZeroEnd;
};
@@ -512,12 +514,26 @@ ARCHIVE_INTERFACE(IArchiveAllowTail, 0x05)
{ if (index >= ARRAY_SIZE(k)) return E_INVALIDARG; \
*propID = k[index]; *varType = k7z_PROPID_To_VARTYPE[(unsigned)*propID]; *name = 0; return S_OK; } \
struct CStatProp
{
const char *Name;
UInt32 PropID;
VARTYPE vt;
};
namespace NWindows {
namespace NCOM {
// PropVariant.cpp
BSTR AllocBstrFromAscii(const char *s) throw();
}}
#define IMP_IInArchive_GetProp_WITH_NAME(k) \
(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \
{ if (index >= ARRAY_SIZE(k)) return E_INVALIDARG; \
const STATPROPSTG &srcItem = k[index]; \
*propID = srcItem.propid; *varType = srcItem.vt; \
if (srcItem.lpwstrName == 0) *name = 0; else *name = ::SysAllocString(srcItem.lpwstrName); return S_OK; } \
const CStatProp &prop = k[index]; \
*propID = (PROPID)prop.PropID; *varType = prop.vt; \
*name = NWindows::NCOM::AllocBstrFromAscii(prop.Name); return S_OK; } \
#define IMP_IInArchive_Props \
STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProps) \

View File

@@ -8,6 +8,8 @@
#include "../../Common/StreamUtils.h"
#include "../HandlerCont.h"
#include "IsoIn.h"
namespace NArchive {
@@ -614,6 +616,22 @@ HRESULT CInArchive::Open2()
UpdatePhySize(be.LoadRBA, GetBootItemSize(i));
}
}
if (PhySize < _fileSize)
{
UInt64 rem = _fileSize - PhySize;
const UInt64 kRemMax = 1 << 21;
if (rem <= kRemMax)
{
RINOK(_stream->Seek(PhySize, STREAM_SEEK_SET, NULL));
bool areThereNonZeros = false;
UInt64 numZeros = 0;
RINOK(ReadZeroTail(_stream, areThereNonZeros, numZeros, kRemMax));
if (!areThereNonZeros)
PhySize += numZeros;
}
}
return S_OK;
}

View File

@@ -332,15 +332,15 @@ enum
kpidEndChs
};
static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR},
{ NULL, kpidSize, VT_UI8},
{ NULL, kpidFileSystem, VT_BSTR},
{ NULL, kpidOffset, VT_UI8},
{ (LPOLESTR)L"Primary", kpidPrimary, VT_BOOL},
{ (LPOLESTR)L"Begin CHS", kpidBegChs, VT_BSTR},
{ (LPOLESTR)L"End CHS", kpidEndChs, VT_BSTR}
{ "Primary", kpidPrimary, VT_BOOL},
{ "Begin CHS", kpidBegChs, VT_BSTR},
{ "End CHS", kpidEndChs, VT_BSTR}
};
IMP_IInArchive_Props_WITH_NAME

View File

@@ -2173,7 +2173,7 @@ enum
kpidATime2
};
static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR},
{ NULL, kpidSize, VT_UI8},
@@ -2181,20 +2181,20 @@ static const STATPROPSTG kProps[] =
// { NULL, kpidLink, VT_BSTR},
// { (LPOLESTR)L"Link 2", kpidLink2, VT_BSTR},
// { (LPOLESTR)L"Link Type", kpidLinkType, VT_UI2},
// { "Link 2", kpidLink2, VT_BSTR},
// { "Link Type", kpidLinkType, VT_UI2},
{ NULL, kpidINode, VT_UI8},
{ NULL, kpidMTime, VT_FILETIME},
{ NULL, kpidCTime, VT_FILETIME},
{ NULL, kpidATime, VT_FILETIME},
// { (LPOLESTR)L"Record Modified", kpidRecMTime, VT_FILETIME},
// { "Record Modified", kpidRecMTime, VT_FILETIME},
// { (LPOLESTR)L"Modified 2", kpidMTime2, VT_FILETIME},
// { (LPOLESTR)L"Created 2", kpidCTime2, VT_FILETIME},
// { (LPOLESTR)L"Accessed 2", kpidATime2, VT_FILETIME},
// { (LPOLESTR)L"Record Modified 2", kpidRecMTime2, VT_FILETIME},
// { "Modified 2", kpidMTime2, VT_FILETIME},
// { "Created 2", kpidCTime2, VT_FILETIME},
// { "Accessed 2", kpidATime2, VT_FILETIME},
// { "Record Modified 2", kpidRecMTime2, VT_FILETIME},
{ NULL, kpidAttrib, VT_UI4},
{ NULL, kpidNumBlocks, VT_UI4},
@@ -2226,13 +2226,13 @@ enum
kpidRecordSize = kpidUserDefined
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
{ NULL, kpidVolumeName, VT_BSTR},
{ NULL, kpidFileSystem, VT_BSTR},
{ NULL, kpidClusterSize, VT_UI4},
{ NULL, kpidSectorSize, VT_UI4},
{ (LPOLESTR)L"Record Size", kpidRecordSize, VT_UI4},
{ "Record Size", kpidRecordSize, VT_UI4},
{ NULL, kpidHeadersSize, VT_UI8},
{ NULL, kpidCTime, VT_FILETIME},
{ NULL, kpidId, VT_UI8},

View File

@@ -765,7 +765,7 @@ enum
// kpidBaseOfData32,
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
// { NULL, kpidWarning, VT_BSTR},
{ NULL, kpidCpu, VT_BSTR},
@@ -776,28 +776,28 @@ static const STATPROPSTG kArcProps[] =
{ NULL, kpidChecksum, VT_UI4},
{ NULL, kpidName, VT_BSTR},
{ (LPOLESTR)L"Image Size", kpidImageSize, VT_UI4},
{ (LPOLESTR)L"Section Alignment", kpidSectAlign, VT_UI4},
{ (LPOLESTR)L"File Alignment", kpidFileAlign, VT_UI4},
{ (LPOLESTR)L"Code Size", kpidCodeSize, VT_UI4},
{ (LPOLESTR)L"Initialized Data Size", kpidInitDataSize, VT_UI4},
{ (LPOLESTR)L"Uninitialized Data Size", kpidUnInitDataSize, VT_UI4},
{ (LPOLESTR)L"Linker Version", kpidLinkerVer, VT_BSTR},
{ (LPOLESTR)L"OS Version", kpidOsVer, VT_BSTR},
{ (LPOLESTR)L"Image Version", kpidImageVer, VT_BSTR},
{ (LPOLESTR)L"Subsystem Version", kpidSubsysVer, VT_BSTR},
{ (LPOLESTR)L"Subsystem", kpidSubSystem, VT_BSTR},
{ (LPOLESTR)L"DLL Characteristics", kpidDllCharacts, VT_BSTR},
{ (LPOLESTR)L"Stack Reserve", kpidStackReserve, VT_UI8},
{ (LPOLESTR)L"Stack Commit", kpidStackCommit, VT_UI8},
{ (LPOLESTR)L"Heap Reserve", kpidHeapReserve, VT_UI8},
{ (LPOLESTR)L"Heap Commit", kpidHeapCommit, VT_UI8},
{ (LPOLESTR)L"Image Base", kpidImageBase, VT_UI8},
{ "Image Size", kpidImageSize, VT_UI4},
{ "Section Alignment", kpidSectAlign, VT_UI4},
{ "File Alignment", kpidFileAlign, VT_UI4},
{ "Code Size", kpidCodeSize, VT_UI4},
{ "Initialized Data Size", kpidInitDataSize, VT_UI4},
{ "Uninitialized Data Size", kpidUnInitDataSize, VT_UI4},
{ "Linker Version", kpidLinkerVer, VT_BSTR},
{ "OS Version", kpidOsVer, VT_BSTR},
{ "Image Version", kpidImageVer, VT_BSTR},
{ "Subsystem Version", kpidSubsysVer, VT_BSTR},
{ "Subsystem", kpidSubSystem, VT_BSTR},
{ "DLL Characteristics", kpidDllCharacts, VT_BSTR},
{ "Stack Reserve", kpidStackReserve, VT_UI8},
{ "Stack Commit", kpidStackCommit, VT_UI8},
{ "Heap Reserve", kpidHeapReserve, VT_UI8},
{ "Heap Commit", kpidHeapCommit, VT_UI8},
{ "Image Base", kpidImageBase, VT_UI8},
{ NULL, kpidComment, VT_BSTR},
// { (LPOLESTR)L"Address Of Entry Point", kpidAddressOfEntryPoint, VT_UI8},
// { (LPOLESTR)L"Base Of Code", kpidBaseOfCode, VT_UI8},
// { (LPOLESTR)L"Base Of Data", kpidBaseOfData32, VT_UI8},
// { "Address Of Entry Point", kpidAddressOfEntryPoint, VT_UI8},
// { "Base Of Code", kpidBaseOfCode, VT_UI8},
// { "Base Of Data", kpidBaseOfData32, VT_UI8},
};
static const Byte kProps[] =
@@ -2798,12 +2798,12 @@ enum
// , kpidImageBase
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
// { NULL, kpidHeadersSize, VT_UI4 },
{ NULL, kpidCpu, VT_BSTR},
{ (LPOLESTR)L"Subsystem", kpidSubSystem, VT_BSTR },
// { (LPOLESTR)L"Image Base", kpidImageBase, VT_UI8 }
{ "Subsystem", kpidSubSystem, VT_BSTR },
// { "Image Base", kpidImageBase, VT_UI8 }
};
IMP_IInArchive_Props

View File

@@ -30,6 +30,8 @@
#include "../Common/FindSignature.h"
#include "../Common/ItemNameUtils.h"
#include "../HandlerCont.h"
#include "RarVol.h"
#include "Rar5Handler.h"
@@ -38,13 +40,6 @@ using namespace NWindows;
#define Get32(p) GetUi32(p)
namespace NArchive {
namespace NRar {
HRESULT ReadZeroTail(ISequentialInStream *stream, bool &areThereNonZeros, UInt64 &numZeros, UInt64 maxSize);
}
namespace NRar5 {
static const unsigned kMarkerSize = 8;
@@ -1938,7 +1933,7 @@ HRESULT CHandler::Open2(IInStream *stream,
bool areThereNonZeros;
UInt64 numZeros;
const UInt64 maxSize = 1 << 12;
RINOK(NRar::ReadZeroTail(inStream, areThereNonZeros, numZeros, maxSize));
RINOK(ReadZeroTail(inStream, areThereNonZeros, numZeros, maxSize));
if (!areThereNonZeros && numZeros != 0 && numZeros <= maxSize)
arcInfo.EndPos += numZeros;
}

View File

@@ -30,6 +30,8 @@
#include "../Common/ItemNameUtils.h"
#include "../Common/OutStreamWithCRC.h"
#include "../HandlerCont.h"
#include "RarVol.h"
#include "RarHandler.h"
@@ -998,31 +1000,6 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
}
HRESULT ReadZeroTail(ISequentialInStream *stream, bool &areThereNonZeros, UInt64 &numZeros, UInt64 maxSize)
{
areThereNonZeros = false;
numZeros = 0;
const size_t kBufSize = 1 << 9;
Byte buf[kBufSize];
for (;;)
{
UInt32 size = 0;
HRESULT(stream->Read(buf, kBufSize, &size));
if (size == 0)
return S_OK;
for (UInt32 i = 0; i < size; i++)
if (buf[i] != 0)
{
areThereNonZeros = true;
numZeros += i;
return S_OK;
}
numZeros += size;
if (numZeros > maxSize)
return S_OK;
}
}
HRESULT CHandler::Open2(IInStream *stream,
const UInt64 *maxCheckStartPosition,
IArchiveOpenCallback *openCallback)

View File

@@ -8,6 +8,7 @@
#include "../../../C/Xz.h"
#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/IntToString.h"
#include "../../Common/StringConvert.h"
@@ -76,14 +77,6 @@ static const char * const k_Methods[] =
static const UInt32 kMetadataBlockSizeLog = 13;
static const UInt32 kMetadataBlockSize = (1 << kMetadataBlockSizeLog);
#define MY_S_IFIFO 0x1000
#define MY_S_IFCHR 0x2000
#define MY_S_IFDIR 0x4000
#define MY_S_IFBLK 0x6000
#define MY_S_IFREG 0x8000
#define MY_S_IFLNK 0xA000
#define MY_S_IFSOCK 0xC000
enum
{
kType_IPC,
@@ -99,8 +92,8 @@ enum
static const UInt32 k_TypeToMode[] =
{
0,
MY_S_IFDIR, MY_S_IFREG, MY_S_IFLNK, MY_S_IFBLK, MY_S_IFCHR, MY_S_IFIFO, MY_S_IFSOCK,
MY_S_IFDIR, MY_S_IFREG, MY_S_IFLNK, MY_S_IFBLK, MY_S_IFCHR, MY_S_IFIFO, MY_S_IFSOCK
MY_LIN_S_IFDIR, MY_LIN_S_IFREG, MY_LIN_S_IFLNK, MY_LIN_S_IFBLK, MY_LIN_S_IFCHR, MY_LIN_S_IFIFO, MY_LIN_S_IFSOCK,
MY_LIN_S_IFDIR, MY_LIN_S_IFREG, MY_LIN_S_IFLNK, MY_LIN_S_IFBLK, MY_LIN_S_IFCHR, MY_LIN_S_IFIFO, MY_LIN_S_IFSOCK
};
@@ -939,7 +932,7 @@ static const Byte kArcProps[] =
kpidHeadersSize,
kpidFileSystem,
kpidMethod,
kpidBlock,
kpidClusterSize,
kpidBigEndian,
kpidCTime,
kpidCharacts
@@ -1850,7 +1843,7 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
prop = res;
break;
}
case kpidBlock: prop = _h.BlockSize; break;
case kpidClusterSize: prop = _h.BlockSize; break;
case kpidBigEndian: prop = _h.be; break;
case kpidCTime:
if (_h.CTime != 0)
@@ -2111,11 +2104,8 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
int res = NExtract::NOperationResult::kDataError;
{
CMyComPtr<ISequentialInStream> inSeqStream;
CMyComPtr<IInStream> inStream;
HRESULT hres = GetStream(index, &inSeqStream);
if (inSeqStream)
inSeqStream.QueryInterface(IID_IInStream, &inStream);
if (hres == S_FALSE || !inStream)
if (hres == S_FALSE || !inSeqStream)
{
if (hres == E_OUTOFMEMORY)
return hres;
@@ -2124,9 +2114,8 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
else
{
RINOK(hres);
if (inStream)
{
HRESULT hres = copyCoder->Code(inStream, outStream, NULL, NULL, progress);
HRESULT hres = copyCoder->Code(inSeqStream, outStream, NULL, NULL, progress);
if (hres == S_OK)
{
if (copyCoderSpec->TotalSize == unpackSize)
@@ -2143,8 +2132,10 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
}
}
}
RINOK(extractCallback->SetOperationResult(res));
}
return S_OK;
COM_TRY_END
}

View File

@@ -639,6 +639,7 @@ void CHandler::Init()
_forceCodePage = false;
// _codePage = CP_OEMCP;
_curCodePage = _specifiedCodePage = CP_UTF8; // CP_OEMCP;
_thereIsPaxExtendedHeader = false;
}
STDMETHODIMP CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps)

View File

@@ -4,6 +4,7 @@
#include "../../../Common/ComTry.h"
#include "../../../Common/Defs.h"
#include "../../../Common/MyLinux.h"
#include "../../../Common/StringConvert.h"
#include "../../../Common/UTFConvert.h"
@@ -113,7 +114,11 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt
NCOM::CPropVariant prop;
RINOK(callback->GetProperty(i, kpidPosixAttrib, &prop));
if (prop.vt == VT_EMPTY)
ui.Mode = 0777 | (ui.IsDir ? 0040000 : 0100000);
ui.Mode =
MY_LIN_S_IRWXO
| MY_LIN_S_IRWXG
| MY_LIN_S_IRWXU
| (ui.IsDir ? MY_LIN_S_IFDIR : MY_LIN_S_IFREG);
else if (prop.vt != VT_UI4)
return E_INVALIDARG;
else

View File

@@ -599,17 +599,17 @@ enum
kpidSavedState
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
{ NULL, kpidSize, VT_UI8},
{ NULL, kpidOffset, VT_UI8},
{ NULL, kpidCTime, VT_FILETIME},
{ NULL, kpidClusterSize, VT_UI8},
{ NULL, kpidMethod, VT_BSTR},
{ (LPOLESTR)L"Parent", kpidParent, VT_BSTR},
{ "Parent", kpidParent, VT_BSTR},
{ NULL, kpidCreatorApp, VT_BSTR},
{ NULL, kpidHostOS, VT_BSTR},
{ (LPOLESTR)L"Saved State", kpidSavedState, VT_BOOL},
{ "Saved State", kpidSavedState, VT_BOOL},
{ NULL, kpidId, VT_BSTR}
};

View File

@@ -56,7 +56,7 @@ enum
kpidBootImage
};
static const STATPROPSTG kArcProps[] =
static const CStatProp kArcProps[] =
{
{ NULL, kpidSize, VT_UI8},
{ NULL, kpidPackSize, VT_UI8},
@@ -69,8 +69,8 @@ static const STATPROPSTG kArcProps[] =
{ NULL, kpidIsVolume, VT_BOOL},
{ NULL, kpidVolume, VT_UI4},
{ NULL, kpidNumVolumes, VT_UI4},
{ (LPOLESTR)L"Images", kpidNumImages, VT_UI4},
{ (LPOLESTR)L"Boot Image", kpidBootImage, VT_UI4}
{ "Images", kpidNumImages, VT_UI4},
{ "Boot Image", kpidBootImage, VT_UI4}
};

View File

@@ -21,7 +21,7 @@
#include "../../Common/StreamObjects.h"
#include "../../Common/StreamUtils.h"
#include "../../Compress/XPressDecoder.h"
#include "../../Compress/XpressDecoder.h"
#include "../Common/OutStreamWithSha1.h"

View File

@@ -221,6 +221,7 @@ namespace NHeaderFlags
const UInt32 kXPRESS = (UInt32)1 << 17;
const UInt32 kLZX = (UInt32)1 << 18;
const UInt32 kLZMS = (UInt32)1 << 19;
const UInt32 kXPRESS2 = (UInt32)1 << 21; // XPRESS with nonstandard chunk size ?
const UInt32 kMethodMask = 0xFFFE0000;
}
@@ -277,7 +278,8 @@ struct CHeader
return (!IsCompressed()
|| (Flags & NHeaderFlags::kLZX) != 0
|| (Flags & NHeaderFlags::kXPRESS) != 0
|| (Flags & NHeaderFlags::kLZMS) != 0);
|| (Flags & NHeaderFlags::kLZMS) != 0
|| (Flags & NHeaderFlags::kXPRESS2) != 0);
}
unsigned GetMethod() const
@@ -289,6 +291,7 @@ struct CHeader
if (mask == NHeaderFlags::kXPRESS) return NMethod::kXPRESS;
if (mask == NHeaderFlags::kLZX) return NMethod::kLZX;
if (mask == NHeaderFlags::kLZMS) return NMethod::kLZMS;
if (mask == NHeaderFlags::kXPRESS2) return NMethod::kXPRESS;
return mask;
}

View File

@@ -5,6 +5,7 @@
#include "../../../C/CpuArch.h"
#include "../../Common/ComTry.h"
#include "../../Common/MyLinux.h"
#include "../../Common/MyXml.h"
#include "../../Common/StringToInt.h"
#include "../../Common/UTFConvert.h"
@@ -511,10 +512,8 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
if (item.ModeDefined)
{
UInt32 mode = item.Mode;
const UInt32 k_PosixAttrib_Dir = (1 << 14);
const UInt32 k_PosixAttrib_RegFile = (1 << 15);
if ((mode & 0xF000) == 0)
mode |= (item.IsDir ? k_PosixAttrib_Dir : k_PosixAttrib_RegFile);
if ((mode & MY_LIN_S_IFMT) == 0)
mode |= (item.IsDir ? MY_LIN_S_IFDIR : MY_LIN_S_IFREG);
prop = mode;
}
break;

View File

@@ -153,35 +153,6 @@ namespace NFileHeader
};
}
namespace NUnixAttrib
{
const UInt32 kIFMT = 0170000; // file type mask
const UInt32 kIFDIR = 0040000; // directory
const UInt32 kIFREG = 0100000; // regular file
const UInt32 kIFSOCK = 0140000; // socket (BSD, not SysV or Amiga)
const UInt32 kIFLNK = 0120000; // symbolic link (not SysV, Amiga)
const UInt32 kIFBLK = 0060000; // block special (not Amiga)
const UInt32 kIFCHR = 0020000; // character special (not Amiga)
const UInt32 kIFIFO = 0010000; // fifo (BCC, not MSC or Amiga)
const UInt32 kISUID = 04000; // set user id on execution
const UInt32 kISGID = 02000; // set group id on execution
const UInt32 kISVTX = 01000; // directory permissions control
const UInt32 kENFMT = kISGID; // record locking enforcement flag
const UInt32 kIRWXU = 00700; // read, write, execute: owner
const UInt32 kIRUSR = 00400; // read permission: owner
const UInt32 kIWUSR = 00200; // write permission: owner
const UInt32 kIXUSR = 00100; // execute permission: owner
const UInt32 kIRWXG = 00070; // read, write, execute: group
const UInt32 kIRGRP = 00040; // read permission: group
const UInt32 kIWGRP = 00020; // write permission: group
const UInt32 kIXGRP = 00010; // execute permission: group
const UInt32 kIRWXO = 00007; // read, write, execute: other
const UInt32 kIROTH = 00004; // read permission: other
const UInt32 kIWOTH = 00002; // write permission: other
const UInt32 kIXOTH = 00001; // execute permission: other
}
namespace NAmigaAttrib
{

View File

@@ -2,11 +2,14 @@
#include "StdAfx.h"
#include "ZipHeader.h"
#include "ZipItem.h"
#include "../Common/ItemNameUtils.h"
#include "../../../../C/CpuArch.h"
#include "../../../Common/MyLinux.h"
#include "../Common/ItemNameUtils.h"
#include "ZipItem.h"
namespace NArchive {
namespace NZip {
@@ -114,7 +117,7 @@ bool CItem::IsDir() const
case NHostOS::kMVS:
return false; // change it throw kUnknownAttributes;
case NHostOS::kUnix:
return ((highAttrib & NUnixAttrib::kIFMT) == NUnixAttrib::kIFDIR);
return MY_LIN_S_ISDIR(highAttrib);
default:
return false;
}
@@ -151,7 +154,7 @@ bool CItem::GetPosixAttrib(UInt32 &attrib) const
}
attrib = 0;
if (IsDir())
attrib = NUnixAttrib::kIFDIR;
attrib = MY_LIN_S_IFDIR;
return false;
}

View File

@@ -61,6 +61,7 @@ AR_OBJS = \
$O\DeflateProps.obj \
$O\DmgHandler.obj \
$O\ElfHandler.obj \
$O\ExtHandler.obj \
$O\FatHandler.obj \
$O\FlvHandler.obj \
$O\GzHandler.obj \

View File

@@ -283,6 +283,10 @@ SOURCE=..\..\..\Common\MyInitGuid.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyLinux.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\MyMap.cpp
# End Source File
# Begin Source File
@@ -2431,6 +2435,10 @@ SOURCE=..\..\Archive\ElfHandler.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Archive\ExtHandler.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Archive\FatHandler.cpp
# End Source File
# Begin Source File

View File

@@ -8,7 +8,6 @@
#include "../../Common/MyCom.h"
#include "../../Windows/Defs.h"
#include "../../Windows/PropVariant.h"
#include "../ICoder.h"
@@ -23,7 +22,7 @@ extern const CHasherInfo *g_Hashers[];
static void SetPropFromAscii(const char *s, PROPVARIANT *prop) throw()
{
UINT len = (UINT)strlen(s);
OLECHAR *dest = ::SysAllocStringLen(NULL, len);
BSTR dest = ::SysAllocStringLen(NULL, len);
if (dest)
{
for (UINT i = 0; i <= len; i++)

View File

@@ -457,17 +457,16 @@ HRESULT CDecoder::CodeSpec(UInt32 curSize)
HRESULT CDecoder::Code(const Byte *inData, size_t inSize, UInt32 outSize)
{
if (_pos == _winSize)
{
_pos = 0;
_overDict = true;
}
if (!_keepHistory)
{
_pos = 0;
_overDict = false;
}
else if (_pos == _winSize)
{
_pos = 0;
_overDict = true;
}
_writePos = _pos;
_unpackedData = _win + _pos;

View File

@@ -23,7 +23,7 @@ void CBitDecoder::Prepare2() throw()
size_t rem = _bufLim - _buf;
if (rem != 0)
memcpy(_bufBase, _buf, rem);
memmove(_bufBase, _buf, rem);
_bufLim = _bufBase + rem;
_processedSize += (_buf - _bufBase);

View File

@@ -163,6 +163,7 @@ Handler GUIDs:
0C xz
0D ppmd
C7 Ext
C8 VMDK
C9 VDI
CA Qcow

View File

@@ -3,10 +3,16 @@
#include "StdAfx.h"
// #include <stdio.h>
#ifdef _WIN32
#include <wchar.h>
#else
#include <ctype.h>
#endif
#include "../../../../C/Sort.h"
#include "../../../../C/CpuArch.h"
#include "../../../Common/UTFConvert.h"
#include "../../../Common/Wildcard.h"
#include "../../../Windows/PropVariant.h"
@@ -556,6 +562,9 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
Files.Alloc(numItems);
UString tempUString;
AString tempAString;
UInt32 i;
for (i = 0; i < numItems; i++)
{
@@ -567,12 +576,12 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
CProxyFile2 &file = Files[i];
#ifdef MY_CPU_LE
const void *p;
UInt32 size;
UInt32 propType;
RINOK(arc.GetRawProps->GetRawProp(i, kpidName, &p, &size, &propType));
#ifdef MY_CPU_LE
if (p && propType == PROP_DATA_TYPE_wchar_t_PTR_Z_LE)
{
file.Name = (const wchar_t *)p;
@@ -582,6 +591,16 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
}
else
#endif
if (p && propType == NPropDataType::kUtf8z)
{
tempAString = (const char *)p;
ConvertUTF8ToUnicode(tempAString, tempUString);
file.NameLen = tempUString.Len();
file.Name = new wchar_t[file.NameLen + 1];
file.NeedDeleteName = true;
wmemcpy((wchar_t *)file.Name, tempUString.Ptr(), file.NameLen + 1);
}
else
{
NCOM::CPropVariant prop;
RINOK(arc.Archive->GetProperty(i, kpidName, &prop));
@@ -595,7 +614,7 @@ HRESULT CProxyArc2::Load(const CArc &arc, IProgress *progress)
file.NameLen = MyStringLen(s);
file.Name = new wchar_t[file.NameLen + 1];
file.NeedDeleteName = true;
MyStringCopy((wchar_t *)file.Name, s);
wmemcpy((wchar_t *)file.Name, s, file.NameLen + 1);
}
UInt32 parent = (UInt32)(Int32)-1;

View File

@@ -1329,5 +1329,5 @@ void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
{
}
else
throw 9815676711;
throw 20150919;
}

View File

@@ -608,6 +608,10 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStre
_curSizeDefined = false;
_index = index;
_diskFilePath.Empty();
// _fi.Clear();
#ifdef SUPPORT_LINKS
// _CopyFile_Path.Empty();
linkPath.Empty();
@@ -1454,7 +1458,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
}
#ifdef _USE_SECURITY_CODE
if (_ntOptions.NtSecurity.Val && _arc->GetRawProps)
if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
{
const void *data;
UInt32 dataSize;
@@ -1497,7 +1501,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
else
NumFiles++;
if (_extractMode && _fi.AttribDefined)
if (!_stdOutMode && _extractMode && _fi.AttribDefined)
SetFileAttrib(_diskFilePath, _fi.Attrib);
RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)));

View File

@@ -18,7 +18,7 @@ static void ReplaceIncorrectChars(UString &s)
#ifdef _WIN32
c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"'
|| c == '/'
|| c == 0x202E // RLO
// || c == 0x202E // RLO
||
#endif
c == WCHAR_PATH_SEPARATOR)
@@ -190,9 +190,7 @@ void Correct_FsPath(bool absIsAllowed, UStringVector &parts, bool isDir)
{
UString &s = parts[i];
#ifdef _WIN32
Correct_PathPart(s);
#endif
if (s.IsEmpty())
{

View File

@@ -268,7 +268,7 @@ void CHandler::AddItem(const CParseItem &item)
}
/*
static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR},
{ NULL, kpidSize, VT_UI8},

View File

@@ -571,6 +571,7 @@ static HRESULT Compress(
const CArcItem &ai = arcItems[i];
bool needRename = false;
UString dest;
if (ai.Censored)
{
FOR_VECTOR (j, options.RenamePairs)
@@ -581,6 +582,8 @@ static HRESULT Compress(
needRename = true;
break;
}
#ifdef SUPPORT_ALT_STREAMS
if (ai.IsAltStream)
{
int colonPos = FindAltStreamColon_in_Path(ai.Name);
@@ -600,8 +603,10 @@ static HRESULT Compress(
}
}
}
#endif
}
}
CUpdatePair2 up2;
up2.SetAs_NoChangeArcItem(ai.IndexInServer);
if (needRename)

View File

@@ -92,7 +92,7 @@ STDMETHODIMP CArchiveUpdateCallback::SetRatioInfo(const UInt64 *inSize, const UI
/*
static const STATPROPSTG kProps[] =
static const CStatProp kProps[] =
{
{ NULL, kpidPath, VT_BSTR},
{ NULL, kpidIsDir, VT_BOOL},

View File

@@ -447,19 +447,22 @@ EXTERN_C HANDLE WINAPI OpenFilePluginW(const wchar_t *name,const unsigned char *
EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
{
MY_TRY_BEGIN;
if (openFrom == OPEN_COMMANDLINE)
{
AString fileName = (const char *)item;
if (fileName.IsEmpty())
return INVALID_HANDLE_VALUE;
if (fileName.Len() >= 2 &&
fileName[0] == '\"' && fileName.Back() == '\"')
if (fileName.Len() >= 2
&& fileName[0] == '\"'
&& fileName.Back() == '\"')
{
fileName.DeleteBack();
fileName.DeleteFrontal(1);
}
return MyOpenFilePlugin(fileName);
}
if (openFrom == OPEN_PLUGINSMENU)
{
switch (item)
@@ -471,6 +474,7 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
throw 142134;
return MyOpenFilePlugin(pluginPanelItem.FindData.cFileName);
}
case 1:
{
CObjectVector<PluginPanelItem> pluginPanelItem;
@@ -491,10 +495,12 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
}
return INVALID_HANDLE_VALUE;
}
default:
throw 4282215;
}
}
return INVALID_HANDLE_VALUE;
MY_TRY_END2("OpenPlugin", INVALID_HANDLE_VALUE);
}

View File

@@ -166,6 +166,14 @@ SOURCE=..\..\..\Common\StringToInt.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\UTFConvert.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\UTFConvert.h
# End Source File
# Begin Source File
SOURCE=..\..\..\Common\Wildcard.cpp
# End Source File
# Begin Source File

View File

@@ -40,11 +40,11 @@ CPlugin::CPlugin(const FString &fileName, CAgent *agent, UString archiveTypeName
CPlugin::~CPlugin() {}
static void MyGetFileTime(IFolderFolder *anArchiveFolder, UInt32 itemIndex,
static void MyGetFileTime(IFolderFolder *folder, UInt32 itemIndex,
PROPID propID, FILETIME &fileTime)
{
NCOM::CPropVariant prop;
if (anArchiveFolder->GetProperty(itemIndex, propID, &prop) != S_OK)
if (folder->GetProperty(itemIndex, propID, &prop) != S_OK)
throw 271932;
if (prop.vt == VT_EMPTY)
{

View File

@@ -20,6 +20,7 @@ CURRENT_OBJS = \
$O\PluginWrite.obj \
$O\ProgressBox.obj \
$O\UpdateCallbackFar.obj \
$O\UTFConvert.obj \
COMMON_OBJS = \
$O\IntToString.obj \

View File

@@ -100,7 +100,7 @@ static HRESULT CopyFileSpec(CFSTR fromPath, CFSTR toPath, bool writeToDisk, UInt
return S_OK;
}
static const PROPID kProps[] =
static const Byte kProps[] =
{
kpidName,
// kpidOutName,

View File

@@ -162,6 +162,8 @@ static void MyChangeMenu(HMENU menuLoc, int level, int menuIndex)
if (langID == IDM_OPEN_INSIDE_ONE || langID == IDM_OPEN_INSIDE_PARSER)
{
LangString_OnlyFromLangFile(IDM_OPEN_INSIDE, newString);
if (newString.IsEmpty())
continue;
newString.Replace(L"&", L"");
int tabPos = newString.Find(L"\t");
if (tabPos >= 0)

View File

@@ -13,7 +13,7 @@
using namespace NWindows;
using namespace NNet;
static const PROPID kProps[] =
static const Byte kProps[] =
{
kpidName,
kpidLocalName,

View File

@@ -41,7 +41,7 @@ static const unsigned kNumRootFolderItems =
using namespace NWindows;
static const PROPID kProps[] =
static const Byte kProps[] =
{
kpidName
};

View File

@@ -13,7 +13,7 @@
#include "../FileManager/ProgressDialog2.h"
#include "../FileManager/ProgressDialog2Res.h"
#include "../FileManager/PropertyNameRes.h"
#include "../FileManager/resourceGUI.h"
#include "../FileManager/resourceGui.h"
#include "HashGUI.h"

View File

@@ -10,7 +10,7 @@
#include "../FileManager/FormatUtils.h"
#include "../FileManager/LangUtils.h"
#include "../FileManager/resourceGUI.h"
#include "../FileManager/resourceGui.h"
#include "resource2.h"

42
CPP/Common/MyLinux.h Normal file
View File

@@ -0,0 +1,42 @@
// MyLinux.h
#ifndef __MY_LIN_LINUX_H
#define __MY_LIN_LINUX_H
#define MY_LIN_S_IFMT 00170000
#define MY_LIN_S_IFSOCK 0140000
#define MY_LIN_S_IFLNK 0120000
#define MY_LIN_S_IFREG 0100000
#define MY_LIN_S_IFBLK 0060000
#define MY_LIN_S_IFDIR 0040000
#define MY_LIN_S_IFCHR 0020000
#define MY_LIN_S_IFIFO 0010000
#define MY_LIN_S_ISLNK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFLNK)
#define MY_LIN_S_ISREG(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFREG)
#define MY_LIN_S_ISDIR(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFDIR)
#define MY_LIN_S_ISCHR(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFCHR)
#define MY_LIN_S_ISBLK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFBLK)
#define MY_LIN_S_ISFIFO(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFIFO)
#define MY_LIN_S_ISSOCK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFSOCK)
#define MY_LIN_S_ISUID 0004000
#define MY_LIN_S_ISGID 0002000
#define MY_LIN_S_ISVTX 0001000
#define MY_LIN_S_IRWXU 00700
#define MY_LIN_S_IRUSR 00400
#define MY_LIN_S_IWUSR 00200
#define MY_LIN_S_IXUSR 00100
#define MY_LIN_S_IRWXG 00070
#define MY_LIN_S_IRGRP 00040
#define MY_LIN_S_IWGRP 00020
#define MY_LIN_S_IXGRP 00010
#define MY_LIN_S_IRWXO 00007
#define MY_LIN_S_IROTH 00004
#define MY_LIN_S_IWOTH 00002
#define MY_LIN_S_IXOTH 00001
#endif

View File

@@ -178,7 +178,7 @@ bool CWindow2::OnCommand(int /* code */, int /* itemID */, LPARAM /* lParam */,
/*
bool CDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
{
switch(aButtonID)
switch (buttonID)
{
case IDOK:
OnOK();

View File

@@ -9,9 +9,23 @@
namespace NWindows {
namespace NCOM {
BSTR AllocBstrFromAscii(const char *s) throw()
{
if (!s)
return NULL;
UINT len = (UINT)strlen(s);
BSTR p = ::SysAllocStringLen(NULL, len);
if (p)
{
for (UINT i = 0; i <= len; i++)
p[i] = (Byte)s[i];
}
return p;
}
HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw()
{
p->bstrVal = ::SysAllocStringLen(0, numChars);
p->bstrVal = ::SysAllocStringLen(NULL, numChars);
if (!p->bstrVal)
{
p->vt = VT_ERROR;
@@ -24,20 +38,13 @@ HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw()
HRESULT PropVarEm_Set_Str(PROPVARIANT *p, const char *s) throw()
{
UINT len = (UINT)strlen(s);
p->bstrVal = ::SysAllocStringLen(0, len);
if (!p->bstrVal)
{
p->bstrVal = AllocBstrFromAscii(s);
if (p->bstrVal)
return S_OK;
p->vt = VT_ERROR;
p->scode = E_OUTOFMEMORY;
return E_OUTOFMEMORY;
}
p->vt = VT_BSTR;
BSTR dest = p->bstrVal;
for (UINT i = 0; i <= len; i++)
dest[i] = (Byte)s[i];
return S_OK;
}
CPropVariant::CPropVariant(const PROPVARIANT &varSrc)
{
@@ -68,6 +75,7 @@ CPropVariant& CPropVariant::operator=(const CPropVariant &varSrc)
InternalCopy(&varSrc);
return *this;
}
CPropVariant& CPropVariant::operator=(const PROPVARIANT &varSrc)
{
InternalCopy(&varSrc);
@@ -144,20 +152,13 @@ CPropVariant& CPropVariant::operator=(const char *s)
InternalClear();
vt = VT_BSTR;
wReserved1 = 0;
UINT len = (UINT)strlen(s);
bstrVal = ::SysAllocStringLen(0, len);
bstrVal = AllocBstrFromAscii(s);
if (!bstrVal)
{
throw kMemException;
// vt = VT_ERROR;
// scode = E_OUTOFMEMORY;
}
else
{
BSTR dest = bstrVal;
for (UINT i = 0; i <= len; i++)
dest[i] = (Byte)s[i];
}
return *this;
}
@@ -178,7 +179,7 @@ BSTR CPropVariant::AllocBstr(unsigned numChars)
InternalClear();
vt = VT_BSTR;
wReserved1 = 0;
bstrVal = ::SysAllocStringLen(0, numChars);
bstrVal = ::SysAllocStringLen(NULL, numChars);
if (!bstrVal)
{
throw kMemException;

View File

@@ -10,6 +10,8 @@
namespace NWindows {
namespace NCOM {
BSTR AllocBstrFromAscii(const char *s) throw();
HRESULT PropVariant_Clear(PROPVARIANT *p) throw();
HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw();

View File

@@ -37,7 +37,17 @@ bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool
UINT_TO_STR_2(' ', st.wHour);
UINT_TO_STR_2(':', st.wMinute);
if (includeSeconds)
{
UINT_TO_STR_2(':', st.wSecond);
/*
*s++ = '.';
unsigned val = st.wMilliseconds;
s[2] = (char)('0' + val % 10); val /= 10;
s[1] = (char)('0' + val % 10);
s[0] = (char)('0' + val / 10);
s += 3;
*/
}
}
*s = 0;
return true;

View File

@@ -10,8 +10,8 @@ AppName = "7-Zip"
InstallDir = %CE1%\%AppName%
[Strings]
AppVer = "15.07"
AppDate = "2015-09-17"
AppVer = "15.08"
AppDate = "2015-10-01"
[CEDevice]
; ProcessorType = 2577 ; ARM

View File

@@ -2,7 +2,7 @@
;Defines
!define VERSION_MAJOR 15
!define VERSION_MINOR 07
!define VERSION_MINOR 08
!define VERSION_POSTFIX_FULL " beta"
!ifdef WIN64
!ifdef IA64

View File

@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<?define VerMajor = "15" ?>
<?define VerMinor = "07" ?>
<?define VerMinor = "08" ?>
<?define VerBuild = "00" ?>
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
<?define MmHex = "$(var.VerMajor)$(var.VerMinor)" ?>

View File

@@ -1,4 +1,4 @@
7-Zip 15.07 Sources
7-Zip 15.08 Sources
-------------------
7-Zip is a file archiver for Windows.