mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 07:14:56 -06:00
9.38
This commit is contained in:
committed by
Kornel Lesiński
parent
7e021179cd
commit
0713a3ab80
@@ -236,8 +236,8 @@ static const int kCommandIndex = 0;
|
||||
// static const char *kUserErrorMessage = "Incorrect command line";
|
||||
static const char *kCannotFindListFile = "Cannot find listfile";
|
||||
static const char *kIncorrectListFile = "Incorrect item in listfile.\nCheck charset encoding and -scs switch.";
|
||||
static const char *kIncorrectWildcardInListFile = "Incorrect wildcard in listfile";
|
||||
static const char *kIncorrectWildcardInCommandLine = "Incorrect wildcard in command line";
|
||||
// static const char *kIncorrectWildcardInListFile = "Incorrect wildcard in listfile";
|
||||
// static const char *kIncorrectWildcardInCommandLine = "Incorrect wildcard in command line";
|
||||
static const char *kTerminalOutError = "I won't write compressed data to a terminal";
|
||||
static const char *kSameTerminalError = "I won't write data and program's messages to same terminal";
|
||||
static const char *kEmptyFilePath = "Empty file path";
|
||||
|
||||
@@ -370,7 +370,7 @@ STDMETHODIMP CGetProp::GetProp(PROPID propID, PROPVARIANT *value)
|
||||
if (propID == kpidName)
|
||||
{
|
||||
COM_TRY_BEGIN
|
||||
NCOM::CPropVariant prop = Name;
|
||||
NCOM::CPropVariant prop = Name.Ptr();
|
||||
prop.Detach(value);
|
||||
return S_OK;
|
||||
COM_TRY_END
|
||||
@@ -1059,7 +1059,7 @@ STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 operationResult)
|
||||
SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
|
||||
if (_saclEnabled)
|
||||
securInfo |= SACL_SECURITY_INFORMATION;
|
||||
::SetFileSecurityW(fs2us(_diskFilePath), securInfo, (void *)data);
|
||||
::SetFileSecurityW(fs2us(_diskFilePath), securInfo, (PSECURITY_DESCRIPTOR)(void *)data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1316,9 +1316,8 @@ UInt32 g_BenchCpuFreqTemp = 1;
|
||||
#define YY7 YY5 YY5 YY5 YY5
|
||||
static const UInt32 kNumFreqCommands = 128;
|
||||
|
||||
static UInt32 CountCpuFreq(UInt32 num, UInt32 val)
|
||||
static UInt32 CountCpuFreq(UInt32 sum, UInt32 num, UInt32 val)
|
||||
{
|
||||
UInt32 sum = 0;
|
||||
for (UInt32 i = 0; i < num; i++)
|
||||
{
|
||||
YY7
|
||||
@@ -1354,7 +1353,7 @@ static THREAD_FUNC_DECL FreqThreadFunction(void *param)
|
||||
p->CallbackRes = p->Callback->CheckBreak();
|
||||
if (p->CallbackRes != S_OK)
|
||||
return 0;
|
||||
sum = CountCpuFreq(p->Size, sum);
|
||||
sum = CountCpuFreq(sum, p->Size, g_BenchCpuFreqTemp);
|
||||
}
|
||||
p->ValRes = sum;
|
||||
return 0;
|
||||
@@ -1653,7 +1652,7 @@ static void PrintRequirements(IBenchPrintCallback &f, const char *sizeString, UI
|
||||
{
|
||||
f.Print("RAM ");
|
||||
f.Print(sizeString);
|
||||
PrintNumber(f, (size >> 20), 5);
|
||||
PrintNumber(f, (size >> 20), 6);
|
||||
f.Print(" MB, # ");
|
||||
f.Print(threadsString);
|
||||
PrintNumber(f, numThreads, 3);
|
||||
@@ -1858,7 +1857,7 @@ static HRESULT FreqBench(
|
||||
for (UInt64 k = numIterations; k > 0; k--)
|
||||
{
|
||||
RINOK(_file->CheckBreak());
|
||||
sum = CountCpuFreq(bufferSize, sum);
|
||||
sum = CountCpuFreq(sum, bufferSize, g_BenchCpuFreqTemp);
|
||||
}
|
||||
res += sum;
|
||||
}
|
||||
@@ -2164,17 +2163,17 @@ HRESULT Bench(
|
||||
{
|
||||
UInt64 start = ::GetTimeCount();
|
||||
UInt32 sum = (UInt32)start;
|
||||
sum += CountCpuFreq((UInt32)(numMilCommands * 1000000 / kNumFreqCommands), g_BenchCpuFreqTemp);
|
||||
sum = CountCpuFreq(sum, (UInt32)(numMilCommands * 1000000 / kNumFreqCommands), g_BenchCpuFreqTemp);
|
||||
start = ::GetTimeCount() - start;
|
||||
if (start == 0)
|
||||
start = 1;
|
||||
UInt64 freq = GetFreq();
|
||||
UInt64 mips = numMilCommands * freq / start;
|
||||
UInt64 mipsVal = numMilCommands * freq / start;
|
||||
if (printCallback)
|
||||
PrintNumber(*printCallback, mips, 5 + ((sum >> 31) & 1));
|
||||
PrintNumber(*printCallback, mipsVal, 5 + ((sum >> 31) & 1));
|
||||
if (jj >= 3)
|
||||
{
|
||||
SetComplexCommands(testTime, mips * 1000000, complexInCommands);
|
||||
SetComplexCommands(testTime, mipsVal * 1000000, complexInCommands);
|
||||
if (jj >= 8 || start >= freq)
|
||||
break;
|
||||
// break; // change it
|
||||
|
||||
@@ -124,7 +124,7 @@ void CDirItems::AddSecurityItem(const FString &path, int &secureIndex)
|
||||
|
||||
DWORD errorCode = 0;
|
||||
DWORD secureSize;
|
||||
BOOL res = ::GetFileSecurityW(fs2us(path), securInfo, TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
|
||||
BOOL res = ::GetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(Byte *)TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
|
||||
if (res)
|
||||
{
|
||||
if (secureSize == 0)
|
||||
@@ -142,7 +142,7 @@ void CDirItems::AddSecurityItem(const FString &path, int &secureIndex)
|
||||
else
|
||||
{
|
||||
TempSecureBuf.Alloc(secureSize);
|
||||
res = ::GetFileSecurityW(fs2us(path), securInfo, TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
|
||||
res = ::GetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(Byte *)TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
|
||||
if (res)
|
||||
{
|
||||
if (secureSize != TempSecureBuf.Size())
|
||||
|
||||
@@ -169,7 +169,7 @@ static HRESULT DecompressArchive(
|
||||
}
|
||||
else
|
||||
result = archive->Extract(&realIndices.Front(), realIndices.Size(), testMode, ecs);
|
||||
if (result == S_OK)
|
||||
if (result == S_OK && !options.StdInMode)
|
||||
result = ecs->SetDirsTimes();
|
||||
return callback->ExtractResult(result);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static const unsigned kNumArcsMax = 48;
|
||||
static unsigned g_NumArcs = 0;
|
||||
static const CArcInfo *g_Arcs[kNumArcsMax];
|
||||
|
||||
void RegisterArc(const CArcInfo *arcInfo)
|
||||
void RegisterArc(const CArcInfo *arcInfo) throw()
|
||||
{
|
||||
if (g_NumArcs < kNumArcsMax)
|
||||
{
|
||||
|
||||
@@ -446,7 +446,7 @@ STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
|
||||
|
||||
#endif
|
||||
|
||||
HRESULT Archive_GetItemBoolProp(IInArchive *arc, UInt32 index, PROPID propID, bool &result)
|
||||
HRESULT Archive_GetItemBoolProp(IInArchive *arc, UInt32 index, PROPID propID, bool &result) throw()
|
||||
{
|
||||
NCOM::CPropVariant prop;
|
||||
result = false;
|
||||
@@ -458,22 +458,22 @@ HRESULT Archive_GetItemBoolProp(IInArchive *arc, UInt32 index, PROPID propID, bo
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT Archive_IsItem_Folder(IInArchive *arc, UInt32 index, bool &result)
|
||||
HRESULT Archive_IsItem_Folder(IInArchive *arc, UInt32 index, bool &result) throw()
|
||||
{
|
||||
return Archive_GetItemBoolProp(arc, index, kpidIsDir, result);
|
||||
}
|
||||
|
||||
HRESULT Archive_IsItem_Aux(IInArchive *arc, UInt32 index, bool &result)
|
||||
HRESULT Archive_IsItem_Aux(IInArchive *arc, UInt32 index, bool &result) throw()
|
||||
{
|
||||
return Archive_GetItemBoolProp(arc, index, kpidIsAux, result);
|
||||
}
|
||||
|
||||
HRESULT Archive_IsItem_AltStream(IInArchive *arc, UInt32 index, bool &result)
|
||||
HRESULT Archive_IsItem_AltStream(IInArchive *arc, UInt32 index, bool &result) throw()
|
||||
{
|
||||
return Archive_GetItemBoolProp(arc, index, kpidIsAltStream, result);
|
||||
}
|
||||
|
||||
HRESULT Archive_IsItem_Deleted(IInArchive *arc, UInt32 index, bool &result)
|
||||
HRESULT Archive_IsItem_Deleted(IInArchive *arc, UInt32 index, bool &result) throw()
|
||||
{
|
||||
return Archive_GetItemBoolProp(arc, index, kpidIsDeleted, result);
|
||||
}
|
||||
@@ -590,12 +590,15 @@ HRESULT CArc::GetItemPath(UInt32 index, UString &result) const
|
||||
{
|
||||
wchar_t c = GetUi16(p);
|
||||
p = (const void *)((const Byte *)p + 2);
|
||||
if (c == '/')
|
||||
#if WCHAR_PATH_SEPARATOR != L'/'
|
||||
if (c == L'/')
|
||||
c = WCHAR_PATH_SEPARATOR;
|
||||
#endif
|
||||
*s++ = c;
|
||||
}
|
||||
result.ReleaseBuffer(len);
|
||||
return S_OK;
|
||||
if (len != 0)
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -2633,6 +2636,8 @@ HRESULT CArc::OpenStream(const COpenOptions &op)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#ifdef _SFX
|
||||
|
||||
#ifdef _WIN32
|
||||
static const wchar_t *k_ExeExt = L".exe";
|
||||
static const unsigned k_ExeExt_Len = 4;
|
||||
@@ -2641,6 +2646,8 @@ HRESULT CArc::OpenStream(const COpenOptions &op)
|
||||
static const unsigned k_ExeExt_Len = 0;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
HRESULT CArc::OpenStreamOrFile(COpenOptions &op)
|
||||
{
|
||||
CMyComPtr<IInStream> fileStream;
|
||||
|
||||
@@ -52,7 +52,7 @@ void ConvertWinAttribToString(char *s, UInt32 wa)
|
||||
static const char kPosixTypes[16] = { '0', 'p', 'c', '3', 'd', '5', 'b', '7', '-', '9', 'l', 'B', 's', 'D', 'E', 'F' };
|
||||
#define MY_ATTR_CHAR(a, n, c) ((a) & (1 << (n))) ? c : '-';
|
||||
|
||||
void ConvertPropertyToShortString(char *dest, const PROPVARIANT &prop, PROPID propID, bool full)
|
||||
void ConvertPropertyToShortString(char *dest, const PROPVARIANT &prop, PROPID propID, bool full) throw()
|
||||
{
|
||||
*dest = 0;
|
||||
if (prop.vt == VT_FILETIME)
|
||||
@@ -204,7 +204,7 @@ static const char *sidNames[] =
|
||||
struct CSecID2Name
|
||||
{
|
||||
UInt32 n;
|
||||
char *sz;
|
||||
const char *sz;
|
||||
};
|
||||
|
||||
const CSecID2Name sid_32_Names[] =
|
||||
@@ -255,12 +255,12 @@ static const CSecID2Name sid_21_Names[] =
|
||||
struct CServicesToName
|
||||
{
|
||||
UInt32 n[5];
|
||||
char *sz;
|
||||
const char *sz;
|
||||
};
|
||||
|
||||
static const CServicesToName services_to_name[] =
|
||||
{
|
||||
{ { 956008885, 3418522649, 1831038044, 1853292631, 2271478464 } , "TrustedInstaller" }
|
||||
{ { 0x38FB89B5, 0xCBC28419, 0x6D236C5C, 0x6E770057, 0x876402C0 } , "TrustedInstaller" }
|
||||
};
|
||||
|
||||
static void ParseSid(AString &s, const Byte *p, UInt32 lim, UInt32 &sidSize)
|
||||
|
||||
@@ -1103,10 +1103,12 @@ HRESULT UpdateArchive(
|
||||
CDirItem parentDirItem;
|
||||
CDirItem *parentDirItem_Ptr = NULL;
|
||||
|
||||
/*
|
||||
FStringVector requestedPaths;
|
||||
FStringVector *requestedPaths_Ptr = NULL;
|
||||
if (options.DeleteAfterCompressing)
|
||||
requestedPaths_Ptr = &requestedPaths;
|
||||
*/
|
||||
|
||||
if (options.StdInMode)
|
||||
{
|
||||
@@ -1421,7 +1423,7 @@ HRESULT UpdateArchive(
|
||||
m.lpRecips = &rec;
|
||||
}
|
||||
|
||||
sendMail(NULL, 0, &m, MAPI_DIALOG, 0);
|
||||
sendMail((LHANDLE)0, 0, &m, MAPI_DIALOG, 0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -328,7 +328,6 @@ STDMETHODIMP CArchiveUpdateCallback::GetProperty(UInt32 index, PROPID propID, PR
|
||||
const CDirItem &di = DirItems->Items[up.DirIndex];
|
||||
// if (di.IsDir())
|
||||
{
|
||||
di.ReparseData;
|
||||
CReparseAttr attr;
|
||||
if (attr.Parse(di.ReparseData, di.ReparseData.Size()))
|
||||
{
|
||||
|
||||
@@ -29,7 +29,16 @@ struct CUpdatePair2
|
||||
bool ExistOnDisk() const { return DirIndex != -1; }
|
||||
bool ExistInArchive() const { return ArcIndex != -1; }
|
||||
|
||||
CUpdatePair2(): IsAnti(false), UseArcProps(false), DirIndex(-1), ArcIndex(-1), NewNameIndex(-1) {}
|
||||
CUpdatePair2():
|
||||
NewData(false),
|
||||
NewProps(false),
|
||||
UseArcProps(false),
|
||||
IsAnti(false),
|
||||
DirIndex(-1),
|
||||
ArcIndex(-1),
|
||||
NewNameIndex(-1),
|
||||
IsMainRenameItem(false)
|
||||
{}
|
||||
};
|
||||
|
||||
struct IUpdateProduceCallback
|
||||
|
||||
Reference in New Issue
Block a user