diff options
Diffstat (limited to 'CPP/7zip/UI/Far')
-rwxr-xr-x | CPP/7zip/UI/Far/ExtractEngine.cpp | 8 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Far.dsp | 50 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/FarUtils.cpp | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Main.cpp | 9 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Messages.h | 2 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Plugin.cpp | 42 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/Plugin.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/PluginDelete.cpp | 3 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/PluginWrite.cpp | 79 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/ProgressBox.cpp | 7 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/StdAfx.h | 1 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/UpdateCallback100.cpp | 6 | ||||
-rwxr-xr-x | CPP/7zip/UI/Far/makefile | 8 |
13 files changed, 123 insertions, 95 deletions
diff --git a/CPP/7zip/UI/Far/ExtractEngine.cpp b/CPP/7zip/UI/Far/ExtractEngine.cpp index e85df5e1..15548949 100755 --- a/CPP/7zip/UI/Far/ExtractEngine.cpp +++ b/CPP/7zip/UI/Far/ExtractEngine.cpp @@ -134,10 +134,14 @@ STDMETHODIMP CExtractCallBackImp::SetOperationResult(INT32 operationResult, bool idMessage = NMessageID::kExtractUnsupportedMethod; break; case NArchive::NExtract::NOperationResult::kCRCError: - idMessage = NMessageID::kExtractCRCFailed; + idMessage = encrypted ? + NMessageID::kExtractCRCFailedEncrypted : + NMessageID::kExtractCRCFailed; break; case NArchive::NExtract::NOperationResult::kDataError: - idMessage = NMessageID::kExtractDataError; + idMessage = encrypted ? + NMessageID::kExtractDataErrorEncrypted : + NMessageID::kExtractDataError; break; default: return E_FAIL; diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 47c44c69..fa540ed2 100755 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /YX /FD /c -# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "NDEBUG" @@ -70,7 +70,7 @@ LINK32=link.exe # PROP Ignore_Export_Lib 1 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FAR_EXPORTS" /D "EXTERNAL_CODECS" /Yu"StdAfx.h" /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x419 /d "_DEBUG" @@ -118,14 +118,6 @@ SOURCE=.\StdAfx.h # PROP Default_Filter "" # Begin Source File -SOURCE=..\..\..\Common\Alloc.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\Alloc.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Common\IntToString.cpp # End Source File # Begin Source File @@ -366,14 +358,6 @@ SOURCE=..\Common\ArchiveOpenCallback.h # End Source File # Begin Source File -SOURCE=..\Common\ArchiverInfo.cpp -# End Source File -# Begin Source File - -SOURCE=..\Common\ArchiverInfo.h -# End Source File -# Begin Source File - SOURCE=..\Common\DefaultName.cpp # End Source File # Begin Source File @@ -410,6 +394,14 @@ SOURCE=..\Common\HandlerLoader.h # End Source File # Begin Source File +SOURCE=..\Common\LoadCodecs.cpp +# End Source File +# Begin Source File + +SOURCE=..\Common\LoadCodecs.h +# End Source File +# Begin Source File + SOURCE=..\Common\OpenArchive.cpp # End Source File # Begin Source File @@ -557,5 +549,27 @@ SOURCE=..\..\Common\StreamUtils.cpp SOURCE=..\..\Common\StreamUtils.h # End Source File # End Group +# Begin Group "C" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\..\C\Alloc.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Alloc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Sort.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Sort.h +# End Source File +# End Group # End Target # End Project diff --git a/CPP/7zip/UI/Far/FarUtils.cpp b/CPP/7zip/UI/Far/FarUtils.cpp index abbb6817..c4a30524 100755 --- a/CPP/7zip/UI/Far/FarUtils.cpp +++ b/CPP/7zip/UI/Far/FarUtils.cpp @@ -353,7 +353,7 @@ void CScreenRestorer::Restore() static AString DWORDToString(DWORD number) { char buffer[32]; - ultoa(number, buffer, 10); + _ultoa(number, buffer, 10); return buffer; } diff --git a/CPP/7zip/UI/Far/Main.cpp b/CPP/7zip/UI/Far/Main.cpp index a7994b6d..70d9117c 100755 --- a/CPP/7zip/UI/Far/Main.cpp +++ b/CPP/7zip/UI/Far/Main.cpp @@ -355,9 +355,6 @@ HRESULT OpenArchive(const CSysString &fileName, IArchiveOpenCallback *openArchiveCallback) { HRESULT OpenArchive(const CSysString &fileName, - #ifndef EXCLUDE_COM - HMODULE *module, - #endif IInArchive **archive, CArchiverInfo &archiverInfoResult, IArchiveOpenCallback *openArchiveCallback); @@ -451,7 +448,7 @@ HANDLE WINAPI OpenPlugin(int openFrom, int item) MY_TRY_BEGIN; if(openFrom == OPEN_COMMANDLINE) { - CSysString fileName = (const char *)item; + CSysString fileName = (const char *)(UINT_PTR)item; if(fileName.IsEmpty()) return INVALID_HANDLE_VALUE; if (fileName.Length() >= 2 && @@ -478,7 +475,7 @@ HANDLE WINAPI OpenPlugin(int openFrom, int item) throw 142134; if (CompressFiles(pluginPanelItem) == S_OK) { - int t = g_StartupInfo.ControlClearPanelSelection(); + /* int t = */ g_StartupInfo.ControlClearPanelSelection(); g_StartupInfo.ControlRequestActivePanel(FCTL_UPDATEPANEL, NULL); g_StartupInfo.ControlRequestActivePanel(FCTL_REDRAWPANEL, NULL); g_StartupInfo.ControlRequestActivePanel(FCTL_UPDATEANOTHERPANEL, NULL); @@ -554,7 +551,7 @@ void WINAPI GetPluginInfo(struct PluginInfo *info) MY_TRY_END1("GetPluginInfo"); } -int WINAPI Configure(int itemNumber) +int WINAPI Configure(int /* itemNumber */) { MY_TRY_BEGIN; diff --git a/CPP/7zip/UI/Far/Messages.h b/CPP/7zip/UI/Far/Messages.h index 8b6e2a49..7a36ab30 100755 --- a/CPP/7zip/UI/Far/Messages.h +++ b/CPP/7zip/UI/Far/Messages.h @@ -79,6 +79,8 @@ enum EEnum kExtractUnsupportedMethod, kExtractCRCFailed, kExtractDataError, + kExtractCRCFailedEncrypted, + kExtractDataErrorEncrypted, kOverwriteTitle, kOverwriteMessage1, diff --git a/CPP/7zip/UI/Far/Plugin.cpp b/CPP/7zip/UI/Far/Plugin.cpp index 0d4b150e..fde53756 100755 --- a/CPP/7zip/UI/Far/Plugin.cpp +++ b/CPP/7zip/UI/Far/Plugin.cpp @@ -79,7 +79,7 @@ void CPlugin::ReadPluginPanelItem(PluginPanelItem &panelItem, UINT32 itemIndex) throw 272340; CSysString oemString = UnicodeStringToMultiByte(propVariant.bstrVal, CP_OEMCP); - strcpy(panelItem.FindData.cFileName, oemString); + MyStringCopy(panelItem.FindData.cFileName, (const char *)oemString); panelItem.FindData.cAlternateFileName[0] = 0; if (_folder->GetProperty(itemIndex, kpidAttributes, &propVariant) != S_OK) @@ -204,7 +204,7 @@ void CPlugin::EnterToDirectory(const UString &aDirName) _folder = newFolder; } -int CPlugin::SetDirectory(const char *aszDir, int opMode) +int CPlugin::SetDirectory(const char *aszDir, int /* opMode */) { UString path = MultiByteToUnicodeString(aszDir, CP_OEMCP); if (path == L"\\") @@ -361,12 +361,14 @@ static int FindPropertyInfo(PROPID propID) */ // char *g_Titles[] = { "a", "f", "v" }; -static void SmartAddToString(AString &aDestString, const char *aSrcString) +/* +static void SmartAddToString(AString &destString, const char *srcString) { - if (!aDestString.IsEmpty()) - aDestString += ','; - aDestString += aSrcString; + if (!destString.IsEmpty()) + destString += ','; + destString += srcString; } +*/ /* void CPlugin::AddColumn(PROPID propID) @@ -401,10 +403,10 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) UINT codePage = ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; - strcpy(m_FileNameBuffer, UnicodeStringToMultiByte(m_FileName, codePage)); + MyStringCopy(m_FileNameBuffer, (const char *)UnicodeStringToMultiByte(m_FileName, codePage)); info->HostFile = m_FileNameBuffer; // test it it is not static - strcpy(m_CurrentDirBuffer, UnicodeStringToMultiByte(m_CurrentDir, CP_OEMCP)); + MyStringCopy(m_CurrentDirBuffer, (const char *)UnicodeStringToMultiByte(m_CurrentDir, CP_OEMCP)); info->CurDir = m_CurrentDirBuffer; info->Format = kPluginFormatName; @@ -429,15 +431,15 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) m_PannelTitle += m_CurrentDir; } - strcpy(m_PannelTitleBuffer, UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP)); + MyStringCopy(m_PannelTitleBuffer, (const char *)UnicodeStringToMultiByte(m_PannelTitle, CP_OEMCP)); info->PanelTitle = m_PannelTitleBuffer; memset(m_InfoLines,0,sizeof(m_InfoLines)); - strcpy(m_InfoLines[0].Text,""); + MyStringCopy(m_InfoLines[0].Text,""); m_InfoLines[0].Separator = TRUE; - strcpy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType)); - strcpy(m_InfoLines[1].Data, UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP)); + MyStringCopy(m_InfoLines[1].Text, g_StartupInfo.GetMsgString(NMessageID::kArchiveType)); + MyStringCopy(m_InfoLines[1].Data, (const char *)UnicodeStringToMultiByte(_archiveTypeName, CP_OEMCP)); int numItems = 2; UINT32 numProps; @@ -456,19 +458,19 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) if (index < 0) { if (name != 0) - strcpy(item.Text, UnicodeStringToMultiByte( + MyStringCopy(item.Text, (const char *)UnicodeStringToMultiByte( (const wchar_t *)name, CP_OEMCP)); else - strcpy(item.Text, ""); + MyStringCopy(item.Text, ""); } else - strcpy(item.Text, g_StartupInfo.GetMsgString(kPROPIDToName[index].PluginID)); + MyStringCopy(item.Text, g_StartupInfo.GetMsgString(kPROPIDToName[index].PluginID)); NCOM::CPropVariant propVariant; if (m_ArchiveHandler->GetArchiveProperty(propID, &propVariant) != S_OK) continue; CSysString s = ConvertPropertyToString2(propVariant, propID); - strcpy(item.Data, s); + MyStringCopy(item.Data, (const char *)s); numItems++; } } @@ -577,8 +579,6 @@ HRESULT CPlugin::ShowAttributesWindow() } */ - const int kPathIndex = 2; - const int kOkButtonIndex = 4; int size = 2; CRecordVector<CInitDialogItem> initDialogItems; @@ -637,7 +637,7 @@ HRESULT CPlugin::ShowAttributesWindow() for (i = 0; i < numLines; i++) { FarDialogItem &dialogItem = dialogItems[1 + i * 2]; - int len = strlen(dialogItem.Data); + int len = (int)strlen(dialogItem.Data); if (len > maxLen) maxLen = len; } @@ -646,7 +646,7 @@ HRESULT CPlugin::ShowAttributesWindow() for (i = 0; i < numLines; i++) { FarDialogItem &dialogItem = dialogItems[1 + i * 2 + 1]; - int len = strlen(dialogItem.Data); + int len = (int)strlen(dialogItem.Data); if (len > maxLen2) maxLen2 = len; dialogItem.X1 = maxLen + kSpace; @@ -657,7 +657,7 @@ HRESULT CPlugin::ShowAttributesWindow() aFirstDialogItem.Y2 = size - 2; aFirstDialogItem.X2 = xSize - 4; - int askCode = g_StartupInfo.ShowDialog(xSize, size, NULL, &dialogItems.Front(), numDialogItems); + /* int askCode = */ g_StartupInfo.ShowDialog(xSize, size, NULL, &dialogItems.Front(), numDialogItems); return S_OK; } diff --git a/CPP/7zip/UI/Far/Plugin.h b/CPP/7zip/UI/Far/Plugin.h index 0b617cfb..736fc7d0 100755 --- a/CPP/7zip/UI/Far/Plugin.h +++ b/CPP/7zip/UI/Far/Plugin.h @@ -9,7 +9,6 @@ #include "Windows/FileFind.h" #include "Windows/PropVariant.h" -#include "../Common/ArchiverInfo.h" #include "../Agent/IFolderArchive.h" #include "FarUtils.h" diff --git a/CPP/7zip/UI/Far/PluginDelete.cpp b/CPP/7zip/UI/Far/PluginDelete.cpp index 6a969c15..95e43a36 100755 --- a/CPP/7zip/UI/Far/PluginDelete.cpp +++ b/CPP/7zip/UI/Far/PluginDelete.cpp @@ -89,7 +89,8 @@ int CPlugin::DeleteFiles(PluginPanelItem *panelItems, int numItems, CRecordVector<UINT32> indices; indices.Reserve(numItems); - for(int i = 0; i < numItems; i++) + int i; + for(i = 0; i < numItems; i++) indices.Add(panelItems[i].UserData); //////////////////////////// diff --git a/CPP/7zip/UI/Far/PluginWrite.cpp b/CPP/7zip/UI/Far/PluginWrite.cpp index d6730985..a159a476 100755 --- a/CPP/7zip/UI/Far/PluginWrite.cpp +++ b/CPP/7zip/UI/Far/PluginWrite.cpp @@ -80,7 +80,8 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles( ReadCompressionInfo(compressionInfo); int methodIndex = 0; - for (int i = sizeof(g_MethodMap) / sizeof(g_MethodMap[0]) - 1; i >= 0; i--) + int i; + for (i = sizeof(g_MethodMap) / sizeof(g_MethodMap[0]) - 1; i >= 0; i--) if (compressionInfo.Level >= g_MethodMap[i]) { methodIndex = i; @@ -226,7 +227,7 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles( &fileNamePointers.Front(), fileNamePointers.Size()); BYTE actionSetByte[NUpdateArchive::NPairState::kNumValues]; for (i = 0; i < NUpdateArchive::NPairState::kNumValues; i++) - actionSetByte[i] = actionSet->StateActions[i]; + actionSetByte[i] = (BYTE)actionSet->StateActions[i]; CUpdateCallback100Imp *updateCallbackSpec = new CUpdateCallback100Imp; CMyComPtr<IFolderArchiveUpdateCallback> updateCallback(updateCallbackSpec ); @@ -236,8 +237,7 @@ NFileOperationReturnCode::EEnum CPlugin::PutFiles( if (SetOutProperties(outArchive, compressionInfo.Level) != S_OK) return NFileOperationReturnCode::kError; - result = outArchive->DoOperation(NULL, NULL, - tempFileName, actionSetByte, NULL, updateCallback); + result = outArchive->DoOperation2(tempFileName, actionSetByte, NULL, updateCallback); updateCallback.Release(); outArchive.Release(); @@ -332,7 +332,8 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) return E_FAIL; UStringVector fileNames; - for(int i = 0; i < pluginPanelItems.Size(); i++) + int i; + for(i = 0; i < pluginPanelItems.Size(); i++) { const PluginPanelItem &panelItem = pluginPanelItems[i]; CSysString fullName; @@ -353,23 +354,23 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) int archiverIndex = 0; - CObjectVector<CArchiverInfo> archiverInfoList; + CCodecs *codecs = new CCodecs; + CMyComPtr<ICompressCodecsInfo> compressCodecsInfo = codecs; + if (codecs->Load() != S_OK) + throw "Can't load 7-Zip codecs"; { - CObjectVector<CArchiverInfo> fullArchiverInfoList; - ReadArchiverInfoList(fullArchiverInfoList); - for (int i = 0; i < fullArchiverInfoList.Size(); i++) + for (int i = 0; i < codecs->Formats.Size(); i++) { - const CArchiverInfo &archiverInfo = fullArchiverInfoList[i]; - if (archiverInfo.UpdateEnabled) + const CArcInfoEx &arcInfo = codecs->Formats[i]; + if (arcInfo.UpdateEnabled) { - if (archiverInfo.Name.CompareNoCase(compressionInfo.ArchiveType) == 0) - archiverIndex = archiverInfoList.Size(); - archiverInfoList.Add(archiverInfo); + if (archiverIndex == -1) + archiverIndex = i; + if (arcInfo.Name.CompareNoCase(compressionInfo.ArchiveType) == 0) + archiverIndex = i; } } } - if (archiverInfoList.IsEmpty()) - throw "There is no update achivers"; UString resultPath; @@ -392,10 +393,10 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) UString archiveNameSrc = resultPath; UString archiveName = archiveNameSrc; - const CArchiverInfo &archiverInfo = archiverInfoList[archiverIndex]; + const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex]; int prevFormat = archiverIndex; - if (!archiverInfo.KeepName) + if (!arcInfo.KeepName) { int dotPos = archiveName.ReverseFind('.'); int slashPos = MyMax(archiveName.ReverseFind('\\'), archiveName.ReverseFind('/')); @@ -403,7 +404,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) archiveName = archiveName.Left(dotPos); } archiveName += L'.'; - archiveName += archiverInfo.GetMainExtension(); + archiveName += arcInfo.GetMainExt(); const CActionSet *actionSet = &kAddActionSet; @@ -417,14 +418,15 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) const int kMethodRadioIndex = kArchiveNameIndex + 2; const int kModeRadioIndex = kMethodRadioIndex + 7; - const CArchiverInfo &archiverInfo = archiverInfoList[archiverIndex]; + const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex]; char updateAddToArchiveString[512]; sprintf(updateAddToArchiveString, - g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive), GetSystemString(archiverInfo.Name), CP_OEMCP); + g_StartupInfo.GetMsgString(NMessageID::kUpdateAddToArchive), GetSystemString(arcInfo.Name), CP_OEMCP); int methodIndex = 0; - for (int i = sizeof(g_MethodMap) / sizeof(g_MethodMap[0]) - 1; i >= 0; i--) + int i; + for (i = sizeof(g_MethodMap) / sizeof(g_MethodMap[0]) - 1; i >= 0; i--) if (compressionInfo.Level >= g_MethodMap[i]) { methodIndex = i; @@ -507,20 +509,27 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) if (askCode == kSelectarchiverButtonIndex) { + CIntVector indices; CSysStringVector archiverNames; - for(int i = 0; i < archiverInfoList.Size(); i++) - archiverNames.Add(GetSystemString(archiverInfoList[i].Name, - CP_OEMCP)); + for(int i = 0; i < codecs->Formats.Size(); i++) + { + const CArcInfoEx &arc = codecs->Formats[i]; + if (arc.UpdateEnabled) + { + indices.Add(i); + archiverNames.Add(GetSystemString(arc.Name, CP_OEMCP)); + } + } int index = g_StartupInfo.Menu(FMENU_AUTOHIGHLIGHT, g_StartupInfo.GetMsgString(NMessageID::kUpdateSelectArchiverMenuTitle), NULL, archiverNames, archiverIndex); if(index >= 0) { - const CArchiverInfo &prevArchiverInfo = archiverInfoList[prevFormat]; + const CArcInfoEx &prevArchiverInfo = codecs->Formats[prevFormat]; if (prevArchiverInfo.KeepName) { - const UString &prevExtension = prevArchiverInfo.GetMainExtension(); + const UString &prevExtension = prevArchiverInfo.GetMainExt(); const int prevExtensionLen = prevExtension.Length(); if (archiveName.Right(prevExtensionLen).CompareNoCase(prevExtension) == 0) { @@ -535,12 +544,11 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) } } - archiverIndex = index; - const CArchiverInfo &archiverInfo = - archiverInfoList[archiverIndex]; + archiverIndex = indices[index]; + const CArcInfoEx &arcInfo = codecs->Formats[archiverIndex]; prevFormat = archiverIndex; - if (archiverInfo.KeepName) + if (arcInfo.KeepName) archiveName = archiveNameSrc; else { @@ -550,7 +558,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) archiveName = archiveName.Left(dotPos); } archiveName += L'.'; - archiveName += archiverInfo.GetMainExtension(); + archiveName += arcInfo.GetMainExt(); } continue; } @@ -561,7 +569,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) break; } - const CArchiverInfo &archiverInfoFinal = archiverInfoList[archiverIndex]; + const CArcInfoEx &archiverInfoFinal = codecs->Formats[archiverIndex]; compressionInfo.ArchiveType = archiverInfoFinal.Name; SaveCompressionInfo(compressionInfo); @@ -651,7 +659,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) &fileNamePointers.Front(), fileNamePointers.Size()); BYTE actionSetByte[NUpdateArchive::NPairState::kNumValues]; for (i = 0; i < NUpdateArchive::NPairState::kNumValues; i++) - actionSetByte[i] = actionSet->StateActions[i]; + actionSetByte[i] = (BYTE)actionSet->StateActions[i]; CUpdateCallback100Imp *updateCallbackSpec = new CUpdateCallback100Imp; CMyComPtr<IFolderArchiveUpdateCallback> updateCallback(updateCallbackSpec ); @@ -662,8 +670,7 @@ HRESULT CompressFiles(const CObjectVector<PluginPanelItem> &pluginPanelItems) RINOK(SetOutProperties(outArchive, compressionInfo.Level)); HRESULT result = outArchive->DoOperation( - GetUnicodeString(archiverInfoFinal.FilePath, CP_OEMCP), - &archiverInfoFinal.ClassID, + codecs, archiverIndex, tempFileName, actionSetByte, NULL, updateCallback); updateCallback.Release(); diff --git a/CPP/7zip/UI/Far/ProgressBox.cpp b/CPP/7zip/UI/Far/ProgressBox.cpp index 64e0e09d..d708331a 100755 --- a/CPP/7zip/UI/Far/ProgressBox.cpp +++ b/CPP/7zip/UI/Far/ProgressBox.cpp @@ -12,7 +12,8 @@ using namespace NFar; static void CopySpaces(char *destString, int numSpaces) { - for(int i = 0; i < numSpaces; i++) + int i; + for(i = 0; i < numSpaces; i++) destString[i] = ' '; destString[i] = '\0'; } @@ -47,11 +48,11 @@ void CMessageBox::ShowProcessMessages(const char *messages[]) for (int i = 0; i < m_NumStrings; i++) { char *formattedMessage = formattedMessages[i]; - int len = strlen(messages[i]); + int len = (int)strlen(messages[i]); int size = MyMax(m_Width, len); int startPos = (size - len) / 2; CopySpaces(formattedMessage, startPos); - strcpy(formattedMessage + startPos, messages[i]); + MyStringCopy(formattedMessage + startPos, messages[i]); CopySpaces(formattedMessage + startPos + len, size - startPos - len); msgItems[kNumStaticStrings + i] = formattedMessage; } diff --git a/CPP/7zip/UI/Far/StdAfx.h b/CPP/7zip/UI/Far/StdAfx.h index 0a7c347b..ae0e328a 100755 --- a/CPP/7zip/UI/Far/StdAfx.h +++ b/CPP/7zip/UI/Far/StdAfx.h @@ -3,6 +3,7 @@ #ifndef __STDAFX_H #define __STDAFX_H +#define _CRT_SECURE_NO_DEPRECATE #include <windows.h> #include <stdio.h> diff --git a/CPP/7zip/UI/Far/UpdateCallback100.cpp b/CPP/7zip/UI/Far/UpdateCallback100.cpp index f1a2946e..96699174 100755 --- a/CPP/7zip/UI/Far/UpdateCallback100.cpp +++ b/CPP/7zip/UI/Far/UpdateCallback100.cpp @@ -29,17 +29,17 @@ STDMETHODIMP CUpdateCallback100Imp::SetCompleted(const UINT64 *aCompleteValue) return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t *aName) +STDMETHODIMP CUpdateCallback100Imp::CompressOperation(const wchar_t* /* name */) { return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t *aName) +STDMETHODIMP CUpdateCallback100Imp::DeleteOperation(const wchar_t* /* name */) { return S_OK; } -STDMETHODIMP CUpdateCallback100Imp::OperationResult(INT32 aOperationResult) +STDMETHODIMP CUpdateCallback100Imp::OperationResult(INT32 /* operationResult */) { return S_OK; } diff --git a/CPP/7zip/UI/Far/makefile b/CPP/7zip/UI/Far/makefile index 4dbd1988..42c5a0a7 100755 --- a/CPP/7zip/UI/Far/makefile +++ b/CPP/7zip/UI/Far/makefile @@ -1,7 +1,9 @@ PROG = 7-ZipFar.dll DEF_FILE = Far.def LIBS = $(LIBS) user32.lib oleaut32.lib advapi32.lib ole32.lib -CFLAGS = $(CFLAGS) -I ../../../ -DWIN_LONG_PATH +CFLAGS = $(CFLAGS) -I ../../../ \ + -DWIN_LONG_PATH \ + -DEXTERNAL_CODECS FAR_OBJS = \ $O\CLSIDConst.obj \ @@ -18,7 +20,6 @@ FAR_OBJS = \ $O\UpdateCallback100.obj \ COMMON_OBJS = \ - $O\Alloc.obj \ $O\IntToString.obj \ $O\NewHandler.obj \ $O\String.obj \ @@ -47,10 +48,10 @@ WIN_OBJS = \ UI_COMMON_OBJS = \ $O\ArchiveExtractCallback.obj \ $O\ArchiveOpenCallback.obj \ - $O\ArchiverInfo.obj \ $O\DefaultName.obj \ $O\EnumDirItems.obj \ $O\ExtractingFilePath.obj \ + $O\LoadCodecs.obj \ $O\OpenArchive.obj \ $O\PropIDUtils.obj \ $O\SortUtils.obj \ @@ -68,6 +69,7 @@ AGENT_OBJS = \ $O\UpdateCallbackAgent.obj \ C_OBJS = \ + $O\Alloc.obj \ $O\Sort.obj \ OBJS = \ |