From c65230d8585317f7cd58ae2982067385269fdee9 Mon Sep 17 00:00:00 2001 From: Igor Pavlov Date: Tue, 2 Nov 2010 00:00:00 +0000 Subject: 9.18 --- CPP/7zip/UI/Agent/Agent.cpp | 2 +- CPP/7zip/UI/Agent/Agent.h | 21 +++++++++++ CPP/7zip/UI/Common/Extract.cpp | 9 +++++ CPP/7zip/UI/Common/ExtractingFilePath.cpp | 2 + CPP/7zip/UI/Common/OpenArchive.cpp | 8 ++++ CPP/7zip/UI/Common/OpenArchive.h | 1 + CPP/7zip/UI/Common/PropIDUtils.cpp | 11 ++++-- CPP/7zip/UI/Console/List.cpp | 5 ++- CPP/7zip/UI/Console/Main.cpp | 5 +-- CPP/7zip/UI/Far/Far.dsp | 4 +- CPP/7zip/UI/Far/FarPlugin.h | 58 ++++++++++++++--------------- CPP/7zip/UI/Far/Main.cpp | 7 +++- CPP/7zip/UI/Far/Plugin.cpp | 20 ++++++---- CPP/7zip/UI/FileManager/PanelItemOpen.cpp | 41 ++++++++++++++++++++ CPP/7zip/UI/FileManager/PanelMenu.cpp | 17 +++++---- CPP/7zip/UI/FileManager/PanelSort.cpp | 18 +++++---- CPP/7zip/UI/FileManager/ProgramLocation.cpp | 3 +- CPP/7zip/UI/FileManager/PropertyName.cpp | 1 + CPP/7zip/UI/FileManager/PropertyName.rc | 1 + CPP/7zip/UI/FileManager/PropertyNameRes.h | 1 + CPP/7zip/UI/GUI/CompressDialog.cpp | 8 +++- 21 files changed, 178 insertions(+), 65 deletions(-) (limited to 'CPP/7zip/UI') diff --git a/CPP/7zip/UI/Agent/Agent.cpp b/CPP/7zip/UI/Agent/Agent.cpp index 4db95c87..4a099308 100755 --- a/CPP/7zip/UI/Agent/Agent.cpp +++ b/CPP/7zip/UI/Agent/Agent.cpp @@ -609,7 +609,7 @@ STDMETHODIMP CAgent::GetArcProp(UInt32 level, PROPID propID, PROPVARIANT *value) CArc &arc = _archiveLink.Arcs[level]; switch(propID) { - case kpidType: prop = _codecs->Formats[arc.FormatIndex].Name; break; + case kpidType: prop = GetTypeOfArc(arc); break; case kpidPath: prop = arc.Path; break; default: return arc.Archive->GetArchiveProperty(propID, value); } diff --git a/CPP/7zip/UI/Agent/Agent.h b/CPP/7zip/UI/Agent/Agent.h index c5efb411..454964bc 100755 --- a/CPP/7zip/UI/Agent/Agent.h +++ b/CPP/7zip/UI/Agent/Agent.h @@ -206,6 +206,27 @@ public: const CArc &GetArc() { return _archiveLink.Arcs.Back(); } IInArchive *GetArchive() { if ( _archiveLink.Arcs.IsEmpty()) return 0; return GetArc().Archive; } bool CanUpdate() const { return _archiveLink.Arcs.Size() <= 1; } + + UString GetTypeOfArc(const CArc &arc) const { return _codecs->Formats[arc.FormatIndex].Name; } + UString GetErrorMessage() const + { + UString s; + for (int i = _archiveLink.Arcs.Size() - 1; i >= 0; i--) + { + const CArc &arc = _archiveLink.Arcs[i]; + if (arc.ErrorMessage.IsEmpty()) + continue; + if (!s.IsEmpty()) + s += L"--------------------\n"; + s += arc.ErrorMessage; + s += L"\n\n["; + s += GetTypeOfArc(arc); + s += L"] "; + s += arc.Path; + s += L"\n"; + } + return s; + } }; #ifdef NEW_FOLDER_INTERFACE diff --git a/CPP/7zip/UI/Common/Extract.cpp b/CPP/7zip/UI/Common/Extract.cpp index f4c126a4..ca2c8c73 100755 --- a/CPP/7zip/UI/Common/Extract.cpp +++ b/CPP/7zip/UI/Common/Extract.cpp @@ -228,6 +228,15 @@ HRESULT DecompressArchives( } #endif + for (int v = 0; v < archiveLink.Arcs.Size(); v++) + { + const UString &s = archiveLink.Arcs[v].ErrorMessage; + if (!s.IsEmpty()) + { + RINOK(extractCallback->MessageError(s)); + } + } + CArc &arc = archiveLink.Arcs.Back(); arc.MTimeDefined = (!options.StdInMode && !fi.IsDevice); arc.MTime = fi.MTime; diff --git a/CPP/7zip/UI/Common/ExtractingFilePath.cpp b/CPP/7zip/UI/Common/ExtractingFilePath.cpp index 67a58372..8f31708b 100755 --- a/CPP/7zip/UI/Common/ExtractingFilePath.cpp +++ b/CPP/7zip/UI/Common/ExtractingFilePath.cpp @@ -2,6 +2,8 @@ #include "StdAfx.h" +#include "../../../../C/Types.h" + #include "Common/Wildcard.h" #include "ExtractingFilePath.h" diff --git a/CPP/7zip/UI/Common/OpenArchive.cpp b/CPP/7zip/UI/Common/OpenArchive.cpp index d61c7f17..56a63046 100755 --- a/CPP/7zip/UI/Common/OpenArchive.cpp +++ b/CPP/7zip/UI/Common/OpenArchive.cpp @@ -111,6 +111,7 @@ HRESULT CArc::OpenStream( IArchiveOpenCallback *callback) { Archive.Release(); + ErrorMessage.Empty(); const UString fileName = ExtractFileNameFromPath(Path); UString extension; { @@ -298,6 +299,13 @@ HRESULT CArc::OpenStream( if (result == S_FALSE) continue; RINOK(result); + + { + NCOM::CPropVariant prop; + archive->GetArchiveProperty(kpidError, &prop); + if (prop.vt != VT_EMPTY) + ErrorMessage = (prop.vt == VT_BSTR) ? prop.bstrVal : L"Unknown error"; + } Archive = archive; const CArcInfoEx &format = codecs->Formats[FormatIndex]; diff --git a/CPP/7zip/UI/Common/OpenArchive.h b/CPP/7zip/UI/Common/OpenArchive.h index 92103623..4a003ee6 100755 --- a/CPP/7zip/UI/Common/OpenArchive.h +++ b/CPP/7zip/UI/Common/OpenArchive.h @@ -24,6 +24,7 @@ struct CArc int SubfileIndex; FILETIME MTime; bool MTimeDefined; + UString ErrorMessage; CArc(): MTimeDefined(false) {} diff --git a/CPP/7zip/UI/Common/PropIDUtils.cpp b/CPP/7zip/UI/Common/PropIDUtils.cpp index daa57ef6..dacaca5f 100755 --- a/CPP/7zip/UI/Common/PropIDUtils.cpp +++ b/CPP/7zip/UI/Common/PropIDUtils.cpp @@ -45,6 +45,7 @@ static const char g_WinAttrib[17] = "RHS8DAdNTsrCOnE_"; 16 VIRTUAL */ +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 : L'-'; UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool full) @@ -92,17 +93,21 @@ UString ConvertPropertyToString(const PROPVARIANT &prop, PROPID propID, bool ful UString res; UInt32 a = prop.ulVal; wchar_t temp[16]; - temp[0] = MY_ATTR_CHAR(a, 14, L'd'); + + temp[0] = kPosixTypes[(a >> 12) & 0xF]; for (int i = 6; i >= 0; i -= 3) { temp[7 - i] = MY_ATTR_CHAR(a, i + 2, L'r'); temp[8 - i] = MY_ATTR_CHAR(a, i + 1, L'w'); temp[9 - i] = MY_ATTR_CHAR(a, i + 0, L'x'); } + if ((a & 0x800) != 0) temp[3] = ((a & (1 << 6)) ? 's' : 'S'); + if ((a & 0x400) != 0) temp[6] = ((a & (1 << 3)) ? 's' : 'S'); + if ((a & 0x200) != 0) temp[9] = ((a & (1 << 0)) ? 't' : 'T'); temp[10] = 0; res = temp; - a &= ~0x1FF; - a &= ~0xC000; + + a &= ~(UInt32)0xFFFF; if (a != 0) { ConvertUInt32ToHex(a, temp); diff --git a/CPP/7zip/UI/Console/List.cpp b/CPP/7zip/UI/Console/List.cpp index b06641f2..f747cfda 100755 --- a/CPP/7zip/UI/Console/List.cpp +++ b/CPP/7zip/UI/Console/List.cpp @@ -29,7 +29,7 @@ struct CPropIdToName const wchar_t *Name; }; -static CPropIdToName kPropIdToName[] = +static const CPropIdToName kPropIdToName[] = { { kpidPath, L"Path" }, { kpidName, L"Name" }, @@ -82,6 +82,7 @@ static CPropIdToName kPropIdToName[] = { kpidSectorSize, L"Sector Size" }, { kpidPosixAttrib, L"Mode" }, { kpidLink, L"Link" }, + { kpidError, L"Error" }, { kpidTotalSize, L"Total Size" }, { kpidFreeSpace, L"Free Space" }, @@ -505,6 +506,8 @@ HRESULT ListArchives(CCodecs *codecs, const CIntVector &formatIndices, g_StdOut << "--\n"; PrintPropPair(L"Path", arc.Path); PrintPropPair(L"Type", codecs->Formats[arc.FormatIndex].Name); + if (!arc.ErrorMessage.IsEmpty()) + PrintPropPair(L"Error", arc.ErrorMessage); UInt32 numProps; IInArchive *archive = arc.Archive; if (archive->GetNumberOfArchiveProperties(&numProps) == S_OK) diff --git a/CPP/7zip/UI/Console/Main.cpp b/CPP/7zip/UI/Console/Main.cpp index 7cb2a396..9bd451f8 100755 --- a/CPP/7zip/UI/Console/Main.cpp +++ b/CPP/7zip/UI/Console/Main.cpp @@ -26,7 +26,6 @@ #ifdef EXTERNAL_CODECS #include "../Common/LoadCodecs.h" #endif -#include "../Common/PropIDUtils.h" #include "BenchCon.h" #include "ExtractCallbackConsole.h" @@ -457,8 +456,8 @@ int Main2( << "Compressed: " << stat.PackSize << endl; if (options.CalcCrc) { - wchar_t s[16]; - ConvertUInt32ToHex(stat.CrcSum, s); + char s[16]; + ConvertUInt32ToHexWithZeros(stat.CrcSum, s); stdStream << "CRC: " << s << endl; } } diff --git a/CPP/7zip/UI/Far/Far.dsp b/CPP/7zip/UI/Far/Far.dsp index 4609c82c..394977bb 100755 --- a/CPP/7zip/UI/Far/Far.dsp +++ b/CPP/7zip/UI/Far/Far.dsp @@ -53,7 +53,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 /dll /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 /nologo /dll /machine:I386 /out:"C:\Program Files\Far2\Plugins\7-Zip\7-ZipFar.dll" /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 /nologo /dll /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /opt:NOWIN98 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "Far - Win32 Debug" @@ -80,7 +80,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 /dll /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 /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Far2\Plugins\7-Zip\7-ZipFar.dll" /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 /nologo /dll /debug /machine:I386 /out:"C:\Program Files\Far\Plugins\7-Zip\7-ZipFar.dll" /pdbtype:sept !ENDIF diff --git a/CPP/7zip/UI/Far/FarPlugin.h b/CPP/7zip/UI/Far/FarPlugin.h index 1408ef21..d9ea6dca 100755 --- a/CPP/7zip/UI/Far/FarPlugin.h +++ b/CPP/7zip/UI/Far/FarPlugin.h @@ -61,7 +61,7 @@ struct PluginPanelItem char **CustomColumnData; int CustomColumnNumber; DWORD_PTR UserData; - DWORD CRC32; + DWORD CRC32; DWORD_PTR Reserved[2]; }; @@ -484,34 +484,34 @@ enum OPERATION_MODES { /* EXTERN_C_BEGIN - void WINAPI _export ClosePluginW(HANDLE hPlugin); - int WINAPI _export CompareW(HANDLE hPlugin,const struct PluginPanelItem *Item1,const struct PluginPanelItem *Item2,unsigned int Mode); - int WINAPI _export ConfigureW(int ItemNumber); - int WINAPI _export DeleteFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); - void WINAPI _export ExitFARW(void); - void WINAPI _export FreeFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); - void WINAPI _export FreeVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); - int WINAPI _export GetFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); - int WINAPI _export GetFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,int OpMode); - int WINAPI _export GetMinFarVersionW(void); - void WINAPI _export GetOpenPluginInfoW(HANDLE hPlugin,struct OpenPluginInfo *Info); - void WINAPI _export GetPluginInfoW(struct PluginInfo *Info); - int WINAPI _export GetVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,const wchar_t *Path); - int WINAPI _export MakeDirectoryW(HANDLE hPlugin,const wchar_t **Name,int OpMode); - HANDLE WINAPI _export OpenFilePluginW(const wchar_t *Name,const unsigned char *Data,int DataSize,int OpMode); - HANDLE WINAPI _export OpenPluginW(int OpenFrom,INT_PTR Item); - int WINAPI _export ProcessDialogEventW(int Event,void *Param); - int WINAPI _export ProcessEditorEventW(int Event,void *Param); - int WINAPI _export ProcessEditorInputW(const INPUT_RECORD *Rec); - int WINAPI _export ProcessEventW(HANDLE hPlugin,int Event,void *Param); - int WINAPI _export ProcessHostFileW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); - int WINAPI _export ProcessKeyW(HANDLE hPlugin,int Key,unsigned int ControlState); - int WINAPI _export ProcessSynchroEventW(int Event,void *Param); - int WINAPI _export ProcessViewerEventW(int Event,void *Param); - int WINAPI _export PutFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *SrcPath,int OpMode); - int WINAPI _export SetDirectoryW(HANDLE hPlugin,const wchar_t *Dir,int OpMode); - int WINAPI _export SetFindListW(HANDLE hPlugin,const struct PluginPanelItem *PanelItem,int ItemsNumber); - void WINAPI _export SetStartupInfoW(const struct PluginStartupInfo *Info); + void WINAPI _export ClosePluginW(HANDLE hPlugin); + int WINAPI _export CompareW(HANDLE hPlugin,const struct PluginPanelItem *Item1,const struct PluginPanelItem *Item2,unsigned int Mode); + int WINAPI _export ConfigureW(int ItemNumber); + int WINAPI _export DeleteFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); + void WINAPI _export ExitFARW(void); + void WINAPI _export FreeFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); + void WINAPI _export FreeVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber); + int WINAPI _export GetFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t **DestPath,int OpMode); + int WINAPI _export GetFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,int OpMode); + int WINAPI _export GetMinFarVersionW(void); + void WINAPI _export GetOpenPluginInfoW(HANDLE hPlugin,struct OpenPluginInfo *Info); + void WINAPI _export GetPluginInfoW(struct PluginInfo *Info); + int WINAPI _export GetVirtualFindDataW(HANDLE hPlugin,struct PluginPanelItem **pPanelItem,int *pItemsNumber,const wchar_t *Path); + int WINAPI _export MakeDirectoryW(HANDLE hPlugin,const wchar_t **Name,int OpMode); + HANDLE WINAPI _export OpenFilePluginW(const wchar_t *Name,const unsigned char *Data,int DataSize,int OpMode); + HANDLE WINAPI _export OpenPluginW(int OpenFrom,INT_PTR Item); + int WINAPI _export ProcessDialogEventW(int Event,void *Param); + int WINAPI _export ProcessEditorEventW(int Event,void *Param); + int WINAPI _export ProcessEditorInputW(const INPUT_RECORD *Rec); + int WINAPI _export ProcessEventW(HANDLE hPlugin,int Event,void *Param); + int WINAPI _export ProcessHostFileW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int OpMode); + int WINAPI _export ProcessKeyW(HANDLE hPlugin,int Key,unsigned int ControlState); + int WINAPI _export ProcessSynchroEventW(int Event,void *Param); + int WINAPI _export ProcessViewerEventW(int Event,void *Param); + int WINAPI _export PutFilesW(HANDLE hPlugin,struct PluginPanelItem *PanelItem,int ItemsNumber,int Move,const wchar_t *SrcPath,int OpMode); + int WINAPI _export SetDirectoryW(HANDLE hPlugin,const wchar_t *Dir,int OpMode); + int WINAPI _export SetFindListW(HANDLE hPlugin,const struct PluginPanelItem *PanelItem,int ItemsNumber); + void WINAPI _export SetStartupInfoW(const struct PluginStartupInfo *Info); EXTERN_C_END */ diff --git a/CPP/7zip/UI/Far/Main.cpp b/CPP/7zip/UI/Far/Main.cpp index 7cd7d5ee..5e017b80 100755 --- a/CPP/7zip/UI/Far/Main.cpp +++ b/CPP/7zip/UI/Far/Main.cpp @@ -366,7 +366,8 @@ static HANDLE MyOpenFilePluginW(const wchar_t *name) // ::OutputDebugStringA("before OpenArchive\n"); - archiveHandler = new CAgent; + CAgent *agent = new CAgent; + archiveHandler = agent; CMyComBSTR archiveType; HRESULT result = archiveHandler->Open(NULL, GetUnicodeString(fullName, CP_OEMCP), UString(), &archiveType, openArchiveCallback); @@ -381,6 +382,10 @@ static HANDLE MyOpenFilePluginW(const wchar_t *name) return INVALID_HANDLE_VALUE; } + UString errorMessage = agent->GetErrorMessage(); + if (!errorMessage.IsEmpty()) + PrintErrorMessage("7-Zip", UnicodeStringToMultiByte(errorMessage, CP_OEMCP)); + // ::OutputDebugStringA("after OpenArchive\n"); CPlugin *plugin = new CPlugin( diff --git a/CPP/7zip/UI/Far/Plugin.cpp b/CPP/7zip/UI/Far/Plugin.cpp index 97627517..a19b037c 100755 --- a/CPP/7zip/UI/Far/Plugin.cpp +++ b/CPP/7zip/UI/Far/Plugin.cpp @@ -326,7 +326,8 @@ static CPROPIDToName kPROPIDToName[] = { kpidSectorSize, NMessageID::kSectorSize }, { kpidPosixAttrib, NMessageID::kPosixAttrib }, { kpidLink, NMessageID::kLink }, - + { kpidError, NMessageID::kError }, + { kpidTotalSize, NMessageID::kTotalSize }, { kpidFreeSpace, NMessageID::kFreeSpace }, { kpidClusterSize, NMessageID::kClusterSize }, @@ -628,17 +629,20 @@ void CPlugin::GetOpenPluginInfo(struct OpenPluginInfo *info) if (getProps->GetArcNumProps(level, &numProps) == S_OK) { InsertSeparator(m_InfoLines, numItems); - for (Int32 i = -2; i < (Int32)numProps && numItems < kNumInfoLinesMax; i++) + for (Int32 i = -3; i < (Int32)numProps && numItems < kNumInfoLinesMax; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; - if (i == -2) - propID = kpidPath; - else if (i == -1) - propID = kpidType; - else if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) - continue; + switch (i) + { + case -3: propID = kpidPath; break; + case -2: propID = kpidType; break; + case -1: propID = kpidError; break; + default: + if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) + continue; + } NCOM::CPropVariant prop; if (getProps->GetArcProp(level, propID, &prop) != S_OK) continue; diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 29c99bfd..6b8fdba2 100755 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -9,6 +9,7 @@ #include "Windows/FileDir.h" #include "Windows/FileFind.h" #include "Windows/Process.h" +#include "Windows/PropVariant.h" #include "Windows/Thread.h" #include "../Common/ExtractingFilePath.h" @@ -113,6 +114,46 @@ HRESULT CPanel::OpenItemAsArchive(IInStream *inStream, _flatMode = _flatModeForArc; + CMyComPtr getFolderArcProps; + _folder.QueryInterface(IID_IGetFolderArcProps, &getFolderArcProps); + if (getFolderArcProps) + { + CMyComPtr arcProps; + getFolderArcProps->GetFolderArcProps(&arcProps); + if (arcProps) + { + UString s; + UInt32 numLevels; + if (arcProps->GetArcNumLevels(&numLevels) != S_OK) + numLevels = 0; + for (UInt32 level2 = 0; level2 < numLevels; level2++) + { + UInt32 level = numLevels - 1 - level2; + PROPID propIDs[] = { kpidError, kpidPath, kpidType } ; + UString values[3]; + for (Int32 i = 0; i < 3; i++) + { + CMyComBSTR name; + NCOM::CPropVariant prop; + if (arcProps->GetArcProp(level, propIDs[i], &prop) != S_OK) + continue; + if (prop.vt != VT_EMPTY) + values[i] = (prop.vt == VT_BSTR) ? prop.bstrVal : L"?"; + } + if (!values[0].IsEmpty()) + { + if (!s.IsEmpty()) + s += L"--------------------\n"; + s += values[0]; s += L"\n\n["; + s += values[2]; s += L"] "; + s += values[1]; s += L"\n"; + } + } + if (!s.IsEmpty()) + MessageBox(s); + } + } + return S_OK; } diff --git a/CPP/7zip/UI/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index c60751b5..549b28da 100755 --- a/CPP/7zip/UI/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -188,17 +188,20 @@ void CPanel::Properties() if (getProps->GetArcNumProps(level, &numProps) == S_OK) { message += kSeparator; - for (Int32 i = -2; i < (Int32)numProps; i++) + for (Int32 i = -3; i < (Int32)numProps; i++) { CMyComBSTR name; PROPID propID; VARTYPE vt; - if (i == -2) - propID = kpidPath; - else if (i == -1) - propID = kpidType; - else if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) - continue; + switch (i) + { + case -3: propID = kpidPath; break; + case -2: propID = kpidType; break; + case -1: propID = kpidError; break; + default: + if (getProps->GetArcPropInfo(level, i, &name, &propID, &vt) != S_OK) + continue; + } NCOM::CPropVariant prop; if (getProps->GetArcProp(level, propID, &prop) != S_OK) continue; diff --git a/CPP/7zip/UI/FileManager/PanelSort.cpp b/CPP/7zip/UI/FileManager/PanelSort.cpp index 7eabc9ef..186315b3 100755 --- a/CPP/7zip/UI/FileManager/PanelSort.cpp +++ b/CPP/7zip/UI/FileManager/PanelSort.cpp @@ -61,17 +61,19 @@ int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) // PROPID propID = panel->_properties[panel->_sortIndex].ID; PROPID propID = panel->_sortID; - NCOM::CPropVariant propVariant1, propVariant2; + NCOM::CPropVariant prop1, prop2; // Name must be first property - panel->_folder->GetProperty((UINT32)lParam1, propID, &propVariant1); - panel->_folder->GetProperty((UINT32)lParam2, propID, &propVariant2); - if (propVariant1.vt != propVariant2.vt) - return 0; // It means some BUG - if (propVariant1.vt == VT_BSTR) + panel->_folder->GetProperty((UINT32)lParam1, propID, &prop1); + panel->_folder->GetProperty((UINT32)lParam2, propID, &prop2); + if (prop1.vt != prop2.vt) { - return _wcsicmp(propVariant1.bstrVal, propVariant2.bstrVal); + return MyCompare(prop1.vt, prop2.vt); } - return propVariant1.Compare(propVariant2); + if (prop1.vt == VT_BSTR) + { + return _wcsicmp(prop1.bstrVal, prop2.bstrVal); + } + return prop1.Compare(prop2); // return 0; } diff --git a/CPP/7zip/UI/FileManager/ProgramLocation.cpp b/CPP/7zip/UI/FileManager/ProgramLocation.cpp index 04c2c98c..ce2d178e 100755 --- a/CPP/7zip/UI/FileManager/ProgramLocation.cpp +++ b/CPP/7zip/UI/FileManager/ProgramLocation.cpp @@ -2,6 +2,8 @@ #include "StdAfx.h" +#include "../../../../C/Types.h" + #include "ProgramLocation.h" #include "Windows/DLL.h" @@ -20,4 +22,3 @@ bool GetProgramFolderPath(UString &folder) folder = folder.Left(pos + 1); return true; } - diff --git a/CPP/7zip/UI/FileManager/PropertyName.cpp b/CPP/7zip/UI/FileManager/PropertyName.cpp index 79b09300..098bc47d 100755 --- a/CPP/7zip/UI/FileManager/PropertyName.cpp +++ b/CPP/7zip/UI/FileManager/PropertyName.cpp @@ -75,6 +75,7 @@ static CPropertyIDNamePair kPropertyIDNamePairs[] = { kpidSectorSize, IDS_PROP_SECTOR_SIZE, 0x02000234 }, { kpidPosixAttrib, IDS_PROP_POSIX_ATTRIB, 0x02000235 }, { kpidLink, IDS_PROP_LINK, 0x02000236 }, + { kpidError, IDS_PROP_ERROR, 0x02000605 }, { kpidTotalSize, IDS_PROP_TOTAL_SIZE, 0x03031100 }, { kpidFreeSpace, IDS_PROP_FREE_SPACE, 0x03031101 }, diff --git a/CPP/7zip/UI/FileManager/PropertyName.rc b/CPP/7zip/UI/FileManager/PropertyName.rc index 576b52cb..bdd6c8ed 100755 --- a/CPP/7zip/UI/FileManager/PropertyName.rc +++ b/CPP/7zip/UI/FileManager/PropertyName.rc @@ -56,4 +56,5 @@ BEGIN IDS_PROP_SECTOR_SIZE "Sector Size" IDS_PROP_POSIX_ATTRIB "Mode" IDS_PROP_LINK "Link" + IDS_PROP_ERROR "Error" END diff --git a/CPP/7zip/UI/FileManager/PropertyNameRes.h b/CPP/7zip/UI/FileManager/PropertyNameRes.h index 00458a24..9cc9f7c5 100755 --- a/CPP/7zip/UI/FileManager/PropertyNameRes.h +++ b/CPP/7zip/UI/FileManager/PropertyNameRes.h @@ -50,3 +50,4 @@ #define IDS_PROP_SECTOR_SIZE 52 #define IDS_PROP_POSIX_ATTRIB 53 #define IDS_PROP_LINK 54 +#define IDS_PROP_ERROR 55 diff --git a/CPP/7zip/UI/GUI/CompressDialog.cpp b/CPP/7zip/UI/GUI/CompressDialog.cpp index ea9d9c2c..da2b7924 100755 --- a/CPP/7zip/UI/GUI/CompressDialog.cpp +++ b/CPP/7zip/UI/GUI/CompressDialog.cpp @@ -1038,7 +1038,13 @@ void CCompressDialog::SetDictionary() if (i == 20 && j > 0) continue; UInt32 dictionary = (1 << i) + (j << (i - 1)); - if (dictionary > (1 << 30)) + if (dictionary > + #ifdef _WIN64 + (1 << 30) + #else + (1 << 29) + #endif + ) continue; AddDictionarySize(dictionary); UInt64 decomprSize; -- cgit v1.2.3