Update to 7-Zip Version 22.01

See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/c43cbc5f18/
This commit is contained in:
Tino Reichardt
2022-08-07 10:03:34 +02:00
parent 57558682a8
commit f9e0730191
47 changed files with 2485 additions and 812 deletions
+43 -5
View File
@@ -48,14 +48,22 @@ static const Byte kProps[] =
kpidPackSize,
kpidMTime,
kpidATime,
kpidChangeTime
kpidCTime,
kpidChangeTime,
// kpidUserId,
// kpidGroupId,
// kpidPosixAttrib,
kpidLinks
};
static const Byte kArcProps[] =
{
kpidComment,
kpidUnpackVer,
kpidClusterSize,
kpidCTime
kpidSectorSize,
kpidCTime,
kpidMTime,
kpidComment
};
IMP_IInArchive_Props
@@ -69,6 +77,18 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
case kpidPhySize: prop = _archive.PhySize; break;
case kpidUnpackVer:
{
if (_archive.LogVols.Size() == 1)
{
UString s;
const CLogVol &vol = _archive.LogVols[0];
vol.DomainId.AddUdfVersionTo(s);
if (!s.IsEmpty())
prop = s;
}
break;
}
case kpidComment:
{
UString comment = _archive.GetComment();
@@ -90,12 +110,21 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
}
break;
case kpidSectorSize: prop = ((UInt32)1 << _archive.SecLogSize); break;
case kpidCTime:
if (_archive.LogVols.Size() == 1)
{
const CLogVol &vol = _archive.LogVols[0];
if (vol.FileSets.Size() >= 1)
UdfTimeToFileTime(vol.FileSets[0].RecodringTime, prop);
UdfTimeToFileTime(vol.FileSets[0].RecordingTime, prop);
}
break;
case kpidMTime:
if (_archive.PrimeVols.Size() == 1)
{
const CPrimeVol &pv = _archive.PrimeVols[0];
UdfTimeToFileTime(pv.RecordingTime, prop);
}
break;
@@ -160,6 +189,7 @@ STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallb
{
const CLogVol &vol = _archive.LogVols[volIndex];
bool showFileSetName = (vol.FileSets.Size() > 1);
// showFileSetName = true; // for debug
FOR_VECTOR (fsIndex, vol.FileSets)
{
const CFileSet &fs = vol.FileSets[fsIndex];
@@ -212,7 +242,15 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val
case kpidPackSize: if (!item.IsDir()) prop = (UInt64)item.NumLogBlockRecorded * vol.BlockSize; break;
case kpidMTime: UdfTimeToFileTime(item.MTime, prop); break;
case kpidATime: UdfTimeToFileTime(item.ATime, prop); break;
case kpidCTime:
if (item.IsExtended)
UdfTimeToFileTime(item.CreateTime, prop);
break;
case kpidChangeTime: UdfTimeToFileTime(item.AttribTime, prop); break;
// case kpidUserId: prop = item.Uid; break;
// case kpidGroupId: prop = item.Gid; break;
// case kpidPosixAttrib: prop = (UInt32)item.Permissions; break;
case kpidLinks: prop = (UInt32)item.FileLinkCount; break;
}
}
prop.Detach(value);
@@ -255,7 +293,7 @@ STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
if (size < len)
return S_FALSE;
int partitionIndex = vol.PartitionMaps[extent.PartitionRef].PartitionIndex;
const unsigned partitionIndex = vol.PartitionMaps[extent.PartitionRef].PartitionIndex;
UInt32 logBlockNumber = extent.Pos;
const CPartition &partition = _archive.Partitions[partitionIndex];
UInt64 offset = ((UInt64)partition.Pos << _archive.SecLogSize) +