diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2008-08-13 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:56 +0300 |
commit | 173c07e166fdf6fcd20f18ea73008f1b628945df (patch) | |
tree | 13ebea85cdc4c16ae93714ff0627ee9f91ad7e08 /CPP/7zip/Archive/Com | |
parent | 3901bf0ab88106a5b031cba7bc18d60cdebf7eef (diff) |
4.59 beta
Diffstat (limited to 'CPP/7zip/Archive/Com')
-rwxr-xr-x | CPP/7zip/Archive/Com/ComHandler.cpp | 36 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComHandler.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComIn.cpp | 12 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComIn.h | 4 |
4 files changed, 24 insertions, 30 deletions
diff --git a/CPP/7zip/Archive/Com/ComHandler.cpp b/CPP/7zip/Archive/Com/ComHandler.cpp index 2255c021..8b46976c 100755 --- a/CPP/7zip/Archive/Com/ComHandler.cpp +++ b/CPP/7zip/Archive/Com/ComHandler.cpp @@ -10,19 +10,19 @@ namespace NArchive { namespace NCom { -STATPROPSTG kProps[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, - { NULL, kpidIsFolder, VT_BOOL}, + { NULL, kpidIsDir, VT_BOOL}, { NULL, kpidSize, VT_UI8}, // { NULL, kpidAttributes, VT_UI4}, - { NULL, kpidPackedSize, VT_UI8}, - { NULL, kpidCreationTime, VT_FILETIME}, - { NULL, kpidLastWriteTime, VT_FILETIME} + { NULL, kpidPackSize, VT_UI8}, + { NULL, kpidCTime, VT_FILETIME}, + { NULL, kpidMTime, VT_FILETIME} }; -STATPROPSTG kArcProps[] = +STATPROPSTG kArcProps[] = { { NULL, kpidClusterSize, VT_UI4} }; @@ -58,25 +58,19 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val prop = name; break; } - case kpidIsFolder: - prop = item.IsDir(); - break; - case kpidCreationTime: - prop = item.CreationTime; - break; - case kpidLastWriteTime: - prop = item.LastWriteTime; - break; + case kpidIsDir: prop = item.IsDir(); break; + case kpidCTime: prop = item.CTime; break; + case kpidMTime: prop = item.MTime; break; /* case kpidAttributes: prop = item.Falgs; break; */ - case kpidPackedSize: + case kpidPackSize: if (!item.IsDir()) { - int numBits = _db.IsLargeStream(item.Size) ? - _db.SectorSizeBits : + int numBits = _db.IsLargeStream(item.Size) ? + _db.SectorSizeBits : _db.MiniSectorSizeBits; prop = (item.Size + ((UInt64)1 << numBits) - 1) >> numBits << numBits; break; @@ -91,7 +85,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val COM_TRY_END } -STDMETHODIMP CHandler::Open(IInStream *inStream, +STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 * /* maxCheckStartPosition */, IArchiveOpenCallback * /* openArchiveCallback */) { @@ -150,7 +144,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, currentItemSize = item.Size; CMyComPtr<ISequentialOutStream> realOutStream; - Int32 askMode = testMode ? + Int32 askMode = testMode ? NArchive::NExtract::NAskMode::kTest : NArchive::NExtract::NAskMode::kExtract; RINOK(extractCallback->GetStream(index, &realOutStream, askMode)); @@ -204,7 +198,7 @@ STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems, if (fid >= _db.NumSectorsInMiniStream) break; size = 1 << _db.MiniSectorSizeBits; - offset = (((UInt64)_db.MiniSids[fid] + 1) << _db.SectorSizeBits) + + offset = (((UInt64)_db.MiniSids[fid] + 1) << _db.SectorSizeBits) + ((sid & ((1 << subBits) - 1)) << _db.MiniSectorSizeBits); if (sid >= _db.MatSize) break; diff --git a/CPP/7zip/Archive/Com/ComHandler.h b/CPP/7zip/Archive/Com/ComHandler.h index f8b2b135..89bc98d0 100755 --- a/CPP/7zip/Archive/Com/ComHandler.h +++ b/CPP/7zip/Archive/Com/ComHandler.h @@ -10,7 +10,7 @@ namespace NArchive { namespace NCom { -class CHandler: +class CHandler: public IInArchive, public CMyUnknownImp { diff --git a/CPP/7zip/Archive/Com/ComIn.cpp b/CPP/7zip/Archive/Com/ComIn.cpp index b8dfdb81..74e601c1 100755 --- a/CPP/7zip/Archive/Com/ComIn.cpp +++ b/CPP/7zip/Archive/Com/ComIn.cpp @@ -2,8 +2,8 @@ #include "StdAfx.h" -extern "C" -{ +extern "C" +{ #include "../../../../C/Alloc.h" } @@ -69,8 +69,8 @@ static void ReadItem(Byte *p, CItem &item, bool mode64bit) item.RightDid = GetUi32(p + 72); item.SonDid = GetUi32(p + 76); // item.Flags = GetUi32(p + 96); - GetFileTimeFromMem(p + 100, &item.CreationTime); - GetFileTimeFromMem(p + 108, &item.LastWriteTime); + GetFileTimeFromMem(p + 100, &item.CTime); + GetFileTimeFromMem(p + 108, &item.MTime); item.Sid = GetUi32(p + 116); item.Size = GetUi32(p + 120); if (mode64bit) @@ -127,7 +127,7 @@ static UString CompoundNameToFileName(const UString &s) } else res += c; - } + } return res; } @@ -219,7 +219,7 @@ HRESULT OpenArchive(IInStream *inStream, CDatabase &db) db.SectorSizeBits = sectorSizeBits; db.MiniSectorSizeBits = miniSectorSizeBits; - if (sectorSizeBits > 28 || miniSectorSizeBits > 28 || + if (sectorSizeBits > 28 || miniSectorSizeBits > 28 || sectorSizeBits < 7 || miniSectorSizeBits < 2 || miniSectorSizeBits > sectorSizeBits) return S_FALSE; UInt32 numSectorsForFAT = GetUi32(p + 0x2C); diff --git a/CPP/7zip/Archive/Com/ComIn.h b/CPP/7zip/Archive/Com/ComIn.h index 683e61dc..081c6aaa 100755 --- a/CPP/7zip/Archive/Com/ComIn.h +++ b/CPP/7zip/Archive/Com/ComIn.h @@ -46,8 +46,8 @@ struct CItem Byte Name[kNameSizeMax]; // UInt16 NameSize; // UInt32 Flags; - FILETIME CreationTime; - FILETIME LastWriteTime; + FILETIME CTime; + FILETIME MTime; UInt64 Size; UInt32 LeftDid; UInt32 RightDid; |