Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Rar')
-rwxr-xr-xCPP/7zip/Archive/Rar/RarHandler.cpp13
-rwxr-xr-xCPP/7zip/Archive/Rar/RarIn.cpp21
-rwxr-xr-xCPP/7zip/Archive/Rar/RarIn.h2
3 files changed, 20 insertions, 16 deletions
diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp
index fd0952d1..435c5c17 100755
--- a/CPP/7zip/Archive/Rar/RarHandler.cpp
+++ b/CPP/7zip/Archive/Rar/RarHandler.cpp
@@ -167,7 +167,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *va
case kpidIsFolder: prop = item.IsDirectory(); break;
case kpidSize: prop = item.UnPackSize; break;
case kpidPackedSize: prop = GetPackSize(index); break;
- case kpidLastWriteTime: RarTimeToProp(item.LastWriteTime, prop);
+ case kpidLastWriteTime: RarTimeToProp(item.LastWriteTime, prop); break;
case kpidCreationTime: if (item.IsCreationTimeDefined) RarTimeToProp(item.CreationTime, prop); break;
case kpidLastAccessTime: if (item.IsLastAccessTimeDefined) RarTimeToProp(item.LastAccessTime, prop); break;
case kpidAttributes: prop = item.GetWinAttributes(); break;
@@ -243,6 +243,17 @@ public:
{
_afterPart = L".rar";
basePart = name.Left(dotPos);
+ }
+ else if (!_newStyle)
+ {
+ if (ext.CompareNoCase(L"000") == 0 || ext.CompareNoCase(L"001") == 0)
+ {
+ _afterPart.Empty();
+ _first = false;
+ _changedPart = ext;
+ _unchangedPart = name.Left(dotPos + 1);
+ return true;
+ }
}
}
diff --git a/CPP/7zip/Archive/Rar/RarIn.cpp b/CPP/7zip/Archive/Rar/RarIn.cpp
index 0af72a48..efb87fb7 100755
--- a/CPP/7zip/Archive/Rar/RarIn.cpp
+++ b/CPP/7zip/Archive/Rar/RarIn.cpp
@@ -118,9 +118,7 @@ bool CInArchive::ReadBytesAndTestSize(void *data, UInt32 size)
((Byte *)data)[i] = bufData[m_CryptoPos++];
return (i == size);
}
- UInt32 processedSize;
- ReadStream(m_Stream, data, size, &processedSize);
- return (processedSize == size);
+ return (ReadStream_FALSE(m_Stream, data, size) == S_OK);
}
void CInArchive::ReadBytesAndTestResult(void *data, UInt32 size)
@@ -131,10 +129,10 @@ void CInArchive::ReadBytesAndTestResult(void *data, UInt32 size)
HRESULT CInArchive::ReadBytes(void *data, UInt32 size, UInt32 *processedSize)
{
- UInt32 realProcessedSize;
- HRESULT result = ReadStream(m_Stream, data, size, &realProcessedSize);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
+ size_t realProcessedSize = size;
+ HRESULT result = ReadStream(m_Stream, data, &realProcessedSize);
+ if (processedSize != NULL)
+ *processedSize = (UInt32)realProcessedSize;
AddToSeekValue(realProcessedSize);
return result;
}
@@ -465,7 +463,9 @@ HRESULT CInArchive::GetNextItem(CItemEx &item, ICryptoGetTextPassword *getTextPa
m_DecryptedData.SetCapacity(kDecryptedBufferSize);
}
RINOK(m_RarAES->Init());
- RINOK(ReadStream(m_Stream, (Byte *)m_DecryptedData, kDecryptedBufferSize, &m_DecryptedDataSize));
+ size_t decryptedDataSizeT = kDecryptedBufferSize;
+ RINOK(ReadStream(m_Stream, (Byte *)m_DecryptedData, &decryptedDataSizeT));
+ m_DecryptedDataSize = (UInt32)decryptedDataSizeT;
m_DecryptedDataSize = m_RarAES->Filter((Byte *)m_DecryptedData, m_DecryptedDataSize);
m_CryptoMode = true;
@@ -529,11 +529,6 @@ HRESULT CInArchive::GetNextItem(CItemEx &item, ICryptoGetTextPassword *getTextPa
}
}
-void CInArchive::DirectGetBytes(void *data, UInt32 size)
-{
- ReadStream(m_Stream, data, size, NULL);
-}
-
bool CInArchive::SeekInArchive(UInt64 position)
{
UInt64 newPosition;
diff --git a/CPP/7zip/Archive/Rar/RarIn.h b/CPP/7zip/Archive/Rar/RarIn.h
index f1dee321..94cea223 100755
--- a/CPP/7zip/Archive/Rar/RarIn.h
+++ b/CPP/7zip/Archive/Rar/RarIn.h
@@ -112,8 +112,6 @@ public:
void GetArchiveInfo(CInArchiveInfo &archiveInfo) const;
- void DirectGetBytes(void *data, UInt32 size);
-
bool SeekInArchive(UInt64 position);
ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
};