mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-06 11:14:58 -06:00
Update to 7-Zip Version 21.02
This commit is contained in:
@@ -164,14 +164,12 @@ bool CBenchmarkDialog::OnInit()
|
||||
s = s2;
|
||||
SetItemText(IDT_BENCH_CPU, s);
|
||||
}
|
||||
/*
|
||||
{
|
||||
AString s2;
|
||||
GetCpuFeatures(s2);
|
||||
AddCpuFeatures(s2);
|
||||
s = s2;
|
||||
SetItemText(IDT_BENCH_CPU_FEATURE, s);
|
||||
}
|
||||
*/
|
||||
|
||||
s = "7-Zip " MY_VERSION_CPU;
|
||||
SetItemText(IDT_BENCH_VER, s);
|
||||
@@ -384,7 +382,7 @@ void CBenchmarkDialog::OnChangeSettings()
|
||||
EnableItem(IDB_STOP, true);
|
||||
UInt32 dict = OnChangeDictionary();
|
||||
|
||||
for (int i = 0; i < ARRAY_SIZE(g_IDs); i++)
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(g_IDs); i++)
|
||||
SetItemText(g_IDs[i], kProcessingString);
|
||||
_startTime = GetTickCount();
|
||||
PrintTime();
|
||||
@@ -517,7 +515,7 @@ bool CBenchmarkDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
|
||||
|
||||
{
|
||||
UInt32 dicSizeTemp = (UInt32)MyMax(Sync.ProcessedSize, UInt64(1) << 20);
|
||||
dicSizeTemp = MyMin(dicSizeTemp, Sync.DictionarySize),
|
||||
dicSizeTemp = MyMin(dicSizeTemp, Sync.DictionarySize);
|
||||
PrintResults(dicSizeTemp,
|
||||
Sync.CompressingInfoTemp,
|
||||
IDT_BENCH_COMPRESS_USAGE1,
|
||||
@@ -932,8 +930,10 @@ HRESULT Benchmark(
|
||||
|
||||
benchmarker.BenchmarkDialog = &bd;
|
||||
|
||||
NWindows::CThread thread;
|
||||
RINOK(thread.Create(CThreadBenchmark::MyThreadFunction, &benchmarker));
|
||||
bd.Create(hwndParent);
|
||||
return thread.Wait();
|
||||
{
|
||||
NWindows::CThread thread;
|
||||
RINOK(thread.Create(CThreadBenchmark::MyThreadFunction, &benchmarker));
|
||||
bd.Create(hwndParent);
|
||||
return thread.Wait_Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,9 +117,9 @@ BEGIN
|
||||
|
||||
RTEXT "", IDT_BENCH_CPU, m, 202, xc, 8
|
||||
|
||||
RTEXT "", IDT_BENCH_VER, m + xc - 80, 216, 80, 8
|
||||
RTEXT "", IDT_BENCH_VER, m + xc - 100, 216, 100, 8
|
||||
|
||||
LTEXT "", IDT_BENCH_CPU_FEATURE, m, 212, xc - 80, 26
|
||||
LTEXT "", IDT_BENCH_CPU_FEATURE, m, 228, xc - 100, 8
|
||||
LTEXT "", IDT_BENCH_SYS1, m, 238, xc - 140, 8
|
||||
LTEXT "", IDT_BENCH_SYS2, m, 248, xc - 140, 8
|
||||
|
||||
|
||||
@@ -367,7 +367,7 @@ static const CFormatInfo g_Formats[] =
|
||||
|
||||
static bool IsMethodSupportedBySfx(int methodID)
|
||||
{
|
||||
for (int i = 0; i < ARRAY_SIZE(g_7zSfxMethods); i++)
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(g_7zSfxMethods); i++)
|
||||
if (methodID == g_7zSfxMethods[i])
|
||||
return true;
|
||||
return false;
|
||||
@@ -455,6 +455,7 @@ bool CCompressDialog::OnInit()
|
||||
_password1Control.SetText(Info.Password);
|
||||
_password2Control.SetText(Info.Password);
|
||||
_encryptionMethod.Attach(GetItem(IDC_COMPRESS_ENCRYPTION_METHOD));
|
||||
_default_encryptionMethod_Index = -1;
|
||||
|
||||
m_ArchivePath.Attach(GetItem(IDC_COMPRESS_ARCHIVE));
|
||||
m_Format.Attach(GetItem(IDC_COMPRESS_FORMAT));
|
||||
@@ -1308,11 +1309,13 @@ bool CCompressDialog::IsXzFormat()
|
||||
void CCompressDialog::SetEncryptionMethod()
|
||||
{
|
||||
_encryptionMethod.ResetContent();
|
||||
_default_encryptionMethod_Index = -1;
|
||||
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
|
||||
if (ai.Name.IsEqualTo_Ascii_NoCase("7z"))
|
||||
{
|
||||
ComboBox_AddStringAscii(_encryptionMethod, "AES-256");
|
||||
_encryptionMethod.SetCurSel(0);
|
||||
_default_encryptionMethod_Index = 0;
|
||||
}
|
||||
else if (ai.Name.IsEqualTo_Ascii_NoCase("zip"))
|
||||
{
|
||||
@@ -1323,9 +1326,15 @@ void CCompressDialog::SetEncryptionMethod()
|
||||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
|
||||
encryptionMethod = fo.EncryptionMethod;
|
||||
}
|
||||
ComboBox_AddStringAscii(_encryptionMethod, "ZipCrypto");
|
||||
int sel = 0;
|
||||
// if (ZipCryptoIsAllowed)
|
||||
{
|
||||
ComboBox_AddStringAscii(_encryptionMethod, "ZipCrypto");
|
||||
sel = (encryptionMethod.IsPrefixedBy_Ascii_NoCase("aes") ? 1 : 0);
|
||||
_default_encryptionMethod_Index = 0;
|
||||
}
|
||||
ComboBox_AddStringAscii(_encryptionMethod, "AES-256");
|
||||
_encryptionMethod.SetCurSel(encryptionMethod.IsPrefixedBy_Ascii_NoCase("aes") ? 1 : 0);
|
||||
_encryptionMethod.SetCurSel(sel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1347,8 +1356,8 @@ UString CCompressDialog::GetMethodSpec()
|
||||
UString CCompressDialog::GetEncryptionMethodSpec()
|
||||
{
|
||||
UString s;
|
||||
if (_encryptionMethod.GetCount() > 1
|
||||
&& _encryptionMethod.GetCurSel() > 0)
|
||||
if (_encryptionMethod.GetCount() > 0
|
||||
&& _encryptionMethod.GetCurSel() != _default_encryptionMethod_Index)
|
||||
{
|
||||
_encryptionMethod.GetText(s);
|
||||
s.RemoveChar(L'-');
|
||||
@@ -1421,46 +1430,45 @@ void CCompressDialog::SetDictionary()
|
||||
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
|
||||
int index = FindRegistryFormat(ai.Name);
|
||||
UInt32 defaultDict = (UInt32)(Int32)-1;
|
||||
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
|
||||
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()))
|
||||
defaultDict = fo.Dictionary;
|
||||
}
|
||||
|
||||
|
||||
int methodID = GetMethodID();
|
||||
UInt32 level = GetLevel2();
|
||||
if (methodID < 0)
|
||||
return;
|
||||
UInt64 maxRamSize;
|
||||
bool maxRamSize_Defined = GetMaxRamSizeForProgram(maxRamSize);
|
||||
|
||||
|
||||
switch (methodID)
|
||||
{
|
||||
case kLZMA:
|
||||
case kLZMA2:
|
||||
{
|
||||
static const UInt32 kMinDicSize = (1 << 16);
|
||||
if (defaultDict == (UInt32)(Int32)-1)
|
||||
{
|
||||
if (level >= 9) defaultDict = (1 << 26);
|
||||
else if (level >= 7) defaultDict = (1 << 25);
|
||||
else if (level >= 5) defaultDict = (1 << 24);
|
||||
else if (level >= 3) defaultDict = (1 << 20);
|
||||
else defaultDict = (kMinDicSize);
|
||||
defaultDict =
|
||||
( level <= 3 ? (1 << (level * 2 + 16)) :
|
||||
( level <= 6 ? (1 << (level + 19)) :
|
||||
( level <= 7 ? (1 << 25) : (1 << 26)
|
||||
)));
|
||||
}
|
||||
|
||||
AddDictionarySize(kMinDicSize);
|
||||
m_Dictionary.SetCurSel(0);
|
||||
|
||||
AddDictionarySize(1 << 16);
|
||||
AddDictionarySize(1 << 18);
|
||||
m_Dictionary.SetCurSel(m_Dictionary.GetCount() - 1);
|
||||
|
||||
for (unsigned i = 20; i <= 31; i++)
|
||||
for (unsigned j = 0; j < 2; j++)
|
||||
{
|
||||
if (i == 20 && j > 0)
|
||||
continue;
|
||||
UInt32 dict = ((UInt32)(2 + j) << (i - 1));
|
||||
|
||||
|
||||
if (dict >
|
||||
#ifdef MY_CPU_64BIT
|
||||
(3 << 29)
|
||||
@@ -1469,7 +1477,7 @@ void CCompressDialog::SetDictionary()
|
||||
#endif
|
||||
)
|
||||
continue;
|
||||
|
||||
|
||||
AddDictionarySize(dict);
|
||||
UInt64 decomprSize;
|
||||
UInt64 requiredComprSize = GetMemoryUsage(dict, decomprSize);
|
||||
@@ -1513,15 +1521,12 @@ void CCompressDialog::SetDictionary()
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case kPPMd:
|
||||
{
|
||||
if (defaultDict == (UInt32)(Int32)-1)
|
||||
{
|
||||
if (level >= 9) defaultDict = (192 << 20);
|
||||
else if (level >= 7) defaultDict = ( 64 << 20);
|
||||
else if (level >= 5) defaultDict = ( 16 << 20);
|
||||
else defaultDict = ( 4 << 20);
|
||||
defaultDict = (UInt32)1 << (level + 19);
|
||||
}
|
||||
|
||||
for (unsigned i = 20; i < 31; i++)
|
||||
@@ -1545,7 +1550,7 @@ void CCompressDialog::SetDictionary()
|
||||
|| m_Dictionary.GetCount() == 1)
|
||||
m_Dictionary.SetCurSel(m_Dictionary.GetCount() - 1);
|
||||
}
|
||||
|
||||
|
||||
// SetNearestSelectComboBox(m_Dictionary, defaultDict);
|
||||
break;
|
||||
}
|
||||
@@ -1556,14 +1561,14 @@ void CCompressDialog::SetDictionary()
|
||||
m_Dictionary.SetCurSel(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case kDeflate64:
|
||||
{
|
||||
AddDictionarySize(64 << 10);
|
||||
m_Dictionary.SetCurSel(0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case kBZip2:
|
||||
{
|
||||
if (defaultDict == (UInt32)(Int32)-1)
|
||||
@@ -1572,7 +1577,7 @@ void CCompressDialog::SetDictionary()
|
||||
else if (level >= 3) defaultDict = (500 << 10);
|
||||
else defaultDict = (100 << 10);
|
||||
}
|
||||
|
||||
|
||||
for (unsigned i = 1; i <= 9; i++)
|
||||
{
|
||||
UInt32 dict = ((UInt32)i * 100) << 10;
|
||||
@@ -1580,15 +1585,15 @@ void CCompressDialog::SetDictionary()
|
||||
if (dict <= defaultDict || m_Dictionary.GetCount() == 0)
|
||||
m_Dictionary.SetCurSel(m_Dictionary.GetCount() - 1);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case kPPMdZip:
|
||||
{
|
||||
if (defaultDict == (UInt32)(Int32)-1)
|
||||
defaultDict = (1 << (19 + (level > 8 ? 8 : level)));
|
||||
|
||||
defaultDict = (UInt32)1 << (level + 19);
|
||||
|
||||
for (unsigned i = 20; i <= 28; i++)
|
||||
{
|
||||
UInt32 dict = (1 << i);
|
||||
@@ -1599,11 +1604,10 @@ void CCompressDialog::SetDictionary()
|
||||
|| m_Dictionary.GetCount() == 1)
|
||||
m_Dictionary.SetCurSel(m_Dictionary.GetCount() - 1);
|
||||
}
|
||||
|
||||
|
||||
// SetNearestSelectComboBox(m_Dictionary, defaultDict);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1750,6 +1754,21 @@ bool CCompressDialog::GetOrderMode()
|
||||
}
|
||||
|
||||
|
||||
static UInt64 Get_Lzma2_ChunkSize(UInt32 dict)
|
||||
{
|
||||
// we use same default chunk sizes as defined in 7z encoder and lzma2 encoder
|
||||
UInt64 cs = (UInt64)dict << 2;
|
||||
const UInt32 kMinSize = (UInt32)1 << 20;
|
||||
const UInt32 kMaxSize = (UInt32)1 << 28;
|
||||
if (cs < kMinSize) cs = kMinSize;
|
||||
if (cs > kMaxSize) cs = kMaxSize;
|
||||
if (cs < dict) cs = dict;
|
||||
cs += (kMinSize - 1);
|
||||
cs &= ~(UInt64)(kMinSize - 1);
|
||||
return cs;
|
||||
}
|
||||
|
||||
|
||||
void CCompressDialog::SetSolidBlockSize(bool useDictionary)
|
||||
{
|
||||
m_Solid.ResetContent();
|
||||
@@ -1794,25 +1813,27 @@ void CCompressDialog::SetSolidBlockSize(bool useDictionary)
|
||||
m_Solid.SetCurSel(0);
|
||||
}
|
||||
|
||||
UInt64 blockSize;
|
||||
const UInt64 cs = Get_Lzma2_ChunkSize(dict);
|
||||
|
||||
// Solid Block Size
|
||||
UInt64 blockSize = cs; // for xz
|
||||
|
||||
if (is7z)
|
||||
{
|
||||
blockSize = (UInt64)dict << 7;
|
||||
// we use same default block sizes as defined in 7z encoder
|
||||
UInt64 kMaxSize = (UInt64)1 << 32;
|
||||
if (GetMethodID() == kLZMA2)
|
||||
{
|
||||
blockSize = cs << 6;
|
||||
kMaxSize = (UInt64)1 << 34;
|
||||
}
|
||||
else
|
||||
blockSize = (UInt64)dict << 7;
|
||||
|
||||
const UInt32 kMinSize = (UInt32)1 << 24;
|
||||
const UInt64 kMaxSize = (UInt64)1 << 32;
|
||||
if (blockSize < kMinSize) blockSize = kMinSize;
|
||||
if (blockSize > kMaxSize) blockSize = kMaxSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
blockSize = (UInt64)dict << 2;
|
||||
const UInt32 kMinSize = (UInt32)1 << 20;
|
||||
const UInt32 kMaxSize = (UInt32)1 << 28;
|
||||
if (blockSize < kMinSize) blockSize = kMinSize;
|
||||
if (blockSize > kMaxSize) blockSize = kMaxSize;
|
||||
if (blockSize < dict) blockSize = dict;
|
||||
}
|
||||
|
||||
for (unsigned i = 20; i <= 36; i++)
|
||||
{
|
||||
@@ -1854,6 +1875,8 @@ void CCompressDialog::SetNumThreads()
|
||||
return;
|
||||
|
||||
UInt32 numHardwareThreads = NSystem::GetNumberOfProcessors();
|
||||
// numHardwareThreads = 64;
|
||||
|
||||
UInt32 defaultValue = numHardwareThreads;
|
||||
|
||||
{
|
||||
@@ -1880,7 +1903,7 @@ void CCompressDialog::SetNumThreads()
|
||||
case kLIZARD_M3: numAlgoThreadsMax = 128; break;
|
||||
case kLIZARD_M4: numAlgoThreadsMax = 128; break;
|
||||
case kLZMA: numAlgoThreadsMax = 2; break;
|
||||
case kLZMA2: numAlgoThreadsMax = 32; break;
|
||||
case kLZMA2: numAlgoThreadsMax = 256; break;
|
||||
case kFLZMA2: numAlgoThreadsMax = 128; break;
|
||||
case kBZip2: numAlgoThreadsMax = 32; break;
|
||||
}
|
||||
@@ -1935,9 +1958,12 @@ UInt64 CCompressDialog::GetMemoryUsage(UInt32 dict, UInt64 &decompressMemory)
|
||||
hs |= (hs >> 4);
|
||||
hs |= (hs >> 8);
|
||||
hs >>= 1;
|
||||
hs |= 0xFFFF;
|
||||
if (hs > (1 << 24))
|
||||
if (hs >= (1 << 24))
|
||||
hs >>= 1;
|
||||
hs |= (1 << 16) - 1;
|
||||
// if (numHashBytes >= 5)
|
||||
if (level < 5)
|
||||
hs |= (256 << 10) - 1;
|
||||
hs++;
|
||||
UInt64 size1 = (UInt64)hs * 4;
|
||||
size1 += (UInt64)dict * 4;
|
||||
@@ -1958,10 +1984,7 @@ UInt64 CCompressDialog::GetMemoryUsage(UInt32 dict, UInt64 &decompressMemory)
|
||||
|
||||
if (methidId != kLZMA && numBlockThreads != 1)
|
||||
{
|
||||
chunkSize = (UInt64)dict << 2;
|
||||
chunkSize = MyMax(chunkSize, (UInt64)(1 << 20));
|
||||
chunkSize = MyMin(chunkSize, (UInt64)(1 << 28));
|
||||
chunkSize = MyMax(chunkSize, (UInt64)dict);
|
||||
chunkSize = Get_Lzma2_ChunkSize(dict);
|
||||
|
||||
if (IsXzFormat())
|
||||
{
|
||||
@@ -2067,10 +2090,19 @@ void CCompressDialog::PrintMemUsage(UINT res, UInt64 value)
|
||||
SetItemText(res, TEXT("?"));
|
||||
return;
|
||||
}
|
||||
value = (value + (1 << 20) - 1) >> 20;
|
||||
TCHAR s[40];
|
||||
ConvertUInt64ToString(value, s);
|
||||
lstrcat(s, TEXT(" MB"));
|
||||
if (value <= ((UInt64)16 << 30))
|
||||
{
|
||||
value = (value + (1 << 20) - 1) >> 20;
|
||||
ConvertUInt64ToString(value, s);
|
||||
lstrcat(s, TEXT(" MB"));
|
||||
}
|
||||
else
|
||||
{
|
||||
value = (value + (1 << 30) - 1) >> 30;
|
||||
ConvertUInt64ToString(value, s);
|
||||
lstrcat(s, TEXT(" GB"));
|
||||
}
|
||||
SetItemText(res, s);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ class CCompressDialog: public NWindows::NControl::CModalDialog
|
||||
NWindows::NControl::CEdit _password1Control;
|
||||
NWindows::NControl::CEdit _password2Control;
|
||||
NWindows::NControl::CComboBox _encryptionMethod;
|
||||
int _default_encryptionMethod_Index;
|
||||
|
||||
NCompression::CInfo m_RegistryInfo;
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ BEGIN
|
||||
IDS_MEM_ERROR "The system cannot allocate the required amount of memory"
|
||||
IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
|
||||
IDS_UPDATE_NOT_SUPPORTED "Update operations are not supported for this archive."
|
||||
IDS_CANT_OPEN_ARCHIVE "Can not open file '{0}' as archive"
|
||||
IDS_CANT_OPEN_ENCRYPTED_ARCHIVE "Can not open encrypted archive '{0}'. Wrong password?"
|
||||
IDS_CANT_OPEN_ARCHIVE "Cannot open file '{0}' as archive"
|
||||
IDS_CANT_OPEN_ENCRYPTED_ARCHIVE "Cannot open encrypted archive '{0}'. Wrong password?"
|
||||
IDS_UNSUPPORTED_ARCHIVE_TYPE "Unsupported archive type"
|
||||
|
||||
IDS_CANT_OPEN_AS_TYPE "Can not open the file as {0} archive"
|
||||
IDS_CANT_OPEN_AS_TYPE "Cannot open the file as {0} archive"
|
||||
IDS_IS_OPEN_AS_TYPE "The file is open as {0} archive"
|
||||
IDS_IS_OPEN_WITH_OFFSET "The archive is open with offset"
|
||||
|
||||
@@ -45,7 +45,7 @@ BEGIN
|
||||
IDS_EXTRACT_MSG_DATA_ERROR "Data error"
|
||||
IDS_EXTRACT_MSG_CRC_ERROR "CRC failed"
|
||||
IDS_EXTRACT_MSG_UNAVAILABLE_DATA "Unavailable data"
|
||||
IDS_EXTRACT_MSG_UEXPECTED_END "Unexpected end of data";
|
||||
IDS_EXTRACT_MSG_UEXPECTED_END "Unexpected end of data"
|
||||
IDS_EXTRACT_MSG_DATA_AFTER_END "There are some data after the end of the payload data"
|
||||
IDS_EXTRACT_MSG_IS_NOT_ARC "Is not archive"
|
||||
IDS_EXTRACT_MSG_HEADERS_ERROR "Headers Error"
|
||||
|
||||
@@ -28,6 +28,8 @@ using namespace NName;
|
||||
|
||||
extern HINSTANCE g_hInstance;
|
||||
|
||||
#ifndef _SFX
|
||||
|
||||
static const UInt32 kPathMode_IDs[] =
|
||||
{
|
||||
IDS_EXTRACT_PATHS_FULL,
|
||||
@@ -44,8 +46,6 @@ static const UInt32 kOverwriteMode_IDs[] =
|
||||
IDS_EXTRACT_OVERWRITE_RENAME_EXISTING
|
||||
};
|
||||
|
||||
#ifndef _SFX
|
||||
|
||||
static const
|
||||
// NExtract::NPathMode::EEnum
|
||||
int
|
||||
@@ -94,6 +94,7 @@ static const unsigned kHistorySize = 16;
|
||||
#ifndef _SFX
|
||||
|
||||
// it's used in CompressDialog also
|
||||
void AddComboItems(NControl::CComboBox &combo, const UInt32 *langIDs, unsigned numItems, const int *values, int curVal);
|
||||
void AddComboItems(NControl::CComboBox &combo, const UInt32 *langIDs, unsigned numItems, const int *values, int curVal)
|
||||
{
|
||||
int curSel = 0;
|
||||
@@ -110,6 +111,7 @@ void AddComboItems(NControl::CComboBox &combo, const UInt32 *langIDs, unsigned n
|
||||
}
|
||||
|
||||
// it's used in CompressDialog also
|
||||
bool GetBoolsVal(const CBoolPair &b1, const CBoolPair &b2);
|
||||
bool GetBoolsVal(const CBoolPair &b1, const CBoolPair &b2)
|
||||
{
|
||||
if (b1.Def) return b1.Val;
|
||||
@@ -286,6 +288,7 @@ void CExtractDialog::OnButtonSetPath()
|
||||
_path.SetText(resultPath);
|
||||
}
|
||||
|
||||
void AddUniqueString(UStringVector &list, const UString &s);
|
||||
void AddUniqueString(UStringVector &list, const UString &s)
|
||||
{
|
||||
FOR_VECTOR (i, list)
|
||||
@@ -357,7 +360,7 @@ void CExtractDialog::OnOK()
|
||||
if (currentItem == CB_ERR)
|
||||
{
|
||||
_path.GetText(s);
|
||||
if (_path.GetCount() >= kHistorySize)
|
||||
if (_path.GetCount() >= (int)kHistorySize)
|
||||
currentItem = _path.GetCount() - 1;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include "../../../Common/MyWindows.h"
|
||||
|
||||
#include <shlwapi.h>
|
||||
#include <Shlwapi.h>
|
||||
|
||||
#include "../../../Common/MyInitGuid.h"
|
||||
|
||||
@@ -34,10 +34,14 @@
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
extern
|
||||
HINSTANCE g_hInstance;
|
||||
HINSTANCE g_hInstance;
|
||||
|
||||
#ifndef UNDER_CE
|
||||
|
||||
extern
|
||||
DWORD g_ComCtl32Version;
|
||||
DWORD g_ComCtl32Version;
|
||||
|
||||
static DWORD GetDllVersion(LPCTSTR dllName)
|
||||
@@ -46,7 +50,7 @@ static DWORD GetDllVersion(LPCTSTR dllName)
|
||||
HINSTANCE hinstDll = LoadLibrary(dllName);
|
||||
if (hinstDll)
|
||||
{
|
||||
DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
|
||||
DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)(void *)GetProcAddress(hinstDll, "DllGetVersion");
|
||||
if (pDllGetVersion)
|
||||
{
|
||||
DLLVERSIONINFO dvi;
|
||||
@@ -63,6 +67,8 @@ static DWORD GetDllVersion(LPCTSTR dllName)
|
||||
|
||||
#endif
|
||||
|
||||
extern
|
||||
bool g_LVN_ITEMACTIVATE_Support;
|
||||
bool g_LVN_ITEMACTIVATE_Support = true;
|
||||
|
||||
static void ErrorMessage(LPCWSTR message)
|
||||
@@ -90,7 +96,7 @@ static int ShowMemErrorMessage()
|
||||
|
||||
static int ShowSysErrorMessage(DWORD errorCode)
|
||||
{
|
||||
if (errorCode == E_OUTOFMEMORY)
|
||||
if ((HRESULT)errorCode == E_OUTOFMEMORY)
|
||||
return ShowMemErrorMessage();
|
||||
ErrorMessage(HResultToMessage(errorCode));
|
||||
return NExitCode::kFatalError;
|
||||
@@ -128,7 +134,17 @@ static int Main2()
|
||||
codecs->CaseSensitiveChange = options.CaseSensitiveChange;
|
||||
codecs->CaseSensitive = options.CaseSensitive;
|
||||
ThrowException_if_Error(codecs->Load());
|
||||
|
||||
|
||||
#ifdef EXTERNAL_CODECS
|
||||
{
|
||||
UString s;
|
||||
codecs->GetCodecsErrorMessage(s);
|
||||
if (!s.IsEmpty())
|
||||
MessageBoxW(0, s, L"7-Zip", MB_ICONERROR);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool isExtractGroupCommand = options.Command.IsFromExtractGroup();
|
||||
|
||||
if (codecs->Formats.Size() == 0 &&
|
||||
@@ -343,7 +359,9 @@ static int Main2()
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(_UNICODE) && !defined(_WIN64) && !defined(UNDER_CE)
|
||||
#define NT_CHECK_FAIL_ACTION ErrorMessage("Unsupported Windows version"); return NExitCode::kFatalError;
|
||||
#endif
|
||||
|
||||
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
|
||||
#ifdef UNDER_CE
|
||||
|
||||
@@ -55,7 +55,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Program Files\7-Zip\7zg.exe" /opt:NOWIN98
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zg.exe" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "GUI - Win32 Debug"
|
||||
@@ -82,7 +82,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Program Files\7-Zip\7zg.exe" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Util\7zg.exe" /pdbtype:sept
|
||||
|
||||
!ELSEIF "$(CFG)" == "GUI - Win32 ReleaseU"
|
||||
|
||||
@@ -109,7 +109,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\UTIL\7zg.exe"
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Program Files\7-Zip\7zgn.exe" /opt:NOWIN98
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zg.exe" /opt:NOWIN98
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ELSEIF "$(CFG)" == "GUI - Win32 DebugU"
|
||||
@@ -137,7 +137,7 @@ BSC32=bscmake.exe
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\UTIL\7zg.exe" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Program Files\7-Zip\7zgn.exe" /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib htmlhelp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Util\7zg.exe" /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
@@ -1156,6 +1156,14 @@ SOURCE=..\..\..\Windows\System.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\SystemInfo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\SystemInfo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\Windows\TimeUtils.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
// #include "../../../Common/MyWindows.h"
|
||||
|
||||
// #include <commctrl.h>
|
||||
// #include <CommCtrl.h>
|
||||
// #include <ShlObj.h>
|
||||
// #include <shlwapi.h>
|
||||
// #include <Shlwapi.h>
|
||||
|
||||
// #define printf(x) NO_PRINTF_(x)
|
||||
// #define sprintf(x) NO_SPRINTF_(x)
|
||||
|
||||
@@ -56,9 +56,9 @@ HRESULT CThreadUpdating::ProcessVirt()
|
||||
ei, UpdateCallbackGUI, UpdateCallbackGUI, needSetPath);
|
||||
FinalMessage.ErrorMessage.Message = ei.Message.Ptr();
|
||||
ErrorPaths = ei.FileNames;
|
||||
if (ei.SystemError != S_OK && ei.SystemError != E_FAIL && ei.SystemError != E_ABORT)
|
||||
return ei.SystemError;
|
||||
return res;
|
||||
if (res != S_OK)
|
||||
return res;
|
||||
return HRESULT_FROM_WIN32(ei.SystemError);
|
||||
}
|
||||
|
||||
static void AddProp(CObjectVector<CProperty> &properties, const char *name, const UString &value)
|
||||
|
||||
@@ -55,6 +55,7 @@ WIN_OBJS = \
|
||||
$O\Shell.obj \
|
||||
$O\Synchronization.obj \
|
||||
$O\System.obj \
|
||||
$O\SystemInfo.obj \
|
||||
$O\TimeUtils.obj \
|
||||
$O\Window.obj \
|
||||
|
||||
|
||||
Reference in New Issue
Block a user