This commit is contained in:
Igor Pavlov
2015-06-15 00:00:00 +00:00
committed by Kornel Lesiński
parent 0713a3ab80
commit 54490d51d5
591 changed files with 34932 additions and 16390 deletions

View File

@@ -32,8 +32,14 @@ HINSTANCE g_hInstance = 0;
// Tou can find the list of all GUIDs in Guid.txt file.
// use another CLSIDs, if you want to support other formats (zip, rar, ...).
// {23170F69-40C1-278A-1000-000110070000}
DEFINE_GUID(CLSID_CFormat7z,
0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
DEFINE_GUID(CLSID_CFormatXz,
0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x0C, 0x00, 0x00);
#define CLSID_Format CLSID_CFormat7z
// #define CLSID_Format CLSID_CFormatXz
using namespace NWindows;
using namespace NFile;
@@ -326,7 +332,7 @@ STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index,
{
// Create folders for file
int slashPos = _filePath.ReverseFind(WCHAR_PATH_SEPARATOR);
int slashPos = _filePath.ReverseFind_PathSepar();
if (slashPos >= 0)
CreateComplexDir(_directoryPath + us2fs(_filePath.Left(slashPos)));
}
@@ -662,7 +668,7 @@ STDMETHODIMP CArchiveUpdateCallback::GetVolumeStream(UInt32 index, ISequentialOu
ConvertUInt32ToString(index + 1, temp);
UString res = temp;
while (res.Len() < 2)
res = UString(L'0') + res;
res.InsertAtFront(L'0');
UString fileName = VolName;
fileName += L'.';
fileName += res;
@@ -774,7 +780,7 @@ int MY_CDECL main(int numArgs, const char *args[])
}
CMyComPtr<IOutArchive> outArchive;
if (createObjectFunc(&CLSID_CFormat7z, &IID_IOutArchive, (void **)&outArchive) != S_OK)
if (createObjectFunc(&CLSID_Format, &IID_IOutArchive, (void **)&outArchive) != S_OK)
{
PrintError("Can not get class object");
return 1;
@@ -845,7 +851,7 @@ int MY_CDECL main(int numArgs, const char *args[])
}
CMyComPtr<IInArchive> archive;
if (createObjectFunc(&CLSID_CFormat7z, &IID_IInArchive, (void **)&archive) != S_OK)
if (createObjectFunc(&CLSID_Format, &IID_IInArchive, (void **)&archive) != S_OK)
{
PrintError("Can not get class object");
return 1;
@@ -867,7 +873,8 @@ int MY_CDECL main(int numArgs, const char *args[])
// openCallbackSpec->PasswordIsDefined = true;
// openCallbackSpec->Password = L"1";
if (archive->Open(file, 0, openCallback) != S_OK)
const UInt64 scanSize = 1 << 23;
if (archive->Open(file, &scanSize, openCallback) != S_OK)
{
PrintError("Can not open file as archive", archiveName);
return 1;