diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2007-08-27 04:00:00 +0400 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:15:54 +0300 |
commit | 051769bbc577aeede90558b6ab5c9be187940ca0 (patch) | |
tree | e6330cb80f2d4a526d8aa27812528e053b0cda90 /CPP/7zip/Archive/Com | |
parent | 33ccab7e728a996800e166d849fe1e92a17e1afe (diff) |
4.53 beta
Diffstat (limited to 'CPP/7zip/Archive/Com')
-rwxr-xr-x | CPP/7zip/Archive/Com/ComHandler.cpp | 65 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComIn.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Com/ComRegister.cpp | 2 |
3 files changed, 26 insertions, 43 deletions
diff --git a/CPP/7zip/Archive/Com/ComHandler.cpp b/CPP/7zip/Archive/Com/ComHandler.cpp index 6d548256..aa9bf859 100755 --- a/CPP/7zip/Archive/Com/ComHandler.cpp +++ b/CPP/7zip/Archive/Com/ComHandler.cpp @@ -10,7 +10,7 @@ namespace NArchive { namespace NCom { -STATPROPSTG kProperties[] = +STATPROPSTG kProps[] = { { NULL, kpidPath, VT_BSTR}, { NULL, kpidIsFolder, VT_BOOL}, @@ -21,49 +21,32 @@ STATPROPSTG kProperties[] = { NULL, kpidLastWriteTime, VT_FILETIME} }; -STDMETHODIMP CHandler::GetArchiveProperty(PROPID /* propID */, PROPVARIANT *value) -{ - value->vt = VT_EMPTY; - return S_OK; -} -STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties) +STATPROPSTG kArcProps[] = { - *numProperties = sizeof(kProperties) / sizeof(kProperties[0]); - return S_OK; -} + { NULL, kpidClusterSize, VT_UI4} +}; -STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, - BSTR *name, PROPID *propID, VARTYPE *varType) -{ - if(index >= sizeof(kProperties) / sizeof(kProperties[0])) - return E_INVALIDARG; - const STATPROPSTG &srcItem = kProperties[index]; - *propID = srcItem.propid; - *varType = srcItem.vt; - if (srcItem.lpwstrName == 0) - *name = 0; - else - *name = ::SysAllocString(srcItem.lpwstrName); - return S_OK; -} +IMP_IInArchive_Props +IMP_IInArchive_ArcProps -STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties) +STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) { - *numProperties = 0; + COM_TRY_BEGIN + NWindows::NCOM::CPropVariant prop; + switch(propID) + { + case kpidClusterSize: prop = (UInt32)1 << _db.SectorSizeBits; break; + } + prop.Detach(value); return S_OK; -} - -STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 /* index */, - BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */) -{ - return E_INVALIDARG; + COM_TRY_END } STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value) { COM_TRY_BEGIN - NWindows::NCOM::CPropVariant propVariant; + NWindows::NCOM::CPropVariant prop; const CRef &ref = _db.Refs[index]; const CItem &item = _db.Items[ref.Did]; @@ -72,21 +55,21 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val case kpidPath: { UString name = _db.GetItemPath(index); - propVariant = name; + prop = name; break; } case kpidIsFolder: - propVariant = item.IsDir(); + prop = item.IsDir(); break; case kpidCreationTime: - propVariant = item.CreationTime; + prop = item.CreationTime; break; case kpidLastWriteTime: - propVariant = item.LastWriteTime; + prop = item.LastWriteTime; break; /* case kpidAttributes: - propVariant = item.Falgs; + prop = item.Falgs; break; */ case kpidPackedSize: @@ -95,15 +78,15 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val int numBits = _db.IsLargeStream(item.Size) ? _db.SectorSizeBits : _db.MiniSectorSizeBits; - propVariant = (item.Size + ((UInt32)1 << numBits) - 1) >> numBits << numBits; + prop = (item.Size + ((UInt64)1 << numBits) - 1) >> numBits << numBits; break; } case kpidSize: if (!item.IsDir()) - propVariant = (UInt64)item.Size; + prop = (UInt64)item.Size; break; } - propVariant.Detach(value); + prop.Detach(value); return S_OK; COM_TRY_END } diff --git a/CPP/7zip/Archive/Com/ComIn.cpp b/CPP/7zip/Archive/Com/ComIn.cpp index 0db3f1c6..c3549609 100755 --- a/CPP/7zip/Archive/Com/ComIn.cpp +++ b/CPP/7zip/Archive/Com/ComIn.cpp @@ -338,7 +338,7 @@ HRESULT OpenArchive(IInStream *inStream, CDatabase &db) if (!db.MiniSids.Allocate(numSectorsInMiniStream)) return S_FALSE; { - UInt64 matSize64 = (root.Size + (1 << miniSectorSizeBits) - 1) >> miniSectorSizeBits; + UInt64 matSize64 = (root.Size + ((UInt64)1 << miniSectorSizeBits) - 1) >> miniSectorSizeBits; if (matSize64 > NFatID::kMaxValue) return S_FALSE; db.MatSize = (UInt32)matSize64; diff --git a/CPP/7zip/Archive/Com/ComRegister.cpp b/CPP/7zip/Archive/Com/ComRegister.cpp index 688c9803..c744b04f 100755 --- a/CPP/7zip/Archive/Com/ComRegister.cpp +++ b/CPP/7zip/Archive/Com/ComRegister.cpp @@ -8,6 +8,6 @@ static IInArchive *CreateArc() { return new NArchive::NCom::CHandler; } static CArcInfo g_ArcInfo = - { L"Com", L"msi doc xls ppt", 0, 0xE5, { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }, 8, false, CreateArc, 0 }; + { L"Compound", L"msi doc xls ppt", 0, 0xE5, { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }, 8, false, CreateArc, 0 }; REGISTER_ARC(Com) |