mirror of
https://github.com/aaru-dps/Aaru.Compression.Native.git
synced 2025-12-16 19:24:31 +00:00
Update to lzma 23.01.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#include "../../../Windows/ErrorMsg.h"
|
||||
#include "../../../Windows/PropVariantConv.h"
|
||||
|
||||
#ifndef _7ZIP_ST
|
||||
#ifndef Z7_ST
|
||||
#include "../../../Windows/Synchronization.h"
|
||||
#endif
|
||||
|
||||
@@ -56,6 +56,9 @@ HRESULT CExtractScanConsole::ScanProgress(const CDirItemsStat &st, const FString
|
||||
|
||||
HRESULT CExtractScanConsole::ScanError(const FString &path, DWORD systemError)
|
||||
{
|
||||
// 22.00:
|
||||
// ScanErrors.AddError(path, systemError);
|
||||
|
||||
ClosePercentsAndFlush();
|
||||
|
||||
if (_se)
|
||||
@@ -66,6 +69,10 @@ HRESULT CExtractScanConsole::ScanError(const FString &path, DWORD systemError)
|
||||
_se->Flush();
|
||||
}
|
||||
return HRESULT_FROM_WIN32(systemError);
|
||||
|
||||
// 22.00: commented
|
||||
// CommonError(path, systemError, true);
|
||||
// return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -176,7 +183,7 @@ void CExtractScanConsole::PrintStat(const CDirItemsStat &st)
|
||||
|
||||
|
||||
|
||||
#ifndef _7ZIP_ST
|
||||
#ifndef Z7_ST
|
||||
static NSynchronization::CCriticalSection g_CriticalSection;
|
||||
#define MT_LOCK NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
|
||||
#else
|
||||
@@ -187,6 +194,7 @@ static NSynchronization::CCriticalSection g_CriticalSection;
|
||||
static const char * const kTestString = "T";
|
||||
static const char * const kExtractString = "-";
|
||||
static const char * const kSkipString = ".";
|
||||
static const char * const kReadString = "H";
|
||||
|
||||
// static const char * const kCantAutoRename = "cannot create file with auto name\n";
|
||||
// static const char * const kCantRenameFile = "cannot rename existing file\n";
|
||||
@@ -227,7 +235,7 @@ static const char * const k_ErrorFlagsMessages[] =
|
||||
, "CRC Error"
|
||||
};
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::SetTotal(UInt64 size)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::SetTotal(UInt64 size))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -239,7 +247,7 @@ STDMETHODIMP CExtractCallbackConsole::SetTotal(UInt64 size)
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::SetCompleted(const UInt64 *completeValue)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::SetCompleted(const UInt64 *completeValue))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -273,14 +281,14 @@ static void PrintFileInfo(CStdOutStream *_so, const wchar_t *path, const FILETIM
|
||||
}
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::AskOverwrite(
|
||||
const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
|
||||
const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
|
||||
Int32 *answer)
|
||||
Int32 *answer))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
RINOK(CheckBreak2());
|
||||
RINOK(CheckBreak2())
|
||||
|
||||
ClosePercentsAndFlush();
|
||||
|
||||
@@ -294,7 +302,7 @@ STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
|
||||
|
||||
NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(_so);
|
||||
|
||||
switch (overwriteAnswer)
|
||||
switch ((int)overwriteAnswer)
|
||||
{
|
||||
case NUserAnswerMode::kQuit: return E_ABORT;
|
||||
case NUserAnswerMode::kNo: *answer = NOverwriteAnswer::kNo; break;
|
||||
@@ -317,7 +325,7 @@ STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 /* isFolder */, Int32 askExtractMode, const UInt64 *position)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 isFolder, Int32 askExtractMode, const UInt64 *position))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -331,8 +339,9 @@ STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int3
|
||||
case NArchive::NExtract::NAskMode::kExtract: s = kExtractString; break;
|
||||
case NArchive::NExtract::NAskMode::kTest: s = kTestString; break;
|
||||
case NArchive::NExtract::NAskMode::kSkip: s = kSkipString; requiredLevel = 2; break;
|
||||
case NArchive::NExtract::NAskMode::kReadExternal: s = kReadString; requiredLevel = 0; break;
|
||||
default: s = "???"; requiredLevel = 2;
|
||||
};
|
||||
}
|
||||
|
||||
bool show2 = (LogLevel >= requiredLevel && _so);
|
||||
|
||||
@@ -350,6 +359,12 @@ STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int3
|
||||
{
|
||||
_tempU = name;
|
||||
_so->Normalize_UString(_tempU);
|
||||
// 21.04
|
||||
if (isFolder)
|
||||
{
|
||||
if (!_tempU.IsEmpty() && _tempU.Back() != WCHAR_PATH_SEPARATOR)
|
||||
_tempU.Add_PathSepar();
|
||||
}
|
||||
}
|
||||
_so->PrintUString(_tempU, _tempA);
|
||||
if (position)
|
||||
@@ -379,11 +394,11 @@ STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int3
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::MessageError(const wchar_t *message)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::MessageError(const wchar_t *message))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
RINOK(CheckBreak2());
|
||||
RINOK(CheckBreak2())
|
||||
|
||||
NumFileErrors_in_Current++;
|
||||
NumFileErrors++;
|
||||
@@ -445,7 +460,7 @@ void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, AString &dest)
|
||||
}
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::SetOperationResult(Int32 opRes, Int32 encrypted)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::SetOperationResult(Int32 opRes, Int32 encrypted))
|
||||
{
|
||||
MT_LOCK
|
||||
|
||||
@@ -484,7 +499,7 @@ STDMETHODIMP CExtractCallbackConsole::SetOperationResult(Int32 opRes, Int32 encr
|
||||
return CheckBreak2();
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::ReportExtractResult(Int32 opRes, Int32 encrypted, const wchar_t *name)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::ReportExtractResult(Int32 opRes, Int32 encrypted, const wchar_t *name))
|
||||
{
|
||||
if (opRes != NArchive::NExtract::NOperationResult::kOK)
|
||||
{
|
||||
@@ -497,7 +512,7 @@ STDMETHODIMP CExtractCallbackConsole::ReportExtractResult(Int32 opRes, Int32 enc
|
||||
|
||||
|
||||
|
||||
#ifndef _NO_CRYPTO
|
||||
#ifndef Z7_NO_CRYPTO
|
||||
|
||||
HRESULT CExtractCallbackConsole::SetPassword(const UString &password)
|
||||
{
|
||||
@@ -506,7 +521,7 @@ HRESULT CExtractCallbackConsole::SetPassword(const UString &password)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
STDMETHODIMP CExtractCallbackConsole::CryptoGetTextPassword(BSTR *password)
|
||||
Z7_COM7F_IMF(CExtractCallbackConsole::CryptoGetTextPassword(BSTR *password))
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
MT_LOCK
|
||||
@@ -518,7 +533,7 @@ STDMETHODIMP CExtractCallbackConsole::CryptoGetTextPassword(BSTR *password)
|
||||
|
||||
HRESULT CExtractCallbackConsole::BeforeOpen(const wchar_t *name, bool testMode)
|
||||
{
|
||||
RINOK(CheckBreak2());
|
||||
RINOK(CheckBreak2())
|
||||
|
||||
NumTryArcs++;
|
||||
ThereIsError_in_Current = false;
|
||||
@@ -545,7 +560,7 @@ static AString GetOpenArcErrorMessage(UInt32 errorFlags)
|
||||
{
|
||||
AString s;
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(k_ErrorFlagsMessages); i++)
|
||||
for (unsigned i = 0; i < Z7_ARRAY_SIZE(k_ErrorFlagsMessages); i++)
|
||||
{
|
||||
UInt32 f = (1 << i);
|
||||
if ((errorFlags & f) == 0)
|
||||
@@ -724,7 +739,7 @@ HRESULT CExtractCallbackConsole::OpenResult(
|
||||
{
|
||||
if (_so)
|
||||
{
|
||||
RINOK(Print_OpenArchive_Props(*_so, codecs, arcLink));
|
||||
RINOK(Print_OpenArchive_Props(*_so, codecs, arcLink))
|
||||
*_so << endl;
|
||||
}
|
||||
}
|
||||
@@ -738,8 +753,8 @@ HRESULT CExtractCallbackConsole::OpenResult(
|
||||
*_se << kError;
|
||||
_se->NormalizePrint_wstr(name);
|
||||
*_se << endl;
|
||||
HRESULT res = Print_OpenArchive_Error(*_se, codecs, arcLink);
|
||||
RINOK(res);
|
||||
const HRESULT res = Print_OpenArchive_Error(*_se, codecs, arcLink);
|
||||
RINOK(res)
|
||||
if (result == S_FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user