This commit is contained in:
Igor Pavlov
2016-05-20 00:00:00 +00:00
committed by Kornel Lesiński
parent 66ac98bb02
commit bec3b479dc
88 changed files with 972 additions and 753 deletions

View File

@@ -1067,10 +1067,7 @@ STDMETHODIMP CAgentFolder::BindToParentFolder(IFolderFolder **resultFolder)
if (parentIndex < 0)
proxyDirIndex = k_Proxy2_RootDirIndex;
else
{
const CProxyFile2 &file = _proxy2->Files[parentIndex];
proxyDirIndex = file.DirIndex;
}
proxyDirIndex = _proxy2->Files[parentIndex].DirIndex;
}
}
else

View File

@@ -34,10 +34,10 @@ int CProxyArc::FindSubDir(unsigned dirIndex, const wchar_t *name, unsigned &inse
return -1;
}
unsigned mid = (left + right) / 2;
unsigned dirIndex = subDirs[mid];
int compare = CompareFileNames(name, Dirs[dirIndex].Name);
unsigned dirIndex2 = subDirs[mid];
int compare = CompareFileNames(name, Dirs[dirIndex2].Name);
if (compare == 0)
return dirIndex;
return dirIndex2;
if (compare < 0)
right = mid;
else

View File

@@ -1046,8 +1046,7 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
{
CIndexToPathPair pair(_item.ParentIndex);
int renIndex = _renamedFiles.FindInSorted(pair);
int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
if (renIndex >= 0)
{
const CIndexToPathPair &pair = _renamedFiles[renIndex];
@@ -1319,7 +1318,7 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
if (needWriteFile)
{
_outFileStreamSpec = new COutFileStream;
CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec);
CMyComPtr<ISequentialOutStream> outStreamLoc2(_outFileStreamSpec);
if (!_outFileStreamSpec->Open(fullProcessedPath, _isSplit ? OPEN_ALWAYS: CREATE_ALWAYS))
{
// if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
@@ -1346,7 +1345,7 @@ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
RINOK(_outFileStreamSpec->Seek(_position, STREAM_SEEK_SET, NULL));
}
_outFileStream = outStreamLoc;
_outFileStream = outStreamLoc2;
}
}
}

View File

@@ -866,11 +866,10 @@ HRESULT CEncoderInfo::Init(
outStreamSpec = new CBenchmarkOutStream;
outStream = outStreamSpec;
if (!outStreamSpec->Alloc(kCompressedBufferSize))
return E_OUTOFMEMORY;
outStream = outStreamSpec;
propStreamSpec = 0;
if (!propStream)
{
@@ -917,15 +916,8 @@ HRESULT CEncoderInfo::Init(
// we must call encoding one time to calculate password key for key cache.
// it must be after WriteCoderProperties!
CBenchmarkInStream *inStreamSpec = new CBenchmarkInStream;
CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
Byte temp[16];
memset(temp, 0, sizeof(temp));
inStreamSpec->Init(temp, sizeof(temp));
CCrcOutStream *outStreamSpec = new CCrcOutStream;
CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
outStreamSpec->Init();
if (_encoderFilter)
{
@@ -934,7 +926,15 @@ HRESULT CEncoderInfo::Init(
}
else
{
RINOK(_encoder->Code(inStream, outStream, 0, 0, NULL));
CBenchmarkInStream *inStreamSpec = new CBenchmarkInStream;
CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
inStreamSpec->Init(temp, sizeof(temp));
CCrcOutStream *crcStreamSpec = new CCrcOutStream;
CMyComPtr<ISequentialOutStream> crcStream = crcStreamSpec;
crcStreamSpec->Init();
RINOK(_encoder->Code(inStream, crcStream, 0, 0, NULL));
}
}
}
@@ -2390,10 +2390,10 @@ static void x86cpuid_to_String(const Cx86cpuid &c, AString &s)
{
for (int i = 0; i < 3; i++)
{
UInt32 c[4] = { 0 };
MyCPUID(0x80000002 + i, &c[0], &c[1], &c[2], &c[3]);
UInt32 d[4] = { 0 };
MyCPUID(0x80000002 + i, &d[0], &d[1], &d[2], &d[3]);
for (int j = 0; j < 4; j++)
PrintCpuChars(s, c[j]);
PrintCpuChars(s, d[j]);
}
}
@@ -2469,10 +2469,11 @@ HRESULT Bench(
bool multiThreadTests = false;
COneMethodInfo method;
unsigned i;
CBenchBuffer fileDataBuffer;
{
unsigned i;
for (i = 0; i < props.Size(); i++)
{
const CProperty &property = props[i];
@@ -2568,6 +2569,7 @@ HRESULT Bench(
RINOK(method.ParseMethodFromPROPVARIANT(name, propVariant));
}
}
if (printCallback)
{
@@ -3013,7 +3015,7 @@ HRESULT Bench(
if (needSetComplexity)
callback.BenchProps.SetLzmaCompexity();
for (i = 0; i < numIterations; i++)
for (unsigned i = 0; i < numIterations; i++)
{
const unsigned kStartDicLog = 22;
unsigned pow = (dict < ((UInt32)1 << kStartDicLog)) ? kBenchMinDicLogSize : kStartDicLog;

View File

@@ -375,10 +375,10 @@ HRESULT Extract(
thereAreNotOpenArcs = true;
if (!options.StdInMode)
{
NFind::CFileInfo fi;
if (fi.Find(us2fs(arcPath)))
if (!fi.IsDir())
totalPackProcessed += fi.Size;
NFind::CFileInfo fi2;
if (fi2.Find(us2fs(arcPath)))
if (!fi2.IsDir())
totalPackProcessed += fi2.Size;
}
continue;
}

View File

@@ -101,8 +101,8 @@ HRESULT CHashBundle::SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVecto
h.Hasher = hasher;
h.Name = name;
h.DigestSize = digestSize;
for (unsigned i = 0; i < k_HashCalc_NumGroups; i++)
memset(h.Digests[i], 0, digestSize);
for (unsigned k = 0; k < k_HashCalc_NumGroups; k++)
memset(h.Digests[k], 0, digestSize);
}
return S_OK;

View File

@@ -582,9 +582,9 @@ HRESULT CArc::GetItemPathToParent(UInt32 index, UInt32 parent, UStringVector &pa
if (prevWasAltStream)
{
{
UString &s = parts[parts.Size() - 2];
s += L':';
s += parts.Back();
UString &s2 = parts[parts.Size() - 2];
s2 += L':';
s2 += parts.Back();
}
parts.DeleteBack();
}
@@ -2015,7 +2015,6 @@ HRESULT CArc::OpenStream2(const COpenOptions &op)
const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.FindExtension(extension) >= 0)
{
const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
if (ai.Flags_FindSignature() && searchMarkerInHandler)
return S_FALSE;
}
@@ -3467,6 +3466,8 @@ static bool ParseTypeParams(const UString &s, COpenType &type)
bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
{
int pos2 = s.Find(L':');
{
UString name;
if (pos2 < 0)
{
@@ -3501,13 +3502,15 @@ bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
}
type.FormatIndex = index;
}
for (unsigned i = pos2; i < s.Len();)
{
int next = s.Find(L':', i);
if (next < 0)
next = s.Len();
UString name = s.Mid(i, next - i);
const UString name = s.Mid(i, next - i);
if (name.IsEmpty())
return false;
if (!ParseTypeParams(name, type))

View File

@@ -758,15 +758,15 @@ static HRESULT Compress(
return errorInfo.SetFromLastError("cannot open SFX module", options.SfxModule);
CMyComPtr<ISequentialOutStream> sfxOutStream;
COutFileStream *outStreamSpec = NULL;
COutFileStream *outStreamSpec2 = NULL;
if (options.VolumesSizes.Size() == 0)
sfxOutStream = outStream;
else
{
outStreamSpec = new COutFileStream;
sfxOutStream = outStreamSpec;
outStreamSpec2 = new COutFileStream;
sfxOutStream = outStreamSpec2;
FString realPath = us2fs(archivePath.GetFinalPath());
if (!outStreamSpec->Create(realPath, false))
if (!outStreamSpec2->Create(realPath, false))
return errorInfo.SetFromLastError("cannot open file", realPath);
}
@@ -778,9 +778,9 @@ static HRESULT Compress(
RINOK(NCompress::CopyStream(sfxStream, sfxOutStream, NULL));
if (outStreamSpec)
if (outStreamSpec2)
{
RINOK(outStreamSpec->Close());
RINOK(outStreamSpec2->Close());
}
}
@@ -1060,7 +1060,7 @@ HRESULT UpdateArchive(
!options.SetArcPath(codecs, cmdArcPath2))
return E_NOTIMPL;
}
UString arcPath = options.ArchivePath.GetFinalPath();
const UString arcPath = options.ArchivePath.GetFinalPath();
if (cmdArcPath2.IsEmpty())
{
@@ -1088,10 +1088,10 @@ HRESULT UpdateArchive(
return E_NOTIMPL;
if (options.VolumesSizes.Size() > 0)
return E_NOTIMPL;
CObjectVector<COpenType> types;
CObjectVector<COpenType> types2;
// change it.
if (options.MethodMode.Type_Defined)
types.Add(options.MethodMode.Type);
types2.Add(options.MethodMode.Type);
// We need to set Properties to open archive only in some cases (WIM archives).
CIntVector excl;
@@ -1100,7 +1100,7 @@ HRESULT UpdateArchive(
op.props = &options.MethodMode.Properties;
#endif
op.codecs = codecs;
op.types = &types;
op.types = &types2;
op.excludedFormats = &excl;
op.stdInMode = false;
op.stream = NULL;
@@ -1289,10 +1289,11 @@ HRESULT UpdateArchive(
}
}
unsigned i;
for (i = 0; i < options.Commands.Size(); i++)
unsigned ci;
for (ci = 0; ci < options.Commands.Size(); ci++)
{
CArchivePath &ap = options.Commands[i].ArchivePath;
CArchivePath &ap = options.Commands[ci].ArchivePath;
if (usesTempDir)
{
// Check it
@@ -1301,7 +1302,7 @@ HRESULT UpdateArchive(
// ap.TempPrefix = tempDirPrefix;
}
if (!options.StdOutMode &&
(i > 0 || !createTempFile))
(ci > 0 || !createTempFile))
{
const FString path = us2fs(ap.GetFinalPath());
if (NFind::DoesFileOrDirExist(path))
@@ -1334,7 +1335,7 @@ HRESULT UpdateArchive(
{
unsigned num = dirItems.Items.Size();
processedItems.Alloc(num);
for (i = 0; i < num; i++)
for (unsigned i = 0; i < num; i++)
processedItems[i] = 0;
}
@@ -1348,10 +1349,10 @@ HRESULT UpdateArchive(
#endif
*/
for (i = 0; i < options.Commands.Size(); i++)
for (ci = 0; ci < options.Commands.Size(); ci++)
{
const CArc *arc = thereIsInArchive ? arcLink.GetArc() : NULL;
CUpdateArchiveCommand &command = options.Commands[i];
CUpdateArchiveCommand &command = options.Commands[ci];
UString name;
bool isUpdating;
@@ -1363,7 +1364,7 @@ HRESULT UpdateArchive(
else
{
name = command.ArchivePath.GetFinalPath();
isUpdating = (i == 0 && options.UpdateArchiveItself && thereIsInArchive);
isUpdating = (ci == 0 && options.UpdateArchiveItself && thereIsInArchive);
}
RINOK(callback->StartArchive(name, isUpdating))
@@ -1455,19 +1456,19 @@ HRESULT UpdateArchive(
{
CArchivePath &ap = options.Commands[i].ArchivePath;
FString finalPath = us2fs(ap.GetFinalPath());
FString arcPath;
if (!MyGetFullPathName(finalPath, arcPath))
FString arcPath2;
if (!MyGetFullPathName(finalPath, arcPath2))
return errorInfo.SetFromLastError("GetFullPathName error", finalPath);
fullPaths.Add(arcPath);
fullPaths.Add(arcPath2);
}
CCurrentDirRestorer curDirRestorer;
for (i = 0; i < fullPaths.Size(); i++)
{
UString arcPath = fs2us(fullPaths[i]);
UString fileName = ExtractFileNameFromPath(arcPath);
AString path = GetAnsiString(arcPath);
UString arcPath2 = fs2us(fullPaths[i]);
UString fileName = ExtractFileNameFromPath(arcPath2);
AString path = GetAnsiString(arcPath2);
AString name = GetAnsiString(fileName);
// Warning!!! MAPISendDocuments function changes Current directory
// fnSend(0, ";", (LPSTR)(LPCSTR)path, (LPSTR)(LPCSTR)name, 0);
@@ -1505,6 +1506,8 @@ HRESULT UpdateArchive(
CRecordVector<CRefSortPair> pairs;
FStringVector foldersNames;
unsigned i;
for (i = 0; i < dirItems.Items.Size(); i++)
{
const CDirItem &dirItem = dirItems.Items[i];

View File

@@ -219,9 +219,7 @@ STDMETHODIMP CArchiveUpdateCallback::GetRawProp(UInt32 index, PROPID propID, con
return Arc->GetRawProps->GetRawProp(
ArcItems ? (*ArcItems)[up.ArcIndex].IndexInServer : up.ArcIndex,
propID, data, dataSize, propType);
{
const CUpdatePair2 &up = (*UpdatePairs)[index];
/*
if (!up.NewData)
return E_FAIL;

View File

@@ -59,7 +59,10 @@ CCtrlHandlerSetter::~CCtrlHandlerSetter()
{
#if !defined(UNDER_CE) && defined(_WIN32)
if (!SetConsoleCtrlHandler(HandlerRoutine, FALSE))
throw "SetConsoleCtrlHandler fails";
{
// warning for throw in destructor.
// throw "SetConsoleCtrlHandler fails";
}
#endif
}

View File

@@ -900,10 +900,10 @@ HRESULT Print_OpenArchive_Props(CStdOutStream &so, const CCodecs *codecs, const
RINOK(PrintArcProp(so, archive, kpidPhySize, NULL));
if (er.TailSize != 0)
PrintPropNameAndNumber(so, kpidTailSize, er.TailSize);
UInt32 numProps;
RINOK(archive->GetNumberOfArchiveProperties(&numProps));
{
UInt32 numProps;
RINOK(archive->GetNumberOfArchiveProperties(&numProps));
for (UInt32 j = 0; j < numProps; j++)
{
CMyComBSTR name;

View File

@@ -157,10 +157,12 @@ LONG SetContextMenuHandler(bool setMode, const UString &path, UInt32 wow)
INIT_REG_WOW
LONG res;
{
CSysString s = TEXT("CLSID\\");
s += k_Clsid;
LONG res;
if (setMode)
{
{
@@ -193,6 +195,7 @@ LONG SetContextMenuHandler(bool setMode, const UString &path, UInt32 wow)
MyRegistry_DeleteKey_HKCR(s2, wow);
res = MyRegistry_DeleteKey_HKCR(s, wow);
}
}
// shellex items probably are shared beween 32-bit and 64-bit apps. So we don't delete items for delete operation.
if (setMode)

View File

@@ -508,10 +508,10 @@ EXTERN_C HANDLE WINAPI OpenPlugin(int openFrom, INT_PTR item)
EXTERN_C void WINAPI ClosePlugin(HANDLE plugin)
{
// OutputDebugStringA("-- ClosePlugin --- START");
MY_TRY_BEGIN;
// MY_TRY_BEGIN;
delete (CPlugin *)plugin;
// OutputDebugStringA("-- ClosePlugin --- END");
MY_TRY_END1("ClosePlugin");
// MY_TRY_END1("ClosePlugin");
}
EXTERN_C int WINAPI GetFindData(HANDLE plugin, struct PluginPanelItem **panelItems, int *itemsNumber, int opMode)

View File

@@ -496,6 +496,7 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info)
info->Format = kPluginFormatName;
{
UString name;
{
FString dirPrefix, fileName;
@@ -517,6 +518,8 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info)
COPY_STR_LIMITED(m_PannelTitleBuffer, UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP));
info->PanelTitle = m_PannelTitleBuffer;
}
memset(m_InfoLines, 0, sizeof(m_InfoLines));
m_InfoLines[0].Text[0] = 0;
m_InfoLines[0].Separator = TRUE;
@@ -716,11 +719,14 @@ HRESULT CPlugin::ShowAttributesWindow()
int size = 2;
CRecordVector<CInitDialogItem> initDialogItems;
int xSize = 70;
CInitDialogItem idi =
{ DI_DOUBLEBOX, 3, 1, xSize - 4, size - 2, false, false, 0, false, NMessageID::kProperties, NULL, NULL };
initDialogItems.Add(idi);
{
const CInitDialogItem idi =
{ DI_DOUBLEBOX, 3, 1, xSize - 4, size - 2, false, false, 0, false, NMessageID::kProperties, NULL, NULL };
initDialogItems.Add(idi);
}
AStringVector values;
const int kStartY = 3;
@@ -731,12 +737,14 @@ HRESULT CPlugin::ShowAttributesWindow()
int startY = kStartY + values.Size();
CInitDialogItem idi =
{ DI_TEXT, 5, startY, 0, 0, false, false, 0, false, 0, NULL, NULL };
idi.DataMessageId = FindPropNameID(property.ID);
if (idi.DataMessageId < 0)
idi.DataString = property.Name;
initDialogItems.Add(idi);
{
CInitDialogItem idi =
{ DI_TEXT, 5, startY, 0, 0, false, false, 0, false, 0, NULL, NULL };
idi.DataMessageId = FindPropNameID(property.ID);
if (idi.DataMessageId < 0)
idi.DataString = property.Name;
initDialogItems.Add(idi);
}
NCOM::CPropVariant prop;
RINOK(_folder->GetProperty(itemIndex, property.ID, &prop));
@@ -744,7 +752,7 @@ HRESULT CPlugin::ShowAttributesWindow()
values.Add(s);
{
CInitDialogItem idi =
const CInitDialogItem idi =
{ DI_TEXT, 30, startY, 0, 0, false, false, 0, false, -1, NULL, NULL };
initDialogItems.Add(idi);
}
@@ -774,7 +782,7 @@ HRESULT CPlugin::ShowAttributesWindow()
properties2.Add(prop);
}
for (unsigned i = 0; i < properties2.Size(); i++)
for (i = 0; i < properties2.Size(); i++)
{
const CArchiveItemProperty &property = properties2[i];
CMyComBSTR name;
@@ -802,9 +810,9 @@ HRESULT CPlugin::ShowAttributesWindow()
}
else
{
for (UInt32 i = 0; i < dataSize; i++)
for (UInt32 k = 0; k < dataSize; k++)
{
Byte b = ((const Byte *)data)[i];
Byte b = ((const Byte *)data)[k];
s += GetHex((Byte)((b >> 4) & 0xF));
s += GetHex((Byte)(b & 0xF));
}
@@ -812,17 +820,20 @@ HRESULT CPlugin::ShowAttributesWindow()
}
int startY = kStartY + values.Size();
CInitDialogItem idi =
{ DI_TEXT, 5, startY, 0, 0, false, false, 0, false, 0, NULL, NULL };
idi.DataMessageId = FindPropNameID(property.ID);
if (idi.DataMessageId < 0)
idi.DataString = property.Name;
initDialogItems.Add(idi);
{
CInitDialogItem idi =
{ DI_TEXT, 5, startY, 0, 0, false, false, 0, false, 0, NULL, NULL };
idi.DataMessageId = FindPropNameID(property.ID);
if (idi.DataMessageId < 0)
idi.DataString = property.Name;
initDialogItems.Add(idi);
}
values.Add(s);
{
CInitDialogItem idi =
const CInitDialogItem idi =
{ DI_TEXT, 30, startY, 0, 0, false, false, 0, false, -1, NULL, NULL };
initDialogItems.Add(idi);
}

View File

@@ -437,10 +437,8 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
UString archiveNameSrc = resultPath;
UString arcName = archiveNameSrc;
const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex];
int prevFormat = archiverIndex;
SetArcName(arcName, arcInfo);
SetArcName(arcName, codecs->Formats[archiverIndex]);
const CActionSet *actionSet = &k_ActionSet_Add;
@@ -454,13 +452,14 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
const int kMethodRadioIndex = kArchiveNameIndex + 2;
const int kModeRadioIndex = kMethodRadioIndex + 7;
const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex];
char updateAddToArchiveString[512];
const AString s = UnicodeStringToMultiByte(arcInfo.Name, CP_OEMCP);
sprintf(updateAddToArchiveString,
{
const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex];
const AString s = UnicodeStringToMultiByte(arcInfo.Name, CP_OEMCP);
sprintf(updateAddToArchiveString,
g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive), (const char *)s);
}
int methodIndex = 0;
int i;
@@ -471,7 +470,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
break;
}
struct CInitDialogItem initItems[]=
const struct CInitDialogItem initItems[]=
{
{ DI_DOUBLEBOX, 3, 1, 72, kYSize - 2, false, false, 0, false, NMessageID::kUpdateTitle, NULL, NULL },
@@ -532,12 +531,12 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems)
{
CIntVector indices;
CSysStringVector archiverNames;
FOR_VECTOR (i, codecs->Formats)
FOR_VECTOR (k, codecs->Formats)
{
const CArcInfoEx &arc = codecs->Formats[i];
const CArcInfoEx &arc = codecs->Formats[k];
if (arc.UpdateEnabled)
{
indices.Add(i);
indices.Add(k);
archiverNames.Add(GetSystemString(arc.Name, CP_OEMCP));
}
}

View File

@@ -844,17 +844,17 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
if (needOpenFile && !archiveIsOpened || res != S_OK)
{
UString message = L"Error";
UString m = L"Error";
if (res == S_FALSE || res == S_OK)
{
message = MyFormatNew(encrypted ?
m = MyFormatNew(encrypted ?
IDS_CANT_OPEN_ENCRYPTED_ARCHIVE :
IDS_CANT_OPEN_ARCHIVE,
fullPath);
}
else if (res != S_OK)
message = HResultToMessage(res);
ErrorMessage(message);
m = HResultToMessage(res);
ErrorMessage(m);
return -1;
}

View File

@@ -504,10 +504,10 @@ bool CPanel::OnComboBoxCommand(UINT code, LPARAM /* param */, LRESULT &result)
{
FString s = driveStrings[i];
ComboBoxPaths.Add(fs2us(s));
int iconIndex = GetRealIconIndex(s, 0);
int iconIndex2 = GetRealIconIndex(s, 0);
if (s.Len() > 0 && s.Back() == FCHAR_PATH_SEPARATOR)
s.DeleteBack();
AddComboBoxItem(fs2us(s), iconIndex, 1, false);
AddComboBoxItem(fs2us(s), iconIndex2, 1, false);
}
name = RootFolder_GetName_Network(iconIndex);

View File

@@ -189,9 +189,9 @@ void CPanel::Properties()
}
else
{
for (UInt32 i = 0; i < dataSize; i++)
for (UInt32 k = 0; k < dataSize; k++)
{
Byte b = ((const Byte *)data)[i];
Byte b = ((const Byte *)data)[k];
s += GetHex((Byte)((b >> 4) & 0xF));
s += GetHex((Byte)(b & 0xF));
}
@@ -245,8 +245,6 @@ void CPanel::Properties()
}
}
CMyComPtr<IGetFolderArcProps> getFolderArcProps;
_folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps);
if (getFolderArcProps)
{
CMyComPtr<IFolderArcProps> getProps;

View File

@@ -939,8 +939,8 @@ INT_PTR CProgressDialog::Create(const UString &title, NWindows::CThread &thread,
CWaitCursor waitCursor;
HANDLE h[] = { thread, _createDialogEvent };
WRes res = WaitForMultipleObjects(ARRAY_SIZE(h), h, FALSE, kCreateDelay);
if (res == WAIT_OBJECT_0 && !Sync.ThereIsMessage())
WRes res2 = WaitForMultipleObjects(ARRAY_SIZE(h), h, FALSE, kCreateDelay);
if (res2 == WAIT_OBJECT_0 && !Sync.ThereIsMessage())
return 0;
}
_title = title;

View File

@@ -242,13 +242,17 @@ bool CBenchmarkDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
int bx1, bx2, by;
GetItemSizes(IDCANCEL, bx1, by);
GetItemSizes(IDHELP, bx2, by);
int y = ySize - my - by;
int x = xSize - mx - bx1;
InvalidateRect(NULL);
{
int y = ySize - my - by;
int x = xSize - mx - bx1;
InvalidateRect(NULL);
MoveItem(IDCANCEL, x, y, bx1, by);
MoveItem(IDHELP, x - mx - bx2, y, bx2, by);
}
MoveItem(IDCANCEL, x, y, bx1, by);
MoveItem(IDHELP, x - mx - bx2, y, bx2, by);
if (_consoleEdit)
{
int yPos = ySize - my - by;

View File

@@ -713,16 +713,18 @@ void CCompressDialog::OnOK()
}
SaveOptionsInMem();
UString s;
if (!GetFinalPath_Smart(s))
{
ShowErrorMessage(*this, k_IncorrectPathMessage);
return;
UString s;
if (!GetFinalPath_Smart(s))
{
ShowErrorMessage(*this, k_IncorrectPathMessage);
return;
}
m_RegistryInfo.ArcPaths.Clear();
AddUniqueString(m_RegistryInfo.ArcPaths, s);
Info.ArcPath = s;
}
m_RegistryInfo.ArcPaths.Clear();
AddUniqueString(m_RegistryInfo.ArcPaths, s);
Info.ArcPath = s;
Info.UpdateMode = (NCompressDialog::NUpdateMode::EEnum)k_UpdateMode_Vals[m_UpdateMode.GetCurSel()];;
Info.PathMode = (NWildcard::ECensorPathMode)k_PathMode_Vals[m_PathMode.GetCurSel()];
@@ -1007,15 +1009,17 @@ void CCompressDialog::SetLevel()
m_Level.ResetContent();
const CFormatInfo &fi = g_Formats[GetStaticFormatIndex()];
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
int index = FindRegistryFormat(ai.Name);
UInt32 level = 5;
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Level <= 9)
level = fo.Level;
else
level = 9;
int index = FindRegistryFormat(ai.Name);
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Level <= 9)
level = fo.Level;
else
level = 9;
}
}
for (unsigned i = 0; i <= 9; i++)
@@ -1469,18 +1473,23 @@ void CCompressDialog::SetSolidBlockSize()
UInt32 defaultBlockSize = (UInt32)(Int32)-1;
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
int index = FindRegistryFormat(ai.Name);
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()))
defaultBlockSize = fo.BlockLogSize;
int index = FindRegistryFormat(ai.Name);
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()))
defaultBlockSize = fo.BlockLogSize;
}
}
index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_NON_SOLID));
m_Solid.SetItemData(index, (UInt32)kNoSolidBlockSize);
m_Solid.SetCurSel(0);
bool needSet = defaultBlockSize == (UInt32)(Int32)-1;
{
int index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_NON_SOLID));
m_Solid.SetItemData(index, (UInt32)kNoSolidBlockSize);
m_Solid.SetCurSel(0);
}
bool needSet = (defaultBlockSize == (UInt32)(Int32)-1);
for (unsigned i = 20; i <= 36; i++)
{
@@ -1495,8 +1504,11 @@ void CCompressDialog::SetSolidBlockSize()
m_Solid.SetItemData(index, (UInt32)i);
}
index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_SOLID));
m_Solid.SetItemData(index, kSolidBlockSize);
{
int index = (int)m_Solid.AddString(LangString(IDS_COMPRESS_SOLID));
m_Solid.SetItemData(index, kSolidBlockSize);
}
if (defaultBlockSize == (UInt32)(Int32)-1)
defaultBlockSize = kSolidBlockSize;
if (defaultBlockSize != kNoSolidBlockSize)
@@ -1514,13 +1526,15 @@ void CCompressDialog::SetNumThreads()
UInt32 numHardwareThreads = NSystem::GetNumberOfProcessors();
UInt32 defaultValue = numHardwareThreads;
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
int index = FindRegistryFormat(ai.Name);
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()) && fo.NumThreads != (UInt32)(Int32)-1)
defaultValue = fo.NumThreads;
const CArcInfoEx &ai = (*ArcFormats)[GetFormatIndex()];
int index = FindRegistryFormat(ai.Name);
if (index >= 0)
{
const NCompression::CFormatOptions &fo = m_RegistryInfo.Formats[index];
if (fo.Method.IsEqualTo_NoCase(GetMethodSpec()) && fo.NumThreads != (UInt32)(Int32)-1)
defaultValue = fo.NumThreads;
}
}
UInt32 numAlgoThreadsMax = 1;