diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2015-01-03 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:53 +0300 |
commit | 0713a3ab803e57401f18432148b4139e5fe6e5dd (patch) | |
tree | b66fd26676cf817f2bc2a889b6123c00da96d6d0 /CPP/7zip | |
parent | 7e021179cd9f46b5bf2d48aac84783ff431dd5ac (diff) |
9.389.38
Diffstat (limited to 'CPP/7zip')
93 files changed, 2268 insertions, 1091 deletions
diff --git a/CPP/7zip/Archive/7z/7zHandler.cpp b/CPP/7zip/Archive/7z/7zHandler.cpp index af673a73..2b86ed22 100644 --- a/CPP/7zip/Archive/7z/7zHandler.cpp +++ b/CPP/7zip/Archive/7z/7zHandler.cpp @@ -321,13 +321,13 @@ STDMETHODIMP CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data if (/* _db.IsTree && propID == kpidName || !_db.IsTree && */ propID == kpidPath) { - const wchar_t *name = _db.GetName(index); - if (name) + if (_db.NameOffsets && _db.NamesBuf) { - size_t size = (_db.NameOffsets[index + 1] - _db.NameOffsets[index]) * 2; + size_t offset = _db.NameOffsets[index]; + size_t size = (_db.NameOffsets[index + 1] - offset) * 2; if (size < ((UInt32)1 << 31)) { - *data = (void *)name; + *data = (const void *)(_db.NamesBuf + offset * 2); *dataSize = (UInt32)size; *propType = NPropDataType::kUtf16z; } @@ -607,7 +607,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val } */ - case kpidPath: return _db.GetPath(index, value); + case kpidPath: return _db.GetPath_Prop(index, value); #ifndef _SFX case kpidMethod: return SetMethodToProp(_db.FileIndexToFolderIndexMap[index2], value); case kpidBlock: diff --git a/CPP/7zip/Archive/7z/7zHandler.h b/CPP/7zip/Archive/7z/7zHandler.h index dad943e0..c33617c4 100644 --- a/CPP/7zip/Archive/7z/7zHandler.h +++ b/CPP/7zip/Archive/7z/7zHandler.h @@ -102,7 +102,7 @@ class CHandler: { public: MY_QUERYINTERFACE_BEGIN2(IInArchive) - // MY_QUERYINTERFACE_ENTRY(IArchiveGetRawProps) + MY_QUERYINTERFACE_ENTRY(IArchiveGetRawProps) #ifdef __7Z_SET_PROPERTIES MY_QUERYINTERFACE_ENTRY(ISetProperties) #endif diff --git a/CPP/7zip/Archive/7z/7zHandlerOut.cpp b/CPP/7zip/Archive/7z/7zHandlerOut.cpp index 2f6a4c37..5e113207 100644 --- a/CPP/7zip/Archive/7z/7zHandlerOut.cpp +++ b/CPP/7zip/Archive/7z/7zHandlerOut.cpp @@ -301,10 +301,7 @@ STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numIt const CFileItem &fi = db->Files[ui.IndexInArchive]; if (!ui.NewProps) { - NCOM::CPropVariant prop; - RINOK(_db.GetPath(ui.IndexInArchive, &prop)); - if (prop.vt == VT_BSTR) - name = prop.bstrVal; + _db.GetPath(ui.IndexInArchive, name); } ui.IsDir = fi.IsDir; ui.Size = fi.Size; diff --git a/CPP/7zip/Archive/7z/7zIn.cpp b/CPP/7zip/Archive/7z/7zIn.cpp index d84cf0b0..4f04aa83 100644 --- a/CPP/7zip/Archive/7z/7zIn.cpp +++ b/CPP/7zip/Archive/7z/7zIn.cpp @@ -2,6 +2,12 @@ #include "StdAfx.h" +#ifdef _WIN32 +#include <wchar.h> +#else +#include <ctype.h> +#endif + #include "../../../../C/7zCrc.h" #include "../../../../C/CpuArch.h" @@ -496,26 +502,83 @@ void CFolders::ParseFolderInfo(unsigned folderIndex, CFolder &folder) const } -HRESULT CDatabase::GetPath(unsigned index, PROPVARIANT *path) const +void CDatabase::GetPath(unsigned index, UString &path) const +{ + path.Empty(); + if (!NameOffsets || !NamesBuf) + return; + + size_t offset = NameOffsets[index]; + size_t size = NameOffsets[index + 1] - offset - 1; + + if (size >= (1 << 20)) + return; + + wchar_t *s = path.GetBuffer((unsigned)size); + + const Byte *p = ((const Byte *)NamesBuf + offset * 2); + + #if defined(_WIN32) && defined(MY_CPU_LE) + + wmemcpy(s, (const wchar_t *)p, size); + + #else + + for (size_t i = 0; i < size; i++) + { + *s = Get16(p); + p += 2; + s++; + } + + #endif + + path.ReleaseBuffer((unsigned)size); +} + +HRESULT CDatabase::GetPath_Prop(unsigned index, PROPVARIANT *path) const throw() { PropVariant_Clear(path); if (!NameOffsets || !NamesBuf) return S_OK; + size_t offset = NameOffsets[index]; + size_t size = NameOffsets[index + 1] - offset; + + if (size >= (1 << 14)) + return S_OK; + + RINOK(PropVarEm_Alloc_Bstr(path, (unsigned)size - 1)); + wchar_t *s = path->bstrVal; + + const Byte *p = ((const Byte *)NamesBuf + offset * 2); + + for (size_t i = 0; i < size; i++) + { + wchar_t c = Get16(p); + p += 2; + #if WCHAR_PATH_SEPARATOR != L'/' + if (c == L'/') + c = WCHAR_PATH_SEPARATOR; + #endif + *s++ = c; + } + + return S_OK; + + /* unsigned cur = index; unsigned size = 0; - // for (int i = 0;; i++) + for (int i = 0;; i++) { size_t len = NameOffsets[cur + 1] - NameOffsets[cur]; size += (unsigned)len; - if (/* i > 256 || */ len > (1 << 12) || size > (1 << 14)) + if (i > 256 || len > (1 << 14) || size > (1 << 14)) return PropVarEm_Set_Str(path, "[TOO-LONG]"); - /* cur = Files[cur].Parent; if (cur < 0) break; - */ } size--; @@ -539,16 +602,13 @@ HRESULT CDatabase::GetPath(unsigned index, PROPVARIANT *path) const *s = c; } while (--len); - /* const CFileItem &file = Files[cur]; cur = file.Parent; if (cur < 0) - */ return S_OK; - /* *(--s) = (file.IsAltStream ? ':' : WCHAR_PATH_SEPARATOR); - */ } + */ } void CInArchive::WaitId(UInt64 id) diff --git a/CPP/7zip/Archive/7z/7zIn.h b/CPP/7zip/Archive/7z/7zIn.h index 1836a06b..373000f7 100644 --- a/CPP/7zip/Archive/7z/7zIn.h +++ b/CPP/7zip/Archive/7z/7zIn.h @@ -111,7 +111,7 @@ struct CDatabase: public CFolders */ CByteBuffer NamesBuf; - CObjArray<size_t> NameOffsets; // numFiles + 1, conatins offsets of UINt16 symbols. + CObjArray<size_t> NameOffsets; // numFiles + 1, offsets of utf-16 symbols /* void ClearSecure() @@ -148,14 +148,15 @@ struct CDatabase: public CFolders bool IsItemAnti(unsigned index) const { return (index < IsAnti.Size() && IsAnti[index]); } // bool IsItemAux(unsigned index) const { return (index < IsAux.Size() && IsAux[index]); } - const wchar_t * GetName(unsigned index) const + const void * GetName(unsigned index) const { if (!NameOffsets || !NamesBuf) return NULL; - return (const wchar_t *)(const Byte *)NamesBuf + NameOffsets[index]; + return (const void *)((const Byte *)NamesBuf + NameOffsets[index] * 2); }; - HRESULT GetPath(unsigned index, PROPVARIANT *path) const; + void GetPath(unsigned index, UString &path) const; + HRESULT GetPath_Prop(unsigned index, PROPVARIANT *path) const throw(); }; struct CInArchiveInfo diff --git a/CPP/7zip/Archive/7z/7zUpdate.cpp b/CPP/7zip/Archive/7z/7zUpdate.cpp index 96befa23..7875ed5b 100644 --- a/CPP/7zip/Archive/7z/7zUpdate.cpp +++ b/CPP/7zip/Archive/7z/7zUpdate.cpp @@ -1018,7 +1018,7 @@ HRESULT Update( else { GetFile(*db, ui.IndexInArchive, file, file2); - name = db->GetName(ui.IndexInArchive); + db->GetPath(ui.IndexInArchive, name); } /* @@ -1152,7 +1152,8 @@ HRESULT Update( CFileItem file; CFileItem2 file2; GetFile(*db, fi, file, file2); - UString name = db->GetName(fi); + UString name; + db->GetPath(fi, name); if (file.HasStream) { indexInFolder++; @@ -1278,7 +1279,7 @@ HRESULT Update( else { GetFile(*db, ui.IndexInArchive, file, file2); - name = db->GetName(ui.IndexInArchive); + db->GetPath(ui.IndexInArchive, name); } if (file2.IsAnti || file.IsDir) return E_FAIL; diff --git a/CPP/7zip/Archive/ApmHandler.cpp b/CPP/7zip/Archive/ApmHandler.cpp index 04cd06fa..96656733 100644 --- a/CPP/7zip/Archive/ApmHandler.cpp +++ b/CPP/7zip/Archive/ApmHandler.cpp @@ -114,6 +114,7 @@ API_FUNC_static_IsArc IsArc_Apm(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} HRESULT CHandler::ReadTables(IInStream *stream) { diff --git a/CPP/7zip/Archive/ArchiveExports.cpp b/CPP/7zip/Archive/ArchiveExports.cpp index c7d6611b..0a520413 100644 --- a/CPP/7zip/Archive/ArchiveExports.cpp +++ b/CPP/7zip/Archive/ArchiveExports.cpp @@ -15,7 +15,7 @@ static unsigned g_NumArcs = 0; static unsigned g_DefaultArcIndex = 0; static const CArcInfo *g_Arcs[kNumArcsMax]; -void RegisterArc(const CArcInfo *arcInfo) +void RegisterArc(const CArcInfo *arcInfo) throw() { if (g_NumArcs < kNumArcsMax) { diff --git a/CPP/7zip/Archive/ArjHandler.cpp b/CPP/7zip/Archive/ArjHandler.cpp index ad44c62a..737b8fc9 100644 --- a/CPP/7zip/Archive/ArjHandler.cpp +++ b/CPP/7zip/Archive/ArjHandler.cpp @@ -160,6 +160,7 @@ API_FUNC_static_IsArc IsArc_Arj(const Byte *p, size_t size) return k_IsArc_Res_YES; } +} static HRESULT ReadString(const Byte *p, unsigned &size, AString &res) { diff --git a/CPP/7zip/Archive/Bz2Handler.cpp b/CPP/7zip/Archive/Bz2Handler.cpp index 704cdc73..a49e8293 100644 --- a/CPP/7zip/Archive/Bz2Handler.cpp +++ b/CPP/7zip/Archive/Bz2Handler.cpp @@ -131,6 +131,7 @@ API_FUNC_static_IsArc IsArc_BZip2(const Byte *p, size_t size) return k_IsArc_Res_YES; return k_IsArc_Res_NO; } +} STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback *) { diff --git a/CPP/7zip/Archive/Common/MultiStream.h b/CPP/7zip/Archive/Common/MultiStream.h index 2a1a4a43..c10cd455 100644 --- a/CPP/7zip/Archive/Common/MultiStream.h +++ b/CPP/7zip/Archive/Common/MultiStream.h @@ -15,14 +15,19 @@ class CMultiStream: UInt64 _pos; UInt64 _totalLength; unsigned _streamIndex; + public: + struct CSubStreamInfo { CMyComPtr<IInStream> Stream; UInt64 Size; UInt64 GlobalOffset; UInt64 LocalPos; + + CSubStreamInfo(): Size(0), GlobalOffset(0), LocalPos(0) {} }; + CObjectVector<CSubStreamInfo> Streams; HRESULT Init() diff --git a/CPP/7zip/Archive/CpioHandler.cpp b/CPP/7zip/Archive/CpioHandler.cpp index 9c1271c4..431d315d 100644 --- a/CPP/7zip/Archive/CpioHandler.cpp +++ b/CPP/7zip/Archive/CpioHandler.cpp @@ -120,10 +120,10 @@ struct CItem UInt64 HeaderPos; bool IsBin() const { return Type == k_Type_BinLe || Type == k_Type_BinBe; } - bool IsCrcFormat() const { return Type == k_Type_HexCrc; }; + bool IsCrcFormat() const { return Type == k_Type_HexCrc; } bool IsDir() const { return (Mode & 0170000) == 0040000; } bool IsTrailer() const { return strcmp(Name, kName_TRAILER) == 0; } - UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; }; + UInt64 GetDataPosition() const { return HeaderPos + HeaderSize; } }; enum EErrorType @@ -273,6 +273,7 @@ API_FUNC_static_IsArc IsArc_Cpio(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} #define READ_STREAM(_dest_, _size_) \ { size_t processed = (_size_); RINOK(Read(_dest_, &processed)); \ diff --git a/CPP/7zip/Archive/DllExports.cpp b/CPP/7zip/Archive/DllExports.cpp index fa40d024..37f53cd7 100644 --- a/CPP/7zip/Archive/DllExports.cpp +++ b/CPP/7zip/Archive/DllExports.cpp @@ -2,6 +2,10 @@ #include "StdAfx.h" +#if defined(_7ZIP_LARGE_PAGES) +#include "../../../C/Alloc.h" +#endif + #include "../../Common/MyInitGuid.h" #include "../../Common/ComTry.h" @@ -40,7 +44,7 @@ STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject) STDAPI SetLargePageMode() { - #if defined(_WIN32) && defined(_7ZIP_LARGE_PAGES) + #if defined(_7ZIP_LARGE_PAGES) SetLargePageSize(); #endif return S_OK; diff --git a/CPP/7zip/Archive/DllExports2.cpp b/CPP/7zip/Archive/DllExports2.cpp index beb758a2..aa023524 100644 --- a/CPP/7zip/Archive/DllExports2.cpp +++ b/CPP/7zip/Archive/DllExports2.cpp @@ -4,7 +4,7 @@ #include "../../Common/MyInitGuid.h" -#if defined(_WIN32) && defined(_7ZIP_LARGE_PAGES) +#if defined(_7ZIP_LARGE_PAGES) #include "../../../C/Alloc.h" #endif @@ -67,7 +67,7 @@ STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject) STDAPI SetLargePageMode() { - #if defined(_WIN32) && defined(_7ZIP_LARGE_PAGES) + #if defined(_7ZIP_LARGE_PAGES) SetLargePageSize(); #endif return S_OK; diff --git a/CPP/7zip/Archive/ElfHandler.cpp b/CPP/7zip/Archive/ElfHandler.cpp index 1736219f..5e378ba8 100644 --- a/CPP/7zip/Archive/ElfHandler.cpp +++ b/CPP/7zip/Archive/ElfHandler.cpp @@ -641,8 +641,8 @@ static const STATPROPSTG kProps[] = { NULL, kpidVa, VT_UI8 }, { NULL, kpidType, VT_BSTR }, { NULL, kpidCharacts, VT_BSTR } - , { L"Link Section", kpidLinkSection, VT_BSTR} - , { L"Info Section", kpidInfoSection, VT_BSTR} + , { (LPOLESTR)L"Link Section", kpidLinkSection, VT_BSTR} + , { (LPOLESTR)L"Info Section", kpidInfoSection, VT_BSTR} }; IMP_IInArchive_Props_WITH_NAME diff --git a/CPP/7zip/Archive/FatHandler.cpp b/CPP/7zip/Archive/FatHandler.cpp index 51064a1a..970330cc 100644 --- a/CPP/7zip/Archive/FatHandler.cpp +++ b/CPP/7zip/Archive/FatHandler.cpp @@ -118,6 +118,7 @@ API_FUNC_static_IsArc IsArc_Fat(const Byte *p, size_t size) CHeader h; return h.Parse(p) ? k_IsArc_Res_YES : k_IsArc_Res_NO; } +} bool CHeader::Parse(const Byte *p) { @@ -801,12 +802,12 @@ static const STATPROPSTG kArcProps[] = { NULL, kpidMTime, VT_FILETIME}, { NULL, kpidVolumeName, VT_BSTR}, - { L"FATs", kpidNumFats, VT_UI4}, + { (LPOLESTR)L"FATs", kpidNumFats, VT_UI4}, { NULL, kpidSectorSize, VT_UI4}, { NULL, kpidId, VT_UI4}, - // { L"OEM Name", kpidOemName, VT_BSTR}, - // { L"Volume Name", kpidVolName, VT_BSTR}, - // { L"File System Type", kpidFileSysType, VT_BSTR} + // { (LPOLESTR)L"OEM Name", kpidOemName, VT_BSTR}, + // { (LPOLESTR)L"Volume Name", kpidVolName, VT_BSTR}, + // { (LPOLESTR)L"File System Type", kpidFileSysType, VT_BSTR} // { NULL, kpidSectorsPerTrack, VT_UI4}, // { NULL, kpidNumHeads, VT_UI4}, // { NULL, kpidHiddenSectors, VT_UI4} diff --git a/CPP/7zip/Archive/GzHandler.cpp b/CPP/7zip/Archive/GzHandler.cpp index 69b3c3be..766cefbf 100644 --- a/CPP/7zip/Archive/GzHandler.cpp +++ b/CPP/7zip/Archive/GzHandler.cpp @@ -318,6 +318,7 @@ API_FUNC_static_IsArc IsArc_Gz(const Byte *p, size_t size) return Is_Deflate(p, size); } +} HRESULT CItem::ReadHeader(NDecoder::CCOMCoder *stream) { diff --git a/CPP/7zip/Archive/IArchive.h b/CPP/7zip/Archive/IArchive.h index 63e16ac3..a57a9b8f 100644 --- a/CPP/7zip/Archive/IArchive.h +++ b/CPP/7zip/Archive/IArchive.h @@ -183,17 +183,26 @@ Notes: Some IInArchive handlers will work incorrectly in that case. */ +/* MSVC allows the code where there is throw() in declaration of function, + but there is no throw() in definition of function. */ + +#ifdef _MSC_VER + #define MY_NO_THROW_DECL_ONLY throw() +#else + #define MY_NO_THROW_DECL_ONLY +#endif + #define INTERFACE_IInArchive(x) \ - STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition, IArchiveOpenCallback *openCallback) throw() x; \ - STDMETHOD(Close)() throw() x; \ - STDMETHOD(GetNumberOfItems)(UInt32 *numItems) throw() x; \ - STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) throw() x; \ - STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems, Int32 testMode, IArchiveExtractCallback *extractCallback) throw() x; \ - STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) throw() x; \ - STDMETHOD(GetNumberOfProperties)(UInt32 *numProps) throw() x; \ - STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) throw() x; \ - STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProps) throw() x; \ - STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) throw() x; + STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition, IArchiveOpenCallback *openCallback) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(Close)() MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetNumberOfItems)(UInt32 *numItems) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems, Int32 testMode, IArchiveExtractCallback *extractCallback) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetNumberOfProperties)(UInt32 *numProps) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProps) MY_NO_THROW_DECL_ONLY x; \ + STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) MY_NO_THROW_DECL_ONLY x; ARCHIVE_INTERFACE(IInArchive, 0x60) { @@ -444,7 +453,7 @@ ARCHIVE_INTERFACE(IArchiveAllowTail, 0x05) // #define k_IsArc_Res_YES_LOW_PROB 3 #define API_FUNC_IsArc EXTERN_C UInt32 WINAPI -#define API_FUNC_static_IsArc EXTERN_C static UInt32 WINAPI +#define API_FUNC_static_IsArc extern "C" { static UInt32 WINAPI extern "C" { diff --git a/CPP/7zip/Archive/IhexHandler.cpp b/CPP/7zip/Archive/IhexHandler.cpp index bc468401..00816f0c 100644 --- a/CPP/7zip/Archive/IhexHandler.cpp +++ b/CPP/7zip/Archive/IhexHandler.cpp @@ -219,6 +219,7 @@ API_FUNC_static_IsArc IsArc_Ihex(const Byte *p, size_t size) return k_IsArc_Res_YES; } +} STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback *) { diff --git a/CPP/7zip/Archive/Iso/IsoHandler.cpp b/CPP/7zip/Archive/Iso/IsoHandler.cpp index eaa94bd8..aef920b0 100644 --- a/CPP/7zip/Archive/Iso/IsoHandler.cpp +++ b/CPP/7zip/Archive/Iso/IsoHandler.cpp @@ -88,7 +88,7 @@ static void AddString(AString &s, const char *name, const Byte *p, unsigned size } } -#define ADD_STRING(n, v) AddString(s, n, vol. ## v, sizeof(vol. ## v)) +#define ADD_STRING(n, v) AddString(s, n, vol. v, sizeof(vol. v)) static void AddErrorMessage(AString &s, const char *message) { diff --git a/CPP/7zip/Archive/LzhHandler.cpp b/CPP/7zip/Archive/LzhHandler.cpp index 74f713f6..ef4b4196 100644 --- a/CPP/7zip/Archive/LzhHandler.cpp +++ b/CPP/7zip/Archive/LzhHandler.cpp @@ -73,6 +73,7 @@ API_FUNC_static_IsArc IsArc_Lzh(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} struct CItem { diff --git a/CPP/7zip/Archive/LzmaHandler.cpp b/CPP/7zip/Archive/LzmaHandler.cpp index d1e19677..04aa4685 100644 --- a/CPP/7zip/Archive/LzmaHandler.cpp +++ b/CPP/7zip/Archive/LzmaHandler.cpp @@ -332,6 +332,7 @@ API_FUNC_static_IsArc IsArc_Lzma(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} API_FUNC_static_IsArc IsArc_Lzma86(const Byte *p, size_t size) { @@ -342,6 +343,7 @@ API_FUNC_static_IsArc IsArc_Lzma86(const Byte *p, size_t size) return k_IsArc_Res_NO; return IsArc_Lzma(p + 1, size - 1); } +} STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *, IArchiveOpenCallback *) { diff --git a/CPP/7zip/Archive/MbrHandler.cpp b/CPP/7zip/Archive/MbrHandler.cpp index 309bc286..abc981f3 100644 --- a/CPP/7zip/Archive/MbrHandler.cpp +++ b/CPP/7zip/Archive/MbrHandler.cpp @@ -342,9 +342,9 @@ static const STATPROPSTG kProps[] = { NULL, kpidSize, VT_UI8}, { NULL, kpidFileSystem, VT_BSTR}, { NULL, kpidOffset, VT_UI8}, - { L"Primary", kpidPrimary, VT_BOOL}, - { L"Begin CHS", kpidBegChs, VT_BSTR}, - { L"End CHS", kpidEndChs, VT_BSTR} + { (LPOLESTR)L"Primary", kpidPrimary, VT_BOOL}, + { (LPOLESTR)L"Begin CHS", kpidBegChs, VT_BSTR}, + { (LPOLESTR)L"End CHS", kpidEndChs, VT_BSTR} }; IMP_IInArchive_Props_WITH_NAME diff --git a/CPP/7zip/Archive/Nsis/NsisDecode.h b/CPP/7zip/Archive/Nsis/NsisDecode.h index 2ccaaf65..0b95d4b2 100644 --- a/CPP/7zip/Archive/Nsis/NsisDecode.h +++ b/CPP/7zip/Archive/Nsis/NsisDecode.h @@ -63,7 +63,7 @@ public: } - HRESULT CDecoder::SetToPos(UInt64 pos, ICompressProgressInfo *progress); // for solid + HRESULT SetToPos(UInt64 pos, ICompressProgressInfo *progress); // for solid HRESULT Decode(CByteBuffer *outBuf, bool unpackSizeDefined, UInt32 unpackSize, ISequentialOutStream *realOutStream, ICompressProgressInfo *progress, UInt32 &packSizeRes, UInt32 &unpackSizeRes); diff --git a/CPP/7zip/Archive/Nsis/NsisHandler.cpp b/CPP/7zip/Archive/Nsis/NsisHandler.cpp index 868ca6cb..233edd52 100644 --- a/CPP/7zip/Archive/Nsis/NsisHandler.cpp +++ b/CPP/7zip/Archive/Nsis/NsisHandler.cpp @@ -582,13 +582,13 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems, if (!dataError) { - UInt32 unpackSize = 0; - bool unpackSize_Defined = false; + // UInt32 unpackSize = 0; + // bool unpackSize_Defined = false; bool writeToTemp1 = writeToTemp; if (item.IsUninstaller) { - unpackSize = item.PatchSize; - unpackSize_Defined = true; + // unpackSize = item.PatchSize; + // unpackSize_Defined = true; if (!readFromTemp) writeToTemp = true; writeToTemp1 = writeToTemp; diff --git a/CPP/7zip/Archive/Nsis/NsisIn.cpp b/CPP/7zip/Archive/Nsis/NsisIn.cpp index 71791c03..dc570ec2 100644 --- a/CPP/7zip/Archive/Nsis/NsisIn.cpp +++ b/CPP/7zip/Archive/Nsis/NsisIn.cpp @@ -3777,7 +3777,7 @@ HRESULT CInArchive::ReadEntries(const CBlockHeader &bh) for (UInt32 j = i - 1; j >= kkk + 3; j--) { - const Byte *pCmd = p - kCmdSize * (kkk - j); + const Byte *pCmd = p + kCmdSize * (j - kkk); AddParam(GET_CMD_PARAM(pCmd, 0)); } NewLine(); diff --git a/CPP/7zip/Archive/NtfsHandler.cpp b/CPP/7zip/Archive/NtfsHandler.cpp index dfe5eade..6661492f 100644 --- a/CPP/7zip/Archive/NtfsHandler.cpp +++ b/CPP/7zip/Archive/NtfsHandler.cpp @@ -97,11 +97,11 @@ bool CHeader::Parse(const Byte *p) if (p[0x1FE] != 0x55 || p[0x1FF] != 0xAA) return false; - int codeOffset = 0; + // int codeOffset = 0; switch (p[0]) { - case 0xE9: codeOffset = 3 + (Int16)Get16(p + 1); break; - case 0xEB: if (p[2] != 0x90) return false; codeOffset = 2 + (int)(signed char)p[1]; break; + case 0xE9: /* codeOffset = 3 + (Int16)Get16(p + 1); */ break; + case 0xEB: if (p[2] != 0x90) return false; /* codeOffset = 2 + (int)(signed char)p[1]; */ break; default: return false; } unsigned sectorsPerClusterLog; @@ -2175,20 +2175,20 @@ static const STATPROPSTG kProps[] = // { NULL, kpidLink, VT_BSTR}, - // { L"Link 2", kpidLink2, VT_BSTR}, - // { L"Link Type", kpidLinkType, VT_UI2}, + // { (LPOLESTR)L"Link 2", kpidLink2, VT_BSTR}, + // { (LPOLESTR)L"Link Type", kpidLinkType, VT_UI2}, { NULL, kpidINode, VT_UI8}, { NULL, kpidMTime, VT_FILETIME}, { NULL, kpidCTime, VT_FILETIME}, { NULL, kpidATime, VT_FILETIME}, - // { L"Record Modified", kpidRecMTime, VT_FILETIME}, + // { (LPOLESTR)L"Record Modified", kpidRecMTime, VT_FILETIME}, - // { L"Modified 2", kpidMTime2, VT_FILETIME}, - // { L"Created 2", kpidCTime2, VT_FILETIME}, - // { L"Accessed 2", kpidATime2, VT_FILETIME}, - // { L"Record Modified 2", kpidRecMTime2, VT_FILETIME}, + // { (LPOLESTR)L"Modified 2", kpidMTime2, VT_FILETIME}, + // { (LPOLESTR)L"Created 2", kpidCTime2, VT_FILETIME}, + // { (LPOLESTR)L"Accessed 2", kpidATime2, VT_FILETIME}, + // { (LPOLESTR)L"Record Modified 2", kpidRecMTime2, VT_FILETIME}, { NULL, kpidAttrib, VT_UI4}, { NULL, kpidNumBlocks, VT_UI4}, @@ -2223,7 +2223,7 @@ static const STATPROPSTG kArcProps[] = { NULL, kpidFileSystem, VT_BSTR}, { NULL, kpidClusterSize, VT_UI4}, { NULL, kpidSectorSize, VT_UI4}, - { L"Record Size", kpidRecordSize, VT_UI4}, + { (LPOLESTR)L"Record Size", kpidRecordSize, VT_UI4}, { NULL, kpidHeadersSize, VT_UI8}, { NULL, kpidCTime, VT_FILETIME}, { NULL, kpidId, VT_UI8}, diff --git a/CPP/7zip/Archive/PeHandler.cpp b/CPP/7zip/Archive/PeHandler.cpp index 08bcd062..ae7553df 100644 --- a/CPP/7zip/Archive/PeHandler.cpp +++ b/CPP/7zip/Archive/PeHandler.cpp @@ -784,27 +784,27 @@ static const STATPROPSTG kArcProps[] = { NULL, kpidChecksum, VT_UI4}, { NULL, kpidName, VT_BSTR}, - { L"Image Size", kpidImageSize, VT_UI4}, - { L"Section Alignment", kpidSectAlign, VT_UI4}, - { L"File Alignment", kpidFileAlign, VT_UI4}, - { L"Code Size", kpidCodeSize, VT_UI4}, - { L"Initialized Data Size", kpidInitDataSize, VT_UI4}, - { L"Uninitialized Data Size", kpidUnInitDataSize, VT_UI4}, - { L"Linker Version", kpidLinkerVer, VT_BSTR}, - { L"OS Version", kpidOsVer, VT_BSTR}, - { L"Image Version", kpidImageVer, VT_BSTR}, - { L"Subsystem Version", kpidSubsysVer, VT_BSTR}, - { L"Subsystem", kpidSubSystem, VT_BSTR}, - { L"DLL Characteristics", kpidDllCharacts, VT_BSTR}, - { L"Stack Reserve", kpidStackReserve, VT_UI8}, - { L"Stack Commit", kpidStackCommit, VT_UI8}, - { L"Heap Reserve", kpidHeapReserve, VT_UI8}, - { L"Heap Commit", kpidHeapCommit, VT_UI8}, - { L"Image Base", kpidImageBase, VT_UI8}, + { (LPOLESTR)L"Image Size", kpidImageSize, VT_UI4}, + { (LPOLESTR)L"Section Alignment", kpidSectAlign, VT_UI4}, + { (LPOLESTR)L"File Alignment", kpidFileAlign, VT_UI4}, + { (LPOLESTR)L"Code Size", kpidCodeSize, VT_UI4}, + { (LPOLESTR)L"Initialized Data Size", kpidInitDataSize, VT_UI4}, + { (LPOLESTR)L"Uninitialized Data Size", kpidUnInitDataSize, VT_UI4}, + { (LPOLESTR)L"Linker Version", kpidLinkerVer, VT_BSTR}, + { (LPOLESTR)L"OS Version", kpidOsVer, VT_BSTR}, + { (LPOLESTR)L"Image Version", kpidImageVer, VT_BSTR}, + { (LPOLESTR)L"Subsystem Version", kpidSubsysVer, VT_BSTR}, + { (LPOLESTR)L"Subsystem", kpidSubSystem, VT_BSTR}, + { (LPOLESTR)L"DLL Characteristics", kpidDllCharacts, VT_BSTR}, + { (LPOLESTR)L"Stack Reserve", kpidStackReserve, VT_UI8}, + { (LPOLESTR)L"Stack Commit", kpidStackCommit, VT_UI8}, + { (LPOLESTR)L"Heap Reserve", kpidHeapReserve, VT_UI8}, + { (LPOLESTR)L"Heap Commit", kpidHeapCommit, VT_UI8}, + { (LPOLESTR)L"Image Base", kpidImageBase, VT_UI8}, { NULL, kpidComment, VT_BSTR}, - // { L"Address Of Entry Point", kpidAddressOfEntryPoint, VT_UI8}, - // { L"Base Of Code", kpidBaseOfCode, VT_UI8}, - // { L"Base Of Data", kpidBaseOfData32, VT_UI8}, + // { (LPOLESTR)L"Address Of Entry Point", kpidAddressOfEntryPoint, VT_UI8}, + // { (LPOLESTR)L"Base Of Code", kpidBaseOfCode, VT_UI8}, + // { (LPOLESTR)L"Base Of Data", kpidBaseOfData32, VT_UI8}, }; static const Byte kProps[] = @@ -2089,6 +2089,7 @@ API_FUNC_static_IsArc IsArc_Pe(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *callback) { @@ -2719,6 +2720,7 @@ API_FUNC_static_IsArc IsArc_Te(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} struct CSection @@ -2799,8 +2801,8 @@ static const STATPROPSTG kArcProps[] = { // { NULL, kpidHeadersSize, VT_UI4 }, { NULL, kpidCpu, VT_BSTR}, - { L"Subsystem", kpidSubSystem, VT_BSTR }, - // { L"Image Base", kpidImageBase, VT_UI8 } + { (LPOLESTR)L"Subsystem", kpidSubSystem, VT_BSTR }, + // { (LPOLESTR)L"Image Base", kpidImageBase, VT_UI8 } }; IMP_IInArchive_Props diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp index d54995ef..c26d72f9 100644 --- a/CPP/7zip/Archive/Rar/RarHandler.cpp +++ b/CPP/7zip/Archive/Rar/RarHandler.cpp @@ -359,7 +359,7 @@ static int ReadTime(const Byte *p, unsigned size, Byte mask, CRarTime &rarTime) #define READ_TIME_2(_mask_, _def_, _ttt_) \ _def_ = ((_mask_ & 8) != 0); if (_def_) \ { if (size < 4) return false; \ - _ttt_ ## .DosTime = Get32(p); p += 4; size -= 4; \ + _ttt_ .DosTime = Get32(p); p += 4; size -= 4; \ READ_TIME(_mask_, _ttt_); } \ bool CInArchive::ReadHeaderReal(const Byte *p, unsigned size, CItem &item) diff --git a/CPP/7zip/Archive/SquashfsHandler.cpp b/CPP/7zip/Archive/SquashfsHandler.cpp index 617a1d66..1f70bb8e 100644 --- a/CPP/7zip/Archive/SquashfsHandler.cpp +++ b/CPP/7zip/Archive/SquashfsHandler.cpp @@ -801,6 +801,8 @@ struct CItem int Node; int Parent; UInt32 Ptr; + + CItem(): Node(-1), Parent(-1), Ptr(0) {} }; struct CData @@ -1198,7 +1200,7 @@ HRESULT CHandler::Decompress(ISequentialOutStream *outStream, Byte *outBuf, bool { ECoderStatus status; XzUnpacker_Init(&_xz); - SRes res = XzUnpacker_Code(&_xz, dest, &destLen, _inputBuffer, &srcLen, LZMA_FINISH_END, &status); + SRes res = XzUnpacker_Code(&_xz, dest, &destLen, _inputBuffer, &srcLen, CODER_FINISH_END, &status); if (res != 0) return SResToHRESULT(res); if (status != CODER_STATUS_NEEDS_MORE_INPUT || !XzUnpacker_IsStreamWasFinished(&_xz)) diff --git a/CPP/7zip/Archive/SwfHandler.cpp b/CPP/7zip/Archive/SwfHandler.cpp index 7cfea330..85c61fe2 100644 --- a/CPP/7zip/Archive/SwfHandler.cpp +++ b/CPP/7zip/Archive/SwfHandler.cpp @@ -61,6 +61,7 @@ API_FUNC_static_IsArc IsArc_Swf(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} API_FUNC_static_IsArc IsArc_Swfc(const Byte *p, size_t size) { @@ -100,6 +101,7 @@ API_FUNC_static_IsArc IsArc_Swfc(const Byte *p, size_t size) return k_IsArc_Res_YES; } +} struct CItem { diff --git a/CPP/7zip/Archive/Tar/TarHandler.cpp b/CPP/7zip/Archive/Tar/TarHandler.cpp index fc7de5ae..5b587529 100644 --- a/CPP/7zip/Archive/Tar/TarHandler.cpp +++ b/CPP/7zip/Archive/Tar/TarHandler.cpp @@ -226,6 +226,7 @@ STDMETHODIMP CHandler::OpenSeq(ISequentialInStream *stream) { Close(); _seqStream = stream; + _isArc = true; return S_OK; } diff --git a/CPP/7zip/Archive/UefiHandler.cpp b/CPP/7zip/Archive/UefiHandler.cpp index 2aaf7d8f..a6760b36 100644 --- a/CPP/7zip/Archive/UefiHandler.cpp +++ b/CPP/7zip/Archive/UefiHandler.cpp @@ -556,7 +556,7 @@ struct CCapsuleHeader UInt32 OffsetToLongDescription; UInt32 OffsetToApplicableDevices; - void Clear() { memset(this, 0, sizeof(this)); } + void Clear() { memset(this, 0, sizeof(*this)); } void Parse(const Byte *p) { diff --git a/CPP/7zip/Archive/VhdHandler.cpp b/CPP/7zip/Archive/VhdHandler.cpp index 5268bd0b..a2126811 100644 --- a/CPP/7zip/Archive/VhdHandler.cpp +++ b/CPP/7zip/Archive/VhdHandler.cpp @@ -612,10 +612,10 @@ static const STATPROPSTG kArcProps[] = { NULL, kpidCTime, VT_FILETIME}, { NULL, kpidClusterSize, VT_UI8}, { NULL, kpidMethod, VT_BSTR}, - { L"Parent", kpidParent, VT_BSTR}, + { (LPOLESTR)L"Parent", kpidParent, VT_BSTR}, { NULL, kpidCreatorApp, VT_BSTR}, { NULL, kpidHostOS, VT_BSTR}, - { L"Saved State", kpidSavedState, VT_BOOL}, + { (LPOLESTR)L"Saved State", kpidSavedState, VT_BOOL}, { NULL, kpidId, VT_BSTR} }; diff --git a/CPP/7zip/Archive/Wim/WimHandler.cpp b/CPP/7zip/Archive/Wim/WimHandler.cpp index 6f0b10e2..886d8d77 100644 --- a/CPP/7zip/Archive/Wim/WimHandler.cpp +++ b/CPP/7zip/Archive/Wim/WimHandler.cpp @@ -63,8 +63,8 @@ static const STATPROPSTG kArcProps[] = { NULL, kpidIsVolume, VT_BOOL}, { NULL, kpidVolume, VT_UI4}, { NULL, kpidNumVolumes, VT_UI4}, - { L"Images", kpidNumImages, VT_UI4}, - { L"Boot Image", kpidBootImage, VT_UI4} + { (LPOLESTR)L"Images", kpidNumImages, VT_UI4}, + { (LPOLESTR)L"Boot Image", kpidBootImage, VT_UI4} }; static const char *kMethodLZX = "LZX"; diff --git a/CPP/7zip/Archive/ZHandler.cpp b/CPP/7zip/Archive/ZHandler.cpp index 459f3e35..7635f22d 100644 --- a/CPP/7zip/Archive/ZHandler.cpp +++ b/CPP/7zip/Archive/ZHandler.cpp @@ -100,6 +100,7 @@ API_FUNC_static_IsArc IsArc_Z(const Byte *p, size_t size) return k_IsArc_Res_NO; return k_IsArc_Res_YES; } +} STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 * /* maxCheckStartPosition */, diff --git a/CPP/7zip/Bundles/Alone/Alone.dsp b/CPP/7zip/Bundles/Alone/Alone.dsp index 017a3f1b..40f87879 100644 --- a/CPP/7zip/Bundles/Alone/Alone.dsp +++ b/CPP/7zip/Bundles/Alone/Alone.dsp @@ -462,6 +462,10 @@ SOURCE=..\..\..\Windows\FileIO.h # End Source File # Begin Source File +SOURCE=..\..\..\Windows\FileLink.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\Windows\FileName.cpp # End Source File # Begin Source File diff --git a/CPP/7zip/Bundles/Alone7z/Alone.dsp b/CPP/7zip/Bundles/Alone7z/Alone.dsp new file mode 100644 index 00000000..2800ff88 --- /dev/null +++ b/CPP/7zip/Bundles/Alone7z/Alone.dsp @@ -0,0 +1,1801 @@ +# Microsoft Developer Studio Project File - Name="Alone" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=Alone - Win32 DebugU +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Alone.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Alone.mak" CFG="Alone - Win32 DebugU" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Alone - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Alone - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "Alone - Win32 ReleaseU" (based on "Win32 (x86) Console Application") +!MESSAGE "Alone - Win32 DebugU" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Alone - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /Yu"StdAfx.h" /FD /c +# ADD BASE RSC /l 0x419 /d "NDEBUG" +# ADD RSC /l 0x419 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# 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 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 /subsystem:console /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 /subsystem:console /machine:I386 /out:"c:\UTIL\7zr.exe" /opt:NOWIN98 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /Gz /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /Yu"StdAfx.h" /FD /GZ /c +# ADD BASE RSC /l 0x419 /d "_DEBUG" +# ADD RSC /l 0x419 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# 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 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 /subsystem:console /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 /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7zr.exe" /pdbtype:sept + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "ReleaseU" +# PROP BASE Intermediate_Dir "ReleaseU" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "ReleaseU" +# PROP Intermediate_Dir "ReleaseU" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /Yu"StdAfx.h" /FD /c +# ADD CPP /nologo /Gz /MD /W4 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_CONSOLE" /Yu"StdAfx.h" /FD /c +# ADD BASE RSC /l 0x419 /d "NDEBUG" +# ADD RSC /l 0x419 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# 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 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 /subsystem:console /machine:I386 /out:"c:\UTIL\7za.exe" /opt:NOWIN98 +# SUBTRACT BASE LINK32 /pdb:none +# 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 /subsystem:console /machine:I386 /out:"c:\UTIL\7zr.exe" /opt:NOWIN98 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "DebugU" +# PROP BASE Intermediate_Dir "DebugU" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "DebugU" +# PROP Intermediate_Dir "DebugU" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c +# ADD CPP /nologo /Gz /MDd /W4 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_CONSOLE" /Yu"StdAfx.h" /FD /GZ /c +# ADD BASE RSC /l 0x419 /d "_DEBUG" +# ADD RSC /l 0x419 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# 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 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 /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7za.exe" /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 /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7zr.exe" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "Alone - Win32 Release" +# Name "Alone - Win32 Debug" +# Name "Alone - Win32 ReleaseU" +# Name "Alone - Win32 DebugU" +# Begin Group "Console" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\UI\Console\ArError.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\BenchCon.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\BenchCon.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\CompressionMode.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\ConsoleClose.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\ConsoleClose.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\ExtractCallbackConsole.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\ExtractCallbackConsole.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\HashCon.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\HashCon.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\List.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\List.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\Main.cpp +# ADD CPP /D "PROG_VARIANT_R" +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\MainAr.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\OpenCallbackConsole.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\OpenCallbackConsole.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\PercentPrinter.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\PercentPrinter.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\UpdateCallbackConsole.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\UpdateCallbackConsole.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\UserInputUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Console\UserInputUtils.h +# End Source File +# End Group +# Begin Group "Spec" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\resource.rc +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"StdAfx.h" +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Common" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\Common\AutoPtr.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Buffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\CommandLineParser.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\CommandLineParser.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ComTry.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\CRC.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\CrcReg.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Defs.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\DynamicBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\IntToString.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\IntToString.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ListFileUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\ListFileUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyCom.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyException.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyGuidDef.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyInitGuid.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyString.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyString.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyUnknown.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyVector.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\MyVector.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\NewHandler.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\NewHandler.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Sha256Reg.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdInStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdInStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdOutStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StdOutStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringConvert.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringConvert.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringToInt.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\StringToInt.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Types.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\UTFConvert.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\UTFConvert.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Wildcard.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\Wildcard.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Common\XzCrc64Reg.cpp +# End Source File +# End Group +# Begin Group "Windows" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\Windows\Defs.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Device.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\DLL.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\DLL.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\ErrorMsg.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\ErrorMsg.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileDir.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileDir.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileFind.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileFind.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileIO.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileIO.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileLink.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileMapping.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileName.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\FileName.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Handle.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\MemoryLock.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\MemoryLock.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\PropVariant.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\PropVariant.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\PropVariantConv.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\PropVariantConv.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Synchronization.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Synchronization.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\System.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\System.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\Thread.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\TimeUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\Windows\TimeUtils.h +# End Source File +# End Group +# Begin Group "7zip Common" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Common\CreateCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\CreateCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\CrossThreadProgress.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\CrossThreadProgress.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\CWrappers.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\CWrappers.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FilePathAutoRename.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FilePathAutoRename.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FileStreams.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FileStreams.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FilterCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\FilterCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\InBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\InBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\InOutTempBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\InOutTempBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\LimitedStreams.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\LimitedStreams.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\LockedStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\LockedStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\MethodId.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\MethodId.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\MethodProps.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\MethodProps.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\OffsetStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\OffsetStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\OutBuffer.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\OutBuffer.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\ProgressUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\ProgressUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\PropId.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\RegisterArc.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\RegisterCodec.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamBinder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamBinder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamObjects.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamObjects.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\StreamUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\UniqBlocks.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\UniqBlocks.h +# End Source File +# Begin Source File + +SOURCE=..\..\Common\VirtThread.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Common\VirtThread.h +# End Source File +# End Group +# Begin Group "Compress" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Compress\Bcj2Coder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Bcj2Coder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Bcj2Register.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BcjCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BcjCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BcjRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BranchCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BranchCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BranchMisc.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BranchMisc.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\BranchRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\ByteSwap.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\ByteSwap.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\CopyCoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\CopyCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\CopyRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\DeltaFilter.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Lzma2Decoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Lzma2Decoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Lzma2Encoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Lzma2Encoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\Lzma2Register.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\LzmaDecoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\LzmaDecoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\LzmaEncoder.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\LzmaEncoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\LzmaRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\RangeCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\Compress\RangeCoderBit.h +# End Source File +# End Group +# Begin Group "Archive" + +# PROP Default_Filter "" +# Begin Group "7z" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Archive\7z\7zCompressionMode.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zCompressionMode.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zDecode.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zDecode.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zEncode.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zEncode.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zExtract.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zFolderInStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zFolderInStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zFolderOutStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zFolderOutStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zHandler.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zHandler.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zHandlerOut.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zHeader.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zHeader.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zIn.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zIn.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zItem.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zOut.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zOut.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zProperties.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zProperties.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zSpecStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zSpecStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zUpdate.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\7z\7zUpdate.h +# End Source File +# End Group +# Begin Group "Archive Common" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Archive\Common\CoderMixer2.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\CoderMixer2.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\CoderMixer2MT.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\CoderMixer2MT.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\DummyOutStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\DummyOutStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\HandlerOut.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\HandlerOut.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\InStreamWithCRC.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\InStreamWithCRC.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\ItemNameUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\ItemNameUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\MultiStream.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\MultiStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\OutStreamWithCRC.h +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\ParseProperties.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\Common\ParseProperties.h +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\Archive\LzmaHandler.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\SplitHandler.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Archive\XzHandler.cpp +# End Source File +# End Group +# Begin Group "UI Common" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveCommandLine.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveCommandLine.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveExtractCallback.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveExtractCallback.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ArchiveOpenCallback.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Bench.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Bench.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\DefaultName.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\DefaultName.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\EnumDirItems.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\EnumDirItems.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Extract.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Extract.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ExtractingFilePath.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\ExtractingFilePath.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\HashCalc.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\HashCalc.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\LoadCodecs.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\LoadCodecs.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\OpenArchive.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\OpenArchive.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Property.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\PropIDUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\PropIDUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\SetProperties.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\SetProperties.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\SortUtils.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\SortUtils.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\TempFiles.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\TempFiles.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Update.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\Update.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateAction.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateAction.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateCallback.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateCallback.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdatePair.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdatePair.h +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateProduce.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\UI\Common\UpdateProduce.h +# End Source File +# End Group +# Begin Group "7-zip" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\ICoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\IMyUnknown.h +# End Source File +# Begin Source File + +SOURCE=..\..\IPassword.h +# End Source File +# Begin Source File + +SOURCE=..\..\IProgress.h +# End Source File +# Begin Source File + +SOURCE=..\..\IStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\PropID.h +# End Source File +# End Group +# Begin Group "C" + +# PROP Default_Filter "" +# Begin Group "Xz" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\..\..\C\Sha256.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Sha256.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Xz.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Xz.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzCrc64.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzCrc64.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzCrc64Opt.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzDec.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzEnc.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzEnc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\XzIn.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# End Group +# Begin Source File + +SOURCE=..\..\..\..\C\7zCrc.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\7zCrc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\7zCrcOpt.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\7zStream.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Aes.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Aes.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\AesOpt.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# 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\Bra.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Bra.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Bra86.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\BraIA64.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\CpuArch.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\CpuArch.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Delta.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Delta.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\IStream.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzFind.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzFind.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzFindMt.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzFindMt.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Compress\Lz\LzHash.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzHash.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Lzma2Dec.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Lzma2Dec.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Lzma2Enc.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Lzma2Enc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzmaDec.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzmaDec.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzmaEnc.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\LzmaEnc.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\MtCoder.c + +!IF "$(CFG)" == "Alone - Win32 Release" + +# ADD CPP /O2 +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "Alone - Win32 DebugU" + +# SUBTRACT CPP /YX /Yc /Yu + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\MtCoder.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Threads.c +# SUBTRACT CPP /YX /Yc /Yu +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Threads.h +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\C\Types.h +# End Source File +# End Group +# Begin Group "Crypto" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=..\..\Crypto\7zAes.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\7zAes.h +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\7zAesRegister.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\MyAes.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\MyAes.h +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\RandGen.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\Crypto\RandGen.h +# End Source File +# End Group +# End Target +# End Project diff --git a/CPP/7zip/Bundles/Alone7z/Alone.dsw b/CPP/7zip/Bundles/Alone7z/Alone.dsw new file mode 100644 index 00000000..65eca43f --- /dev/null +++ b/CPP/7zip/Bundles/Alone7z/Alone.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Alone"=.\Alone.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/CPP/7zip/Bundles/LzmaCon/makefile.gcc b/CPP/7zip/Bundles/LzmaCon/makefile.gcc index 42e52246..19c1b3ab 100644 --- a/CPP/7zip/Bundles/LzmaCon/makefile.gcc +++ b/CPP/7zip/Bundles/LzmaCon/makefile.gcc @@ -1,24 +1,42 @@ PROG = lzma -CXX = g++ -O2 -Wall -CXX_C = gcc -O2 -Wall -LIB = -lm -RM = rm -f -CFLAGS = -c -D_7ZIP_ST +CXX = g++ -O2 +# -Wall -Werror -Wno-delete-non-virtual-dtor +CXX_C = gcc -O2 -Wall -Werror ifdef SystemDrive IS_MINGW = 1 endif ifdef IS_MINGW + +RM = del +CFLAGS = -c +LIB2 = -loleaut32 -luuid +LDFLAGS = -s + FILE_IO =FileIO FILE_IO_2 =Windows/$(FILE_IO) -LIB2 = -luuid + +MT_FILES = \ + System.o \ + LzFindMt.o \ + Threads.o \ + else + +RM = rm -f +CFLAGS = -c -D_7ZIP_ST + FILE_IO =C_FileIO FILE_IO_2 =Common/$(FILE_IO) + + endif + OBJS = \ + $(MT_FILES) \ + $(FILE_IO).o \ LzmaAlone.o \ Bench.o \ BenchCon.o \ @@ -32,7 +50,6 @@ OBJS = \ FilterCoder.o \ MethodProps.o \ StreamUtils.o \ - $(FILE_IO).o \ CommandLineParser.o \ CRC.o \ CrcReg.o \ @@ -58,7 +75,7 @@ OBJS = \ all: $(PROG) $(PROG): $(OBJS) - $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2) + $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB2) LzmaAlone.o: LzmaAlone.cpp $(CXX) $(CFLAGS) LzmaAlone.cpp @@ -133,6 +150,11 @@ StringToInt.o: ../../../Common/StringToInt.cpp PropVariant.o: ../../../Windows/PropVariant.cpp $(CXX) $(CFLAGS) ../../../Windows/PropVariant.cpp +ifdef MT_FILES +System.o: ../../../Windows/System.cpp + $(CXX) $(CFLAGS) ../../../Windows/System.cpp +endif + 7zCrc.o: ../../../../C/7zCrc.c $(CXX_C) $(CFLAGS) ../../../../C/7zCrc.c @@ -151,6 +173,14 @@ CpuArch.o: ../../../../C/CpuArch.c LzFind.o: ../../../../C/LzFind.c $(CXX_C) $(CFLAGS) ../../../../C/LzFind.c +ifdef MT_FILES +LzFindMt.o: ../../../../C/LzFindMt.c + $(CXX_C) $(CFLAGS) ../../../../C/LzFindMt.c + +Threads.o: ../../../../C/Threads.c + $(CXX_C) $(CFLAGS) ../../../../C/Threads.c +endif + LzmaDec.o: ../../../../C/LzmaDec.c $(CXX_C) $(CFLAGS) ../../../../C/LzmaDec.c diff --git a/CPP/7zip/Common/CWrappers.cpp b/CPP/7zip/Common/CWrappers.cpp index e67f5bc4..a15794e2 100644 --- a/CPP/7zip/Common/CWrappers.cpp +++ b/CPP/7zip/Common/CWrappers.cpp @@ -19,7 +19,7 @@ static SRes CompressProgress(void *pp, UInt64 inSize, UInt64 outSize) throw() return (SRes)p->Res; } -CCompressProgressWrap::CCompressProgressWrap(ICompressProgressInfo *progress) +CCompressProgressWrap::CCompressProgressWrap(ICompressProgressInfo *progress) throw() { p.Progress = CompressProgress; Progress = progress; @@ -69,14 +69,14 @@ static size_t MyWrite(void *object, const void *data, size_t size) throw() return size; } -CSeqInStreamWrap::CSeqInStreamWrap(ISequentialInStream *stream) +CSeqInStreamWrap::CSeqInStreamWrap(ISequentialInStream *stream) throw() { p.Read = MyRead; Stream = stream; Processed = 0; } -CSeqOutStreamWrap::CSeqOutStreamWrap(ISequentialOutStream *stream) +CSeqOutStreamWrap::CSeqOutStreamWrap(ISequentialOutStream *stream) throw() { p.Write = MyWrite; Stream = stream; @@ -84,7 +84,7 @@ CSeqOutStreamWrap::CSeqOutStreamWrap(ISequentialOutStream *stream) Processed = 0; } -HRESULT SResToHRESULT(SRes res) +HRESULT SResToHRESULT(SRes res) throw() { switch(res) { @@ -124,7 +124,7 @@ static SRes InStreamWrap_Seek(void *pp, Int64 *offset, ESzSeek origin) throw() return (p->Res == S_OK) ? SZ_OK : SZ_ERROR_READ; } -CSeekInStreamWrap::CSeekInStreamWrap(IInStream *stream) +CSeekInStreamWrap::CSeekInStreamWrap(IInStream *stream) throw() { Stream = stream; p.Read = InStreamWrap_Read; @@ -135,13 +135,13 @@ CSeekInStreamWrap::CSeekInStreamWrap(IInStream *stream) /* ---------- CByteInBufWrap ---------- */ -void CByteInBufWrap::Free() +void CByteInBufWrap::Free() throw() { ::MidFree(Buf); Buf = 0; } -bool CByteInBufWrap::Alloc(UInt32 size) +bool CByteInBufWrap::Alloc(UInt32 size) throw() { if (Buf == 0 || size != Size) { @@ -152,7 +152,7 @@ bool CByteInBufWrap::Alloc(UInt32 size) return (Buf != 0); } -Byte CByteInBufWrap::ReadByteFromNewBlock() +Byte CByteInBufWrap::ReadByteFromNewBlock() throw() { if (Res == S_OK) { @@ -184,13 +184,13 @@ CByteInBufWrap::CByteInBufWrap(): Buf(0) /* ---------- CByteOutBufWrap ---------- */ -void CByteOutBufWrap::Free() +void CByteOutBufWrap::Free() throw() { ::MidFree(Buf); Buf = 0; } -bool CByteOutBufWrap::Alloc(size_t size) +bool CByteOutBufWrap::Alloc(size_t size) throw() { if (Buf == 0 || size != Size) { @@ -201,7 +201,7 @@ bool CByteOutBufWrap::Alloc(size_t size) return (Buf != 0); } -HRESULT CByteOutBufWrap::Flush() +HRESULT CByteOutBufWrap::Flush() throw() { if (Res == S_OK) { @@ -224,7 +224,7 @@ static void Wrap_WriteByte(void *pp, Byte b) throw() p->Flush(); } -CByteOutBufWrap::CByteOutBufWrap(): Buf(0) +CByteOutBufWrap::CByteOutBufWrap() throw(): Buf(0) { p.Write = Wrap_WriteByte; } diff --git a/CPP/7zip/Common/CreateCoder.cpp b/CPP/7zip/Common/CreateCoder.cpp index c586561d..e5e09327 100644 --- a/CPP/7zip/Common/CreateCoder.cpp +++ b/CPP/7zip/Common/CreateCoder.cpp @@ -90,7 +90,7 @@ HRESULT CExternalCodecs::LoadCodecs() } if (GetHashers) { - UInt32 num = num = GetHashers->GetNumHashers(); + UInt32 num = GetHashers->GetNumHashers(); for (UInt32 i = 0; i < num; i++) { CHasherInfoEx info; @@ -226,7 +226,6 @@ HRESULT CreateCoder( CMyComPtr<ICompressCoder2> &coder2, bool encode, bool onlyCoder) { - bool created = false; UInt32 i; for (i = 0; i < g_NumCodecs; i++) { @@ -241,7 +240,6 @@ HRESULT CreateCoder( if (codec.IsFilter) filter = (ICompressFilter *)p; else if (codec.NumInStreams == 1) coder = (ICompressCoder *)p; else coder2 = (ICompressCoder2 *)p; - created = (p != 0); break; } } @@ -252,14 +250,13 @@ HRESULT CreateCoder( if (codec.IsFilter) filter = (ICompressFilter *)p; else if (codec.NumInStreams == 1) coder = (ICompressCoder *)p; else coder2 = (ICompressCoder2 *)p; - created = (p != 0); break; } } } #ifdef EXTERNAL_CODECS - if (!created && __externalCodecs) + if (!filter && !coder && !coder2 && __externalCodecs) for (i = 0; i < (UInt32)__externalCodecs->Codecs.Size(); i++) { const CCodecInfoEx &codec = __externalCodecs->Codecs[i]; diff --git a/CPP/7zip/Common/FileStreams.cpp b/CPP/7zip/Common/FileStreams.cpp index 374336d8..1523fad1 100644 --- a/CPP/7zip/Common/FileStreams.cpp +++ b/CPP/7zip/Common/FileStreams.cpp @@ -1,4 +1,4 @@ -/ FileStreams.cpp +// FileStreams.cpp #include "StdAfx.h" diff --git a/CPP/7zip/Common/InBuffer.cpp b/CPP/7zip/Common/InBuffer.cpp index 8edefa31..133d95b3 100644 --- a/CPP/7zip/Common/InBuffer.cpp +++ b/CPP/7zip/Common/InBuffer.cpp @@ -6,7 +6,7 @@ #include "InBuffer.h" -CInBufferBase::CInBufferBase(): +CInBufferBase::CInBufferBase() throw(): _buf(0), _bufLim(0), _bufBase(0), @@ -17,7 +17,7 @@ CInBufferBase::CInBufferBase(): NumExtraBytes(0) {} -bool CInBuffer::Create(size_t bufSize) +bool CInBuffer::Create(size_t bufSize) throw() { const unsigned kMinBlockSize = 1; if (bufSize < kMinBlockSize) @@ -30,13 +30,13 @@ bool CInBuffer::Create(size_t bufSize) return (_bufBase != 0); } -void CInBuffer::Free() +void CInBuffer::Free() throw() { ::MidFree(_bufBase); _bufBase = 0; } -void CInBufferBase::Init() +void CInBufferBase::Init() throw() { _processedSize = 0; _buf = _bufBase; diff --git a/CPP/7zip/Common/InMemStream.cpp b/CPP/7zip/Common/InMemStream.cpp deleted file mode 100644 index d88c2d8a..00000000 --- a/CPP/7zip/Common/InMemStream.cpp +++ /dev/null @@ -1,222 +0,0 @@ -// InMemStream.cpp - -#include "StdAfx.h" - -#include <stdio.h> - -#include "Windows/Thread.h" - -#include "InMemStream.h" -#include "../../Common/Defs.h" - -void CStreamInfo::Free(IInMemStreamMtCallback *callback) -{ - for (int i = 0; i < Blocks.Size(); i++) - { - callback->FreeBlock(Blocks[i]); - Blocks[i] = 0; - } -} - -bool CInMemStreamMt::Create(int numSubStreams, UInt64 subStreamSize) -{ - Free(); - _subStreamSize = subStreamSize; - size_t blockSize = Callback->GetBlockSize(); - for (int i = 0; i < numSubStreams; i++) - { - _streams.Add(CStreamInfo()); - CStreamInfo &blocks = _streams.Back(); - blocks.Create(); - for (UInt64 j = 0; (UInt64)j * blockSize < _subStreamSize; j++) - blocks.Blocks.Add(0); - } - if (!_streamIndexAllocator.AllocateList(numSubStreams)) - return false; - return true; -} - -void CInMemStreamMt::Free() -{ - while(_streams.Size() > 0) - { - _streams.Back().Free(Callback); - _streams.DeleteBack(); - } -} - -HRESULT CInMemStreamMt::Read() -{ - for (;;) - { - // printf("\n_streamIndexAllocator.AllocateItem\n"); - int index = _streamIndexAllocator.AllocateItem(); - /* - if (_stopReading) - return E_ABORT; - */ - // printf("\nread Index = %d\n", index); - CStreamInfo &blocks = _streams[index]; - blocks.Init(); - Callback->AddStreamIndexToQueue(index); - - for (;;) - { - const Byte *p = (const Byte *)blocks.Blocks[blocks.LastBlockIndex]; - if (p == 0) - { - void **pp = &blocks.Blocks[blocks.LastBlockIndex]; - HRESULT res = Callback->AllocateBlock(pp); - p = (const Byte *)*pp; - RINOK(res); - if (p == 0) - return E_FAIL; - } - size_t blockSize = Callback->GetBlockSize(); - UInt32 curSize = (UInt32)(blockSize - blocks.LastBlockPos); - UInt32 realProcessedSize; - UInt64 pos64 = (UInt64)blocks.LastBlockIndex * blockSize + blocks.LastBlockPos; - if (curSize > _subStreamSize - pos64) - curSize = (UInt32)(_subStreamSize - pos64); - RINOK(_stream->Read((void *)(p + blocks.LastBlockPos), curSize, &realProcessedSize)); - - blocks.Cs->Enter(); - if (realProcessedSize == 0) - { - blocks.StreamWasFinished = true; - blocks.CanReadEvent->Set(); - blocks.Cs->Leave(); - - Callback->AddStreamIndexToQueue(-1); - return S_OK; - } - - blocks.LastBlockPos += realProcessedSize; - if (blocks.LastBlockPos == blockSize) - { - blocks.LastBlockPos = 0; - blocks.LastBlockIndex++; - } - pos64 += realProcessedSize; - if (pos64 >= _subStreamSize) - blocks.StreamWasFinished = true; - blocks.CanReadEvent->Set(); - blocks.Cs->Leave(); - if (pos64 >= _subStreamSize) - break; - } - } -} - -static THREAD_FUNC_DECL CoderThread(void *threadCoderInfo) -{ - ((CInMemStreamMt *)threadCoderInfo)->ReadResult = ((CInMemStreamMt *)threadCoderInfo)->Read(); - return 0; -} - -HRes CInMemStreamMt::StartReadThread() -{ - // _stopReading = false; - NWindows::CThread Thread; - return Thread.Create(CoderThread, this); -} - -void CInMemStreamMt::FreeSubStream(int subStreamIndex) -{ - // printf("\nFreeSubStream\n"); - _streams[subStreamIndex].Free(Callback); - _streamIndexAllocator.FreeItem(subStreamIndex); - // printf("\nFreeSubStream end\n"); -} - -HRESULT CInMemStreamMt::ReadSubStream(int subStreamIndex, void *data, UInt32 size, UInt32 *processedSize, bool keepData) -{ - if (processedSize != NULL) - *processedSize = 0; - CStreamInfo &blocks = _streams[subStreamIndex]; - while (size > 0) - { - if (blocks.CurBlockPos == Callback->GetBlockSize()) - { - blocks.CurBlockPos = 0; - blocks.CurBlockIndex++; - } - UInt32 curSize; - UInt32 curPos = blocks.CurBlockPos; - - blocks.Cs->Enter(); - if (blocks.CurBlockIndex == blocks.LastBlockIndex) - { - curSize = blocks.LastBlockPos - curPos; - if (curSize == 0) - { - if (blocks.StreamWasFinished) - { - blocks.Cs->Leave(); - void *p = blocks.Blocks[blocks.CurBlockIndex]; - if (p != 0 && !keepData) - { - Callback->FreeBlock(p); - blocks.Blocks[blocks.CurBlockIndex] = 0; - } - return S_OK; - } - blocks.CanReadEvent->Reset(); - blocks.Cs->Leave(); - // printf("\nBlock Lock\n"); - blocks.CanReadEvent->Lock(); - // printf("\nAfter Lock\n"); - if (blocks.ExitResult != S_OK) - return blocks.ExitResult; - continue; - } - } - else - curSize = Callback->GetBlockSize() - curPos; - blocks.Cs->Leave(); - - if (curSize > size) - curSize = size; - void *p = blocks.Blocks[blocks.CurBlockIndex]; - memcpy(data, (const Byte *)p + curPos, curSize); - data = (void *)((Byte *)data + curSize); - size -= curSize; - if (processedSize != NULL) - *processedSize += curSize; - curPos += curSize; - - bool needFree = false; - blocks.CurBlockPos = curPos; - - if (curPos == Callback->GetBlockSize()) - needFree = true; - blocks.Cs->Enter(); - if (blocks.CurBlockIndex == blocks.LastBlockIndex && - blocks.CurBlockPos == blocks.LastBlockPos && - blocks.StreamWasFinished) - needFree = true; - blocks.Cs->Leave(); - - if (needFree && !keepData) - { - Callback->FreeBlock(p); - blocks.Blocks[blocks.CurBlockIndex] = 0; - } - return S_OK; - } - return S_OK; -} - -STDMETHODIMP CInMemStream::Read(void *data, UInt32 size, UInt32 *processedSize) -{ - UInt32 realProcessedSize; - HRESULT result = mtStream->ReadSubStream(Index, data, size, &realProcessedSize, _keepData); - if (processedSize != NULL) - *processedSize = realProcessedSize; - if (realProcessedSize != 0) - { - // printf("\ns = %d\n", Index); - } - _size += realProcessedSize; - return result; -} diff --git a/CPP/7zip/Common/InMemStream.h b/CPP/7zip/Common/InMemStream.h deleted file mode 100644 index ec493977..00000000 --- a/CPP/7zip/Common/InMemStream.h +++ /dev/null @@ -1,284 +0,0 @@ -// InMemStream.h - -#ifndef __IN_MEM_STREAM_H -#define __IN_MEM_STREAM_H - -#include <stdio.h> - -#include "../../../C/Alloc.h" - -#include "../../Common/MyCom.h" - -#include "MemBlocks.h" - -class CIntListCheck -{ -protected: - int *_data; -public: - CIntListCheck(): _data(0) {} - ~CIntListCheck() { FreeList(); } - - bool AllocateList(int numItems) - { - FreeList(); - if (numItems == 0) - return true; - _data = (int *)::MyAlloc(numItems * sizeof(int)); - return (_data != 0); - } - - void FreeList() - { - ::MyFree(_data); - _data = 0; - } -}; - - -class CResourceList : public CIntListCheck -{ - int _headFree; -public: - CResourceList(): _headFree(-1) {} - - bool AllocateList(int numItems) - { - FreeList(); - if (numItems == 0) - return true; - if (!CIntListCheck::AllocateList(numItems)) - return false; - for (int i = 0; i < numItems; i++) - _data[i] = i + 1; - _data[numItems - 1] = -1; - _headFree = 0; - return true; - } - - void FreeList() - { - CIntListCheck::FreeList(); - _headFree = -1; - } - - int AllocateItem() - { - int res = _headFree; - if (res >= 0) - _headFree = _data[res]; - return res; - } - - void FreeItem(int index) - { - if (index < 0) - return; - _data[index] = _headFree; - _headFree = index; - } -}; - -class CResourceListMt: public CResourceList -{ - NWindows::NSynchronization::CCriticalSection _criticalSection; -public: - NWindows::NSynchronization::CSemaphore Semaphore; - - HRes AllocateList(int numItems) - { - if (!CResourceList::AllocateList(numItems)) - return E_OUTOFMEMORY; - Semaphore.Close(); - return Semaphore.Create(numItems, numItems); - } - - int AllocateItem() - { - Semaphore.Lock(); - _criticalSection.Enter(); - int res = CResourceList::AllocateItem(); - _criticalSection.Leave(); - return res; - } - - void FreeItem(int index) - { - if (index < 0) - return; - _criticalSection.Enter(); - CResourceList::FreeItem(index); - _criticalSection.Leave(); - Semaphore.Release(); - } -}; - -class CIntQueueMt: public CIntListCheck -{ - int _numItems; - int _head; - int _cur; -public: - CIntQueueMt(): _numItems(0), _head(0), _cur(0) {} - NWindows::NSynchronization::CSemaphore Semaphore; - - HRes AllocateList(int numItems) - { - FreeList(); - if (numItems == 0) - return S_OK; - if (!CIntListCheck::AllocateList(numItems)) - return E_OUTOFMEMORY; - _numItems = numItems; - return Semaphore.Create(0, numItems); - } - - void FreeList() - { - CIntListCheck::FreeList(); - _numItems = 0; - _head = 0; - _cur = 0; - } - - void AddItem(int value) - { - _data[_head++] = value; - if (_head == _numItems) - _head = 0; - Semaphore.Release(); - // printf("\nRelease prev = %d\n", previousCount); - } - - int GetItem() - { - // Semaphore.Lock(); - int res = _data[_cur++]; - if (_cur == _numItems) - _cur = 0; - return res; - } -}; - -struct IInMemStreamMtCallback -{ - // must be same for all calls - virtual size_t GetBlockSize() = 0; - - // Out: - // result != S_OK stops Reading - // if *p = 0, result must be != S_OK; - // Locking is allowed - virtual HRESULT AllocateBlock(void **p) = 0; - - virtual void FreeBlock(void *p) = 0; - - // It must allow to add at least numSubStreams + 1 , - // where numSubStreams is value from CInMemStreamMt::Create - // value -1 means End of stream - // Locking is not allowed - virtual void AddStreamIndexToQueue(int index) = 0; -}; - -struct CStreamInfo -{ - CRecordVector<void *> Blocks; - - int LastBlockIndex; - size_t LastBlockPos; - bool StreamWasFinished; - - int CurBlockIndex; - size_t CurBlockPos; - - NWindows::NSynchronization::CCriticalSection *Cs; - NWindows::NSynchronization::CManualResetEvent *CanReadEvent; - - HRESULT ExitResult; - - CStreamInfo(): Cs(0), CanReadEvent(0), StreamWasFinished(false) { } - ~CStreamInfo() - { - delete Cs; - delete CanReadEvent; - // Free(); - } - void Create() - { - Cs = new NWindows::NSynchronization::CCriticalSection; - CanReadEvent = new NWindows::NSynchronization::CManualResetEvent; - } - - void Free(IInMemStreamMtCallback *callback); - void Init() - { - LastBlockIndex = CurBlockIndex = 0; - CurBlockPos = LastBlockPos = 0; - StreamWasFinished = false; - ExitResult = S_OK; - } - - // res must be != S_OK - void Exit(HRESULT res) - { - ExitResult = res; - CanReadEvent->Set(); - } -}; - - -class CInMemStreamMt -{ - CMyComPtr<ISequentialInStream> _stream; - NWindows::NSynchronization::CCriticalSection CS; - CObjectVector<CStreamInfo> _streams; - int _nextFreeStreamIndex; - int _currentStreamIndex; - UInt64 _subStreamSize; - - CResourceListMt _streamIndexAllocator; - - // bool _stopReading; - -public: - HRESULT Read(); - HRESULT ReadResult; - IInMemStreamMtCallback *Callback; - void FreeSubStream(int subStreamIndex); - HRESULT ReadSubStream(int subStreamIndex, void *data, UInt32 size, UInt32 *processedSize, bool keepData); - - // numSubStreams: min = 1, good min = numThreads - bool Create(int numSubStreams, UInt64 subStreamSize); - ~CInMemStreamMt() { Free(); } - void SetStream(ISequentialInStream *stream) { _stream = stream; } - - // to stop reading you must implement - // returning Error in IInMemStreamMtCallback::AllocateBlock - // and then you must free at least one substream - HRes StartReadThread(); - - void Free(); - - // you must free at least one substream after that function to unlock waiting. - // void StopReading() { _stopReading = true; } -}; - -class CInMemStream: - public ISequentialInStream, - public CMyUnknownImp -{ - UInt64 _size; - bool _keepData; -public: - int Index; - CInMemStreamMt *mtStream; - void Init(bool keepData = false) - { - _size = 0; _keepData = keepData ; - } - MY_UNKNOWN_IMP - STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); - UInt64 GetSize() const { return _size; } -}; - -#endif diff --git a/CPP/7zip/Common/OutBuffer.cpp b/CPP/7zip/Common/OutBuffer.cpp index df254f27..4ba34a05 100644 --- a/CPP/7zip/Common/OutBuffer.cpp +++ b/CPP/7zip/Common/OutBuffer.cpp @@ -6,7 +6,7 @@ #include "OutBuffer.h" -bool COutBuffer::Create(UInt32 bufSize) +bool COutBuffer::Create(UInt32 bufSize) throw() { const UInt32 kMinBlockSize = 1; if (bufSize < kMinBlockSize) @@ -19,13 +19,13 @@ bool COutBuffer::Create(UInt32 bufSize) return (_buf != 0); } -void COutBuffer::Free() +void COutBuffer::Free() throw() { ::MidFree(_buf); _buf = 0; } -void COutBuffer::Init() +void COutBuffer::Init() throw() { _streamPos = 0; _limitPos = _bufSize; @@ -37,7 +37,7 @@ void COutBuffer::Init() #endif } -UInt64 COutBuffer::GetProcessedSize() const +UInt64 COutBuffer::GetProcessedSize() const throw() { UInt64 res = _processedSize + _pos - _streamPos; if (_streamPos > _pos) @@ -46,7 +46,7 @@ UInt64 COutBuffer::GetProcessedSize() const } -HRESULT COutBuffer::FlushPart() +HRESULT COutBuffer::FlushPart() throw() { // _streamPos < _bufSize UInt32 size = (_streamPos >= _pos) ? (_bufSize - _streamPos) : (_pos - _streamPos); @@ -83,7 +83,7 @@ HRESULT COutBuffer::FlushPart() return result; } -HRESULT COutBuffer::Flush() +HRESULT COutBuffer::Flush() throw() { #ifdef _NO_EXCEPTIONS if (ErrorCode != S_OK) diff --git a/CPP/7zip/Common/StreamObjects.cpp b/CPP/7zip/Common/StreamObjects.cpp index 480cb2db..817017ab 100644 --- a/CPP/7zip/Common/StreamObjects.cpp +++ b/CPP/7zip/Common/StreamObjects.cpp @@ -65,14 +65,14 @@ void Create_BufInStream_WithNewBuf(const void *data, size_t size, ISequentialInS *stream = streamTemp.Detach(); } -void CByteDynBuffer::Free() +void CByteDynBuffer::Free() throw() { free(_buf); _buf = 0; _capacity = 0; } -bool CByteDynBuffer::EnsureCapacity(size_t cap) +bool CByteDynBuffer::EnsureCapacity(size_t cap) throw() { if (cap <= _capacity) return true; @@ -147,7 +147,7 @@ STDMETHODIMP CSequentialOutStreamSizeCount::Write(const void *data, UInt32 size, static const UInt64 kEmptyTag = (UInt64)(Int64)-1; -void CCachedInStream::Free() +void CCachedInStream::Free() throw() { MyFree(_tags); _tags = 0; @@ -155,7 +155,7 @@ void CCachedInStream::Free() _data = 0; } -bool CCachedInStream::Alloc(unsigned blockSizeLog, unsigned numBlocksLog) +bool CCachedInStream::Alloc(unsigned blockSizeLog, unsigned numBlocksLog) throw() { unsigned sizeLog = blockSizeLog + numBlocksLog; if (sizeLog >= sizeof(size_t) * 8) @@ -181,7 +181,7 @@ bool CCachedInStream::Alloc(unsigned blockSizeLog, unsigned numBlocksLog) return true; } -void CCachedInStream::Init(UInt64 size) +void CCachedInStream::Init(UInt64 size) throw() { _size = size; _pos = 0; diff --git a/CPP/7zip/Common/StreamUtils.cpp b/CPP/7zip/Common/StreamUtils.cpp index 049e4aa1..1402f420 100644 --- a/CPP/7zip/Common/StreamUtils.cpp +++ b/CPP/7zip/Common/StreamUtils.cpp @@ -6,7 +6,7 @@ static const UInt32 kBlockSize = ((UInt32)1 << 31); -HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *processedSize) +HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *processedSize) throw() { size_t size = *processedSize; *processedSize = 0; @@ -25,21 +25,21 @@ HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *processedSiz return S_OK; } -HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) +HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw() { size_t processedSize = size; RINOK(ReadStream(stream, data, &processedSize)); return (size == processedSize) ? S_OK : S_FALSE; } -HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) +HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw() { size_t processedSize = size; RINOK(ReadStream(stream, data, &processedSize)); return (size == processedSize) ? S_OK : E_FAIL; } -HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size) +HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size) throw() { while (size != 0) { diff --git a/CPP/7zip/Compress/BitlDecoder.h b/CPP/7zip/Compress/BitlDecoder.h index 27be1716..41e22fe7 100644 --- a/CPP/7zip/Compress/BitlDecoder.h +++ b/CPP/7zip/Compress/BitlDecoder.h @@ -121,12 +121,12 @@ public: void AlignToByte() { MovePos((32 - this->_bitPos) & 7); } - Byte ReadDirectByte() { return _stream.ReadByte(); } + Byte ReadDirectByte() { return this->_stream.ReadByte(); } Byte ReadAlignedByte() { if (this->_bitPos == kNumBigValueBits) - return _stream.ReadByte(); + return this->_stream.ReadByte(); Byte b = (Byte)(_normalValue & 0xFF); MovePos(8); return b; diff --git a/CPP/7zip/Compress/DllExportsCompress.cpp b/CPP/7zip/Compress/DllExportsCompress.cpp index 8b37c899..be429277 100644 --- a/CPP/7zip/Compress/DllExportsCompress.cpp +++ b/CPP/7zip/Compress/DllExportsCompress.cpp @@ -11,7 +11,7 @@ static const unsigned kNumCodecsMax = 48; unsigned g_NumCodecs = 0; const CCodecInfo *g_Codecs[kNumCodecsMax]; -void RegisterCodec(const CCodecInfo *codecInfo) +void RegisterCodec(const CCodecInfo *codecInfo) throw() { if (g_NumCodecs < kNumCodecsMax) g_Codecs[g_NumCodecs++] = codecInfo; diff --git a/CPP/7zip/Compress/LzOutWindow.cpp b/CPP/7zip/Compress/LzOutWindow.cpp index df46295b..eb346407 100644 --- a/CPP/7zip/Compress/LzOutWindow.cpp +++ b/CPP/7zip/Compress/LzOutWindow.cpp @@ -4,7 +4,7 @@ #include "LzOutWindow.h" -void CLzOutWindow::Init(bool solid) +void CLzOutWindow::Init(bool solid) throw() { if (!solid) COutBuffer::Init(); diff --git a/CPP/7zip/Compress/LzhDecoder.h b/CPP/7zip/Compress/LzhDecoder.h index a805f9f9..a0a7b244 100644 --- a/CPP/7zip/Compress/LzhDecoder.h +++ b/CPP/7zip/Compress/LzhDecoder.h @@ -39,7 +39,7 @@ public: { if (Symbol >= 0) return (UInt32)Symbol; - return DecodeSymbol(bitStream); + return this->DecodeSymbol(bitStream); } }; diff --git a/CPP/7zip/Compress/Rar2Decoder.cpp b/CPP/7zip/Compress/Rar2Decoder.cpp index 1773939c..c4312f9b 100644 --- a/CPP/7zip/Compress/Rar2Decoder.cpp +++ b/CPP/7zip/Compress/Rar2Decoder.cpp @@ -69,8 +69,6 @@ Byte CFilter::Decode(int &channelDelta, Byte deltaByte) } } -static const char *kNumberErrorMessage = "Number error"; - static const UInt32 kHistorySize = 1 << 20; static const int kNumStats = 11; diff --git a/CPP/7zip/IStream.h b/CPP/7zip/IStream.h index bf8dc4ca..c3a290b9 100644 --- a/CPP/7zip/IStream.h +++ b/CPP/7zip/IStream.h @@ -14,31 +14,59 @@ STREAM_INTERFACE(ISequentialInStream, 0x01) { STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE; + /* - Out: if size != 0, return_value = S_OK and (*processedSize == 0), - then there are no more bytes in stream. - if (size > 0) && there are bytes in stream, - this function must read at least 1 byte. - This function is allowed to read less than number of remaining bytes in stream. - You must call Read function in loop, if you need exact amount of data - - If seek pointer before Read() function call was changed to position past the - end of stream, the Read() function returns S_OK and *processedSize is set to 0. + The requirement for caller: (processedSize != NULL). + The callee can allow (processedSize == NULL) for compatibility reasons. + + if (size == 0), this function returns S_OK and (*processedSize) is set to 0. + + if (size != 0) + { + Partial read is allowed: (*processedSize <= avail_size && *processedSize <= size), + where (avail_size) is the size of remaining bytes in stream. + If (avail_size != 0), this function must read at least 1 byte: (*processedSize > 0). + You must call Read() in loop, if you need to read exact amount of data. + } + + If seek pointer before Read() call was changed to position past the end of stream: + if (seek_pointer >= stream_size), this function returns S_OK and (*processedSize) is set to 0. + + ERROR CASES: + If the function returns error code, then (*processedSize) is size of + data written to (data) buffer (it can be data before error or data with errors). + The recommended way for callee to work with reading errors: + 1) write part of data before error to (data) buffer and return S_OK. + 2) return error code for further calls of Read(). */ }; STREAM_INTERFACE(ISequentialOutStream, 0x02) { STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE; + /* - if (size > 0) this function must write at least 1 byte. - This function is allowed to write less than "size". - You must call Write function in loop, if you need to write exact amount of data + The requirement for caller: (processedSize != NULL). + The callee can allow (processedSize == NULL) for compatibility reasons. + + if (size != 0) + { + Partial write is allowed: (*processedSize <= size), + but this function must write at least 1 byte: (*processedSize > 0). + You must call Write() in loop, if you need to write exact amount of data. + } + + ERROR CASES: + If the function returns error code, then (*processedSize) is size of + data written from (data) buffer. */ }; - +#ifdef __HRESULT_FROM_WIN32 #define HRESULT_WIN32_ERROR_NEGATIVE_SEEK __HRESULT_FROM_WIN32(ERROR_NEGATIVE_SEEK) +#else +#define HRESULT_WIN32_ERROR_NEGATIVE_SEEK HRESULT_FROM_WIN32(ERROR_NEGATIVE_SEEK) +#endif /* Seek() Function If you seek before the beginning of the stream, Seek() function returns error code: diff --git a/CPP/7zip/PropID.h b/CPP/7zip/PropID.h index cd56663e..82a7462b 100644 --- a/CPP/7zip/PropID.h +++ b/CPP/7zip/PropID.h @@ -106,7 +106,7 @@ enum kpidUserDefined = 0x10000 }; -Byte k7z_PROPID_To_VARTYPE[]; // VARTYPE +extern Byte k7z_PROPID_To_VARTYPE[kpid_NUM_DEFINED]; // VARTYPE const UInt32 kpv_ErrorFlags_IsNotArc = 1 << 0; const UInt32 kpv_ErrorFlags_HeadersError = 1 << 1; diff --git a/CPP/7zip/UI/Agent/AgentProxy.cpp b/CPP/7zip/UI/Agent/AgentProxy.cpp index a31a904b..301d3a33 100644 --- a/CPP/7zip/UI/Agent/AgentProxy.cpp +++ b/CPP/7zip/UI/Agent/AgentProxy.cpp @@ -492,8 +492,8 @@ HRESULT CProxyArchive2::Load(const CArc &arc, IProgress *progress) { file.Name = (const wchar_t *)p; file.NameSize = 0; - if (size >= 2) - file.NameSize = size / 2 - 1; + if (size >= sizeof(wchar_t)) + file.NameSize = size / sizeof(wchar_t) - 1; } else #endif diff --git a/CPP/7zip/UI/Agent/StdAfx.h b/CPP/7zip/UI/Agent/StdAfx.h new file mode 100644 index 00000000..2854ff3e --- /dev/null +++ b/CPP/7zip/UI/Agent/StdAfx.h @@ -0,0 +1,8 @@ +// StdAfx.h + +#ifndef __STDAFX_H +#define __STDAFX_H + +#include "../../../Common/Common.h" + +#endif diff --git a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp index 4d5c7023..0bfed8ab 100644 --- a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp +++ b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp @@ -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"; diff --git a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp index c365d66f..c1d41238 100644 --- a/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp +++ b/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp @@ -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); } } } diff --git a/CPP/7zip/UI/Common/Bench.cpp b/CPP/7zip/UI/Common/Bench.cpp index 1b10ee26..8cb65755 100644 --- a/CPP/7zip/UI/Common/Bench.cpp +++ b/CPP/7zip/UI/Common/Bench.cpp @@ -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 diff --git a/CPP/7zip/UI/Common/EnumDirItems.cpp b/CPP/7zip/UI/Common/EnumDirItems.cpp index 955f459c..14285cfe 100644 --- a/CPP/7zip/UI/Common/EnumDirItems.cpp +++ b/CPP/7zip/UI/Common/EnumDirItems.cpp @@ -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()) diff --git a/CPP/7zip/UI/Common/Extract.cpp b/CPP/7zip/UI/Common/Extract.cpp index 891cc7d8..67cad3ac 100644 --- a/CPP/7zip/UI/Common/Extract.cpp +++ b/CPP/7zip/UI/Common/Extract.cpp @@ -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); } diff --git a/CPP/7zip/UI/Common/LoadCodecs.cpp b/CPP/7zip/UI/Common/LoadCodecs.cpp index 285b6588..bbdf0fe8 100644 --- a/CPP/7zip/UI/Common/LoadCodecs.cpp +++ b/CPP/7zip/UI/Common/LoadCodecs.cpp @@ -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) { diff --git a/CPP/7zip/UI/Common/OpenArchive.cpp b/CPP/7zip/UI/Common/OpenArchive.cpp index ac077660..2f5d816d 100644 --- a/CPP/7zip/UI/Common/OpenArchive.cpp +++ b/CPP/7zip/UI/Common/OpenArchive.cpp @@ -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; diff --git a/CPP/7zip/UI/Common/PropIDUtils.cpp b/CPP/7zip/UI/Common/PropIDUtils.cpp index 6e91efd8..c2ceceae 100644 --- a/CPP/7zip/UI/Common/PropIDUtils.cpp +++ b/CPP/7zip/UI/Common/PropIDUtils.cpp @@ -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) diff --git a/CPP/7zip/UI/Common/Update.cpp b/CPP/7zip/UI/Common/Update.cpp index b7128659..d2895961 100644 --- a/CPP/7zip/UI/Common/Update.cpp +++ b/CPP/7zip/UI/Common/Update.cpp @@ -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 diff --git a/CPP/7zip/UI/Common/UpdateCallback.cpp b/CPP/7zip/UI/Common/UpdateCallback.cpp index 6be832b8..0115bda3 100644 --- a/CPP/7zip/UI/Common/UpdateCallback.cpp +++ b/CPP/7zip/UI/Common/UpdateCallback.cpp @@ -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())) { diff --git a/CPP/7zip/UI/Common/UpdateProduce.h b/CPP/7zip/UI/Common/UpdateProduce.h index b919965d..f2adc771 100644 --- a/CPP/7zip/UI/Common/UpdateProduce.h +++ b/CPP/7zip/UI/Common/UpdateProduce.h @@ -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 diff --git a/CPP/7zip/UI/Console/List.cpp b/CPP/7zip/UI/Console/List.cpp index 52770c8e..f02296ea 100644 --- a/CPP/7zip/UI/Console/List.cpp +++ b/CPP/7zip/UI/Console/List.cpp @@ -187,7 +187,7 @@ static const CFieldInfoInit kStandardFieldTable[] = }; const int kNumSpacesMax = 32; // it must be larger than max CFieldInfoInit.Width -static char *g_Spaces = +static const char *g_Spaces = " " ; static void PrintSpaces(int numSpaces) diff --git a/CPP/7zip/UI/Explorer/ContextMenu.cpp b/CPP/7zip/UI/Explorer/ContextMenu.cpp index 29ad4945..d0fc1725 100644 --- a/CPP/7zip/UI/Explorer/ContextMenu.cpp +++ b/CPP/7zip/UI/Explorer/ContextMenu.cpp @@ -820,7 +820,7 @@ STDMETHODIMP CZipContextMenu::InvokeCommand(LPCMINVOKECOMMANDINFO commandInfo) // It's fix for bug: crashing in XP. See example in MSDN: "Creating Context Menu Handlers". - #ifndef UNDER_CE + #if !defined(UNDER_CE) && defined(_MSC_VER) if (commandInfo->cbSize == sizeof(CMINVOKECOMMANDINFOEX) && (commandInfo->fMask & CMIC_MASK_UNICODE) != 0) { diff --git a/CPP/7zip/UI/Explorer/Explorer.dsp b/CPP/7zip/UI/Explorer/Explorer.dsp index 80aaf464..84e2a6a4 100644 --- a/CPP/7zip/UI/Explorer/Explorer.dsp +++ b/CPP/7zip/UI/Explorer/Explorer.dsp @@ -367,14 +367,6 @@ SOURCE=..\..\..\Common\StringToInt.h # End Source File # Begin Source File -SOURCE=..\..\..\Common\TextConfig.cpp -# End Source File -# Begin Source File - -SOURCE=..\..\..\Common\TextConfig.h -# End Source File -# Begin Source File - SOURCE=..\..\..\Common\Types.h # End Source File # Begin Source File diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.cpp b/CPP/7zip/UI/Explorer/OptionsDialog.cpp deleted file mode 100644 index c9531fae..00000000 --- a/CPP/7zip/UI/Explorer/OptionsDialog.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// OptionsDialog.cpp - -#include "StdAfx.h" - -#include "Windows/Control/PropertyPage.h" - -#include "../FileManager/DialogSize.h" -#include "../FileManager/LangUtils.h" - -#include "FoldersPage.h" -#include "FoldersPageRes.h" -#include "OptionsDialog.h" -#include "MenuPage.h" -#include "MenuPageRes.h" - -#include "resource.h" - -using namespace NWindows; - -static INT_PTR OptionsDialog(HWND hwndOwner) -{ - CMenuPage systemPage; - CFoldersPage foldersPage; - UINT32 langIDs[] = { 0x01000300, 0x01000200}; - - BIG_DIALOG_SIZE(200, 200); - UINT pageIDs[] = { SIZED_DIALOG(IDD_MENU), SIZED_DIALOG(IDD_FOLDERS) }; - NControl::CPropertyPage *pagePinters[] = { &systemPage, &foldersPage }; - CObjectVector<NControl::CPageInfo> pages; - const int kNumPages = ARRAY_SIZE(langIDs); - for (int i = 0; i < kNumPages; i++) - { - NControl::CPageInfo page; - page.Title = LangString(langIDs[i]); - page.ID = pageIDs[i]; - page.Page = pagePinters[i]; - pages.Add(page); - } - return NControl::MyPropertySheet(pages, hwndOwner, - LangString(IDS_CONFIG_DIALOG_CAPTION, 0x01000000)); -} - -STDMETHODIMP CSevenZipOptions::PluginOptions(HWND hWnd, - IPluginOptionsCallback * /* callback */) -{ - /* - CComBSTR programPath; - RINOK(callback->GetProgramPath(programName))); - */ - OptionsDialog(hWnd); - return S_OK; -} - -STDMETHODIMP CSevenZipOptions::GetFileExtensions(BSTR * /* extensions */) -{ - /* - UString extStrings; - CObjectVector<NZipRootRegistry::CArchiverInfo> formats; - NZipRootRegistry::ReadArchiverInfoList(formats); - for(int i = 0; i < formats.Size(); i++) - { - if (i != 0) - extStrings += L' '; - extStrings += formats[i].Extension; - } - CComBSTR valueTemp = extStrings; - *extensions = valueTemp.Detach(); - return S_OK; - */ - return E_NOTIMPL; -} diff --git a/CPP/7zip/UI/Explorer/OptionsDialog.h b/CPP/7zip/UI/Explorer/OptionsDialog.h deleted file mode 100644 index ac51f6e3..00000000 --- a/CPP/7zip/UI/Explorer/OptionsDialog.h +++ /dev/null @@ -1,23 +0,0 @@ -// OptionsDialog.h - -#ifndef __SEVENZIP_OPTIONSDIALOG_H -#define __SEVENZIP_OPTIONSDIALOG_H - -#include "../FileManager/PluginInterface.h" -#include "Common/MyCom.h" - -// {23170F69-40C1-278D-1000-000100020000} -DEFINE_GUID(CLSID_CSevenZipOptions, - 0x23170F69, 0x40C1, 0x278D, 0x10, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00); - -class CSevenZipOptions: - public IPluginOptions, - public CMyUnknownImp -{ -public: - MY_UNKNOWN_IMP - STDMETHOD(PluginOptions)(HWND hWnd, IPluginOptionsCallback *callback); - STDMETHOD(GetFileExtensions)(BSTR *extensions); -}; - -#endif diff --git a/CPP/7zip/UI/Explorer/makefile b/CPP/7zip/UI/Explorer/makefile index 5a16ffd5..02a4cd6f 100644 --- a/CPP/7zip/UI/Explorer/makefile +++ b/CPP/7zip/UI/Explorer/makefile @@ -25,7 +25,6 @@ COMMON_OBJS = \ $O\Random.obj \ $O\StringConvert.obj \ $O\StringToInt.obj \ - $O\TextConfig.obj \ $O\UTFConvert.obj \ $O\Wildcard.obj \ diff --git a/CPP/7zip/UI/FileManager/FSFolder.cpp b/CPP/7zip/UI/FileManager/FSFolder.cpp index a8541eb2..a27066c3 100644 --- a/CPP/7zip/UI/FileManager/FSFolder.cpp +++ b/CPP/7zip/UI/FileManager/FSFolder.cpp @@ -1004,7 +1004,7 @@ STDMETHODIMP CFSFolder::Rename(UInt32 index, const wchar_t *newName, IProgress * STDMETHODIMP CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,IProgress *progress) { RINOK(progress->SetTotal(numItems)); - int prevDeletedFileIndex = -1; + // int prevDeletedFileIndex = -1; for (UInt32 i = 0; i < numItems; i++) { // Sleep(200); @@ -1025,7 +1025,7 @@ STDMETHODIMP CFSFolder::Delete(const UInt32 *indices, UInt32 numItems,IProgress { const CDirItem &fi = Files[index]; const FString fullPath = _path + GetRelPath(fi); - prevDeletedFileIndex = index; + // prevDeletedFileIndex = index; if (fi.IsDir()) result = RemoveDirWithSubItems(fullPath); else diff --git a/CPP/7zip/UI/FileManager/FSFolderCopy.cpp b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp index 0ef3c724..3f2fc9af 100644 --- a/CPP/7zip/UI/FileManager/FSFolderCopy.cpp +++ b/CPP/7zip/UI/FileManager/FSFolderCopy.cpp @@ -260,7 +260,7 @@ static HRESULT FsCopyFile( &writeAskResult)); if (IntToBool(writeAskResult)) { - FString destPathNew = us2fs(destPathResult); + FString destPathNew = us2fs((const wchar_t *)(BSTR)destPathResult); RINOK(callback->SetCurrentFilePath(fs2us(srcPath))); if (!FsCopyFile(srcPath, destPathNew, callback, completedSize)) { @@ -351,7 +351,7 @@ static HRESULT FsMoveFile( &writeAskResult)); if (IntToBool(writeAskResult)) { - FString destPathNew = us2fs(destPathResult); + FString destPathNew = us2fs((const wchar_t *)(BSTR)destPathResult); RINOK(callback->SetCurrentFilePath(fs2us(srcPath))); if (!FsMoveFile(srcPath, destPathNew, callback, completedSize)) { diff --git a/CPP/7zip/UI/FileManager/HelpUtils.cpp b/CPP/7zip/UI/FileManager/HelpUtils.cpp index fb6fcdd0..bae2365e 100644 --- a/CPP/7zip/UI/FileManager/HelpUtils.cpp +++ b/CPP/7zip/UI/FileManager/HelpUtils.cpp @@ -2,24 +2,28 @@ #include "StdAfx.h" +#include "HelpUtils.h" + +#if defined(UNDER_CE) || !defined(_WIN32) + +void ShowHelpWindow(HWND, LPCWSTR) +{ +} + +#else + #include <HtmlHelp.h> #include "../../../Common/StringConvert.h" #include "../../../Windows/DLL.h" -#include "HelpUtils.h" - static LPCWSTR kHelpFileName = L"7-zip.chm::/"; -#ifdef UNDER_CE -void ShowHelpWindow(HWND, LPCWSTR) -{ -} -#else void ShowHelpWindow(HWND hwnd, LPCWSTR topicFile) { FString path = NWindows::NDLL::GetModuleDirPrefix(); - HtmlHelp(hwnd, GetSystemString(fs2us(path) + kHelpFileName + topicFile), HH_DISPLAY_TOPIC, NULL); + HtmlHelp(hwnd, GetSystemString(fs2us(path) + kHelpFileName + topicFile), HH_DISPLAY_TOPIC, 0); } + #endif diff --git a/CPP/7zip/UI/FileManager/MyWindowsNew.h b/CPP/7zip/UI/FileManager/MyWindowsNew.h index 3e081a96..48a95359 100644 --- a/CPP/7zip/UI/FileManager/MyWindowsNew.h +++ b/CPP/7zip/UI/FileManager/MyWindowsNew.h @@ -3,6 +3,8 @@ #ifndef __MY_WINDOWS_NEW_H #define __MY_WINDOWS_NEW_H +#ifdef _MSC_VER + #include <ShObjIdl.h> #ifndef __ITaskbarList3_INTERFACE_DEFINED__ @@ -70,3 +72,5 @@ struct ITaskbarList3: public ITaskbarList2 #endif #endif + +#endif diff --git a/CPP/7zip/UI/FileManager/Panel.h b/CPP/7zip/UI/FileManager/Panel.h index a9cf6023..dc293729 100644 --- a/CPP/7zip/UI/FileManager/Panel.h +++ b/CPP/7zip/UI/FileManager/Panel.h @@ -577,6 +577,10 @@ public: bool _processTimerMem; CPanel &_panel; + + CDisableTimerProcessing(const CDisableTimerProcessing &); + CDisableTimerProcessing& operator=(const CDisableTimerProcessing &); + public: CDisableTimerProcessing(CPanel &panel): _panel(panel) { Disable(); } @@ -590,7 +594,6 @@ public: { _panel._processTimer = _processTimerMem; } - CDisableTimerProcessing& operator=(const CDisableTimerProcessing &) {; } }; class CDisableNotify @@ -599,6 +602,10 @@ public: bool _processStatusBarMem; CPanel &_panel; + + CDisableNotify(const CDisableNotify &); + CDisableNotify& operator=(const CDisableNotify &); + public: CDisableNotify(CPanel &panel): _panel(panel) { Disable(); } @@ -620,7 +627,6 @@ public: _panel._processNotify = _processNotifyMem; _panel._processStatusBar = _processStatusBarMem; } - CDisableNotify& operator=(const CDisableNotify &) {; } }; // bool _passwordIsDefined; diff --git a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp index 39585cb2..d9beedb8 100644 --- a/CPP/7zip/UI/FileManager/PanelItemOpen.cpp +++ b/CPP/7zip/UI/FileManager/PanelItemOpen.cpp @@ -1137,11 +1137,11 @@ void CPanel::OpenItemInArchive(int index, bool tryInternal, bool tryExternal, bo return; CProcess process; - HRESULT res; + /* HRESULT res; */ if (editMode) - res = StartEditApplication(fs2us(tempFilePath), useEditor, (HWND)*this, process); + /* res = */ StartEditApplication(fs2us(tempFilePath), useEditor, (HWND)*this, process); else - res = StartApplication(fs2us(tempDirNorm), fs2us(tempFilePath), (HWND)*this, process); + /* res = */ StartApplication(fs2us(tempDirNorm), fs2us(tempFilePath), (HWND)*this, process); if ((HANDLE)process == 0) return; diff --git a/CPP/7zip/UI/FileManager/PanelItems.cpp b/CPP/7zip/UI/FileManager/PanelItems.cpp index b8cc6269..8d74b8cd 100644 --- a/CPP/7zip/UI/FileManager/PanelItems.cpp +++ b/CPP/7zip/UI/FileManager/PanelItems.cpp @@ -91,12 +91,12 @@ HRESULT CPanel::InitColumns() ReadListViewInfo(); - PROPID sortID; + // PROPID sortID; /* if (_listViewInfo.SortIndex >= 0) sortID = _listViewInfo.Columns[_listViewInfo.SortIndex].PropID; */ - sortID = _listViewInfo.SortID; + // sortID = _listViewInfo.SortID; _ascending = _listViewInfo.Ascending; diff --git a/CPP/7zip/UI/FileManager/PanelMenu.cpp b/CPP/7zip/UI/FileManager/PanelMenu.cpp index d6dcf6c1..d7108204 100644 --- a/CPP/7zip/UI/FileManager/PanelMenu.cpp +++ b/CPP/7zip/UI/FileManager/PanelMenu.cpp @@ -640,6 +640,10 @@ bool CPanel::InvokePluginCommand(int id) return InvokePluginCommand(id, _sevenZipContextMenu, _systemContextMenu); } +#if defined(_MSC_VER) && !defined(UNDER_CE) +#define use_CMINVOKECOMMANDINFOEX +#endif + bool CPanel::InvokePluginCommand(int id, IContextMenu *sevenZipContextMenu, IContextMenu *systemContextMenu) { @@ -650,7 +654,7 @@ bool CPanel::InvokePluginCommand(int id, else offset = id - kSevenZipStartMenuID; - #ifdef UNDER_CE + #ifndef use_CMINVOKECOMMANDINFOEXR CMINVOKECOMMANDINFO #else CMINVOKECOMMANDINFOEX @@ -659,7 +663,7 @@ bool CPanel::InvokePluginCommand(int id, memset(&commandInfo, 0, sizeof(commandInfo)); commandInfo.cbSize = sizeof(commandInfo); commandInfo.fMask = 0 - #ifndef UNDER_CE + #ifdef use_CMINVOKECOMMANDINFOEXR | CMIC_MASK_UNICODE #endif ; @@ -669,7 +673,7 @@ bool CPanel::InvokePluginCommand(int id, CSysString currentFolderSys = GetSystemString(_currentFolderPrefix); commandInfo.lpDirectory = (LPCSTR)(LPCTSTR)(currentFolderSys); commandInfo.nShow = SW_SHOW; - #ifndef UNDER_CE + #ifdef use_CMINVOKECOMMANDINFOEXR commandInfo.lpParametersW = NULL; commandInfo.lpTitle = ""; commandInfo.lpVerbW = (LPCWSTR)(MAKEINTRESOURCEW(offset)); diff --git a/CPP/7zip/UI/FileManager/PanelOperations.cpp b/CPP/7zip/UI/FileManager/PanelOperations.cpp index 4633aead..28c945e5 100644 --- a/CPP/7zip/UI/FileManager/PanelOperations.cpp +++ b/CPP/7zip/UI/FileManager/PanelOperations.cpp @@ -194,15 +194,15 @@ void CPanel::DeleteItems(bool NON_CE_VAR(toRecycleBin)) fo.fAnyOperationsAborted = FALSE; fo.hNameMappings = 0; fo.lpszProgressTitle = 0; - int res; + // int res; #ifdef _UNICODE - res = ::SHFileOperationW(&fo); + /* res = */ ::SHFileOperationW(&fo); #else SHFileOperationWP shFileOperationW = (SHFileOperationWP) ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHFileOperationW"); if (shFileOperationW == 0) return; - res = shFileOperationW(&fo); + /* res = */ shFileOperationW(&fo); #endif } } @@ -529,7 +529,7 @@ void CPanel::ChangeComment() LangString(IDS_COMMENT2, dlg.Static); if (dlg.Create(GetParent()) != IDOK) return; - NCOM::CPropVariant propVariant = dlg.Value; + NCOM::CPropVariant propVariant = (const wchar_t *)dlg.Value; CDisableNotify disableNotify(*this); HRESULT result = folderOperations->SetProperty(realIndex, kpidComment, &propVariant, NULL); diff --git a/CPP/7zip/UI/FileManager/PanelSort.cpp b/CPP/7zip/UI/FileManager/PanelSort.cpp index 2ca29a15..fe5d3ffd 100644 --- a/CPP/7zip/UI/FileManager/PanelSort.cpp +++ b/CPP/7zip/UI/FileManager/PanelSort.cpp @@ -97,7 +97,7 @@ void CPanel::SetSortRawStatus() int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) { - if (lpData == NULL) + if (lpData == 0) return 0; CPanel *panel = (CPanel*)lpData; @@ -189,7 +189,7 @@ int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) int CALLBACK CompareItems(LPARAM lParam1, LPARAM lParam2, LPARAM lpData) { - if (lpData == NULL) return 0; + if (lpData == 0) return 0; if (lParam1 == kParentIndex) return -1; if (lParam2 == kParentIndex) return 1; diff --git a/CPP/7zip/UI/FileManager/PluginsPage.cpp b/CPP/7zip/UI/FileManager/PluginsPage.cpp deleted file mode 100644 index 39671b75..00000000 --- a/CPP/7zip/UI/FileManager/PluginsPage.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// PluginsPage.cpp - -#include "StdAfx.h" - -#include "Common/MyCom.h" - -#include "Windows/DLL.h" - -#include "HelpUtils.h" -#include "LangUtils.h" -#include "PluginsPage.h" -#include "PluginsPageRes.h" -#include "ProgramLocation.h" -#include "PluginInterface.h" - -static const UInt32 kLangIDs[] = -{ - IDT_PLUGINS_PLUGINS, - IDB_PLUGINS_OPTIONS -}; - -static LPCWSTR kPluginsTopic = L"FM/options.htm#plugins"; - -bool CPluginsPage::OnInit() -{ - LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs)); - - _listView.Attach(GetItem(IDL_PLUGINS)); - - UINT32 newFlags = /* LVS_EX_CHECKBOXES | */ LVS_EX_FULLROWSELECT; - _listView.SetExtendedListViewStyle(newFlags, newFlags); - - _listView.InsertColumn(0, L"Plugins", 50); - - ReadFileFolderPluginInfoList(_plugins); - - _listView.SetRedraw(false); - // _listView.DeleteAllItems(); - for (int i = 0; i < _plugins.Size(); i++) - { - const CPluginInfo &p = _plugins[i]; - if (!p.OptionsClassIDDefined) - continue; - LVITEMW item; - item.iItem = i; - item.mask = LVIF_TEXT | LVIF_STATE; - UString pluginName = p.Name; - item.pszText = (WCHAR *)(const WCHAR *)pluginName; - item.state = 0; - item.stateMask = UINT(-1); - item.iSubItem = 0; - _listView.InsertItem(&item); - _listView.SetCheckState(i, true); - } - _listView.SetRedraw(true); - if (_listView.GetItemCount() > 0) - { - UINT state = LVIS_SELECTED | LVIS_FOCUSED; - _listView.SetItemState(0, state, state); - } - _listView.SetColumnWidthAuto(0); - - return CPropertyPage::OnInit(); -} - -LONG CPluginsPage::OnApply() -{ - /* - int selectedIndex = m_Lang.GetCurSel(); - int aPathIndex = m_Lang.GetItemData(selectedIndex); - SaveRegLang(m_Paths[aPathIndex]); - ReloadLang(); - */ - return PSNRET_NOERROR; -} - -void CPluginsPage::OnNotifyHelp() -{ - ShowHelpWindow(NULL, kPluginsTopic); -} - -bool CPluginsPage::OnButtonClicked(int buttonID, HWND buttonHWND) -{ - switch(buttonID) - { - case IDB_PLUGINS_OPTIONS: - OnButtonOptions(); - break; - default: - return CPropertyPage::OnButtonClicked(buttonID, buttonHWND); - } - return true; -} - -class CPluginOptionsCallback: - public IPluginOptionsCallback, - public CMyUnknownImp -{ - UString _pluginName; -public: - MY_UNKNOWN_IMP - - STDMETHOD(GetProgramFolderPath)(BSTR *value); - STDMETHOD(GetProgramPath)(BSTR *Value); - STDMETHOD(GetRegistryCUPath)(BSTR *Value); - void Init(const UString &pluginName) - { _pluginName = pluginName; } -}; - -STDMETHODIMP CPluginOptionsCallback::GetProgramFolderPath(BSTR *value) -{ - *value = 0; - UString folder; - if (!::GetProgramFolderPath(folder)) - return E_FAIL; - return StringToBstr(folder, value); -} - -static UString GetDefaultProgramName() -{ - return L"7zFM.exe"; -} - -STDMETHODIMP CPluginOptionsCallback::GetProgramPath(BSTR *value) -{ - *value = 0; - UString folder; - if (!::GetProgramFolderPath(folder)) - return E_FAIL; - return StringToBstr(folder + GetDefaultProgramName(), value); -} - -STDMETHODIMP CPluginOptionsCallback::GetRegistryCUPath(BSTR *value) -{ - return StringToBstr(UString(L"Software" - WSTRING_PATH_SEPARATOR L"7-Zip" - WSTRING_PATH_SEPARATOR L"FM" - WSTRING_PATH_SEPARATOR L"Plugins" - WSTRING_PATH_SEPARATOR) + _pluginName, value); -} - -void CPluginsPage::OnButtonOptions() -{ - int index = _listView.GetSelectionMark(); - if (index < 0) - return; - - CPluginInfo pluginInfo = _plugins[index]; - if (!pluginInfo.OptionsClassIDDefined) - { - MessageBoxW(*this, L"There are no options", L"7-Zip", 0); - return; - } - NWindows::NDLL::CLibrary lib; - CMyComPtr<IPluginOptions> pluginOptions; - if (!lib.Load(pluginInfo.FilePath)) - { - MessageBoxW(*this, L"Can't load plugin", L"7-Zip", 0); - return; - } - typedef UINT32 (WINAPI * CreateObjectPointer)(const GUID *clsID, const GUID *interfaceID, void **outObject); - CreateObjectPointer createObject = (CreateObjectPointer)lib.GetProc("CreateObject"); - if (createObject == NULL) - { - MessageBoxW(*this, L"Incorrect plugin", L"7-Zip", 0); - return; - } - if (createObject(&pluginInfo.OptionsClassID, &IID_IPluginOptions, (void **)&pluginOptions) != S_OK) - { - MessageBoxW(*this, L"There are no options", L"7-Zip", 0); - return; - } - CPluginOptionsCallback *callbackSpec = new CPluginOptionsCallback; - CMyComPtr<IPluginOptionsCallback> callback(callbackSpec); - callbackSpec->Init(pluginInfo.Name); - pluginOptions->PluginOptions(*this, callback); -} - -bool CPluginsPage::OnNotify(UINT controlID, LPNMHDR lParam) -{ - if (lParam->hwndFrom == HWND(_listView) && lParam->code == LVN_ITEMCHANGED) - { - const NMLISTVIEW *aNMListView = (const NMLISTVIEW *)lParam; - if ((aNMListView->uChanged & LVIF_STATE) != 0) - { - UINT oldState = aNMListView->uOldState & LVIS_STATEIMAGEMASK; - UINT newState = aNMListView->uNewState & LVIS_STATEIMAGEMASK; - if (oldState != newState) - Changed(); - } - return true; - } - return CPropertyPage::OnNotify(controlID, lParam); -} - -/* -bool CPluginsPage::OnCommand(int code, int itemID, LPARAM lParam) -{ - if (code == CBN_SELCHANGE && itemID == IDC_LANG_COMBO_LANG) - { - Changed(); - return true; - } - return CPropertyPage::OnCommand(code, itemID, lParam); -} - -*/ diff --git a/CPP/7zip/UI/FileManager/PluginsPage.h b/CPP/7zip/UI/FileManager/PluginsPage.h deleted file mode 100644 index 1dcd62d2..00000000 --- a/CPP/7zip/UI/FileManager/PluginsPage.h +++ /dev/null @@ -1,26 +0,0 @@ -// PluginsPage.h - -#include "Windows/Control/ListView.h" - -#ifndef __PLUGINSPAGE_H -#define __PLUGINSPAGE_H - -#include "Windows/Control/PropertyPage.h" -#include "Windows/Control/ComboBox.h" - -#include "RegistryPlugins.h" - -class CPluginsPage: public NWindows::NControl::CPropertyPage -{ - NWindows::NControl::CListView _listView; - CObjectVector<CPluginInfo> _plugins; -public: - virtual bool OnInit(); - virtual void OnNotifyHelp(); - virtual bool OnButtonClicked(int buttonID, HWND buttonHWND); - virtual void OnButtonOptions(); - virtual LONG OnApply(); - virtual bool OnNotify(UINT controlID, LPNMHDR lParam); -}; - -#endif diff --git a/CPP/7zip/UI/FileManager/PluginsPage.rc b/CPP/7zip/UI/FileManager/PluginsPage.rc deleted file mode 100644 index 18e5dfc8..00000000 --- a/CPP/7zip/UI/FileManager/PluginsPage.rc +++ /dev/null @@ -1,15 +0,0 @@ -#include "PluginsPageRes.h" -#include "../../GuiCommon.rc" - -#define xc 96 -#define yc 80 - -IDD_PLUGINS MY_PAGE -CAPTION "Plugins" -BEGIN - LTEXT "&Plugins:", IDC_PLUGINS_STATIC_PLUGINS, m, m, xc, 8 - CONTROL "List1", IDC_PLUGINS_LIST, "SysListView32", - LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, - m, 20, xc, 40 - PUSHBUTTON "Options...", IDC_PLUGINS_BUTTON_OPTIONS, m, by, bxs, bys -END diff --git a/CPP/7zip/UI/FileManager/PluginsPageRes.h b/CPP/7zip/UI/FileManager/PluginsPageRes.h deleted file mode 100644 index 81196d3c..00000000 --- a/CPP/7zip/UI/FileManager/PluginsPageRes.h +++ /dev/null @@ -1,4 +0,0 @@ -#define IDD_PLUGINS 999 -#define IDT_PLUGINS_PLUGINS 999 -#define IDL_PLUGINS 999 -#define IDB_PLUGINS_OPTIONS 999 diff --git a/CPP/7zip/UI/FileManager/ProgressDialog.cpp b/CPP/7zip/UI/FileManager/ProgressDialog.cpp index 6c185769..b4195c18 100644 --- a/CPP/7zip/UI/FileManager/ProgressDialog.cpp +++ b/CPP/7zip/UI/FileManager/ProgressDialog.cpp @@ -54,7 +54,7 @@ bool CProgressDialog::OnInit() _dialogCreatedEvent.Set(); #ifdef LANG - LangSetDlgItemsText(*this, NULL, 0); + LangSetDlgItems(*this, NULL, 0); #endif m_ProgressBar.Attach(GetItem(IDC_PROGRESS1)); diff --git a/CPP/7zip/UI/FileManager/ProgressDialog2.cpp b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp index bccb6e88..c9ca3942 100644 --- a/CPP/7zip/UI/FileManager/ProgressDialog2.cpp +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.cpp @@ -238,16 +238,20 @@ CProgressDialog::CProgressDialog(): _timer(0), CompressingMode(true), MainWindow throw 1334987; if (_createDialogEvent.Create() != S_OK) throw 1334987; + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void**)&_taskbarList); if (_taskbarList) _taskbarList->HrInit(); + #endif } #ifndef _SFX CProgressDialog::~CProgressDialog() { + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ SetTaskbarProgressState(TBPF_NOPROGRESS); + #endif AddToTitle(L""); } void CProgressDialog::AddToTitle(LPCWSTR s) @@ -264,6 +268,7 @@ void CProgressDialog::AddToTitle(LPCWSTR s) void CProgressDialog::SetTaskbarProgressState() { + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ if (_taskbarList && _hwndForTaskbar) { TBPFLAG tbpFlags; @@ -273,6 +278,7 @@ void CProgressDialog::SetTaskbarProgressState() tbpFlags = _errorsWereDisplayed ? TBPF_ERROR: TBPF_NORMAL; SetTaskbarProgressState(tbpFlags); } + #endif } static const unsigned kTitleFileNameSizeLimit = 36; @@ -543,8 +549,10 @@ void CProgressDialog::SetProgressPos(UInt64 pos) pos - _progressBar_Pos >= (_progressBar_Range >> 10)) { m_ProgressBar.SetPos(_progressConv.Count(pos)); + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ if (_taskbarList && _hwndForTaskbar) _taskbarList->SetProgressValue(_hwndForTaskbar, pos, _progressBar_Range); + #endif _progressBar_Pos = pos; } } @@ -935,7 +943,9 @@ INT_PTR CProgressDialog::Create(const UString &title, NWindows::CThread &thread, bool CProgressDialog::OnExternalCloseMessage() { // it doesn't work if there is MessageBox. + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ SetTaskbarProgressState(TBPF_NOPROGRESS); + #endif // AddToTitle(L"Finished "); // SetText(L"Finished2 "); diff --git a/CPP/7zip/UI/FileManager/ProgressDialog2.h b/CPP/7zip/UI/FileManager/ProgressDialog2.h index 632d022a..ea1559a7 100644 --- a/CPP/7zip/UI/FileManager/ProgressDialog2.h +++ b/CPP/7zip/UI/FileManager/ProgressDialog2.h @@ -152,7 +152,9 @@ class CProgressDialog: public NWindows::NControl::CModalDialog int _numMessages; + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ CMyComPtr<ITaskbarList3> _taskbarList; + #endif HWND _hwndForTaskbar; UInt32 _prevTime; @@ -190,11 +192,13 @@ class CProgressDialog: public NWindows::NControl::CModalDialog bool _externalCloseMessageWasReceived; + #ifdef __ITaskbarList3_INTERFACE_DEFINED__ void SetTaskbarProgressState(TBPFLAG tbpFlags) { if (_taskbarList && _hwndForTaskbar) _taskbarList->SetProgressState(_hwndForTaskbar, tbpFlags); } + #endif void SetTaskbarProgressState(); void UpdateStatInfo(bool showAll); diff --git a/CPP/7zip/UI/FileManager/SystemPage.cpp b/CPP/7zip/UI/FileManager/SystemPage.cpp index e4ac706d..a40c4e3d 100644 --- a/CPP/7zip/UI/FileManager/SystemPage.cpp +++ b/CPP/7zip/UI/FileManager/SystemPage.cpp @@ -165,7 +165,7 @@ bool CSystemPage::OnInit() #if NUM_EXT_GROUPS > 1 { ci.iSubItem = 2; - ci.pszText = TEXT("All Users"); + ci.pszText = (LPTSTR)TEXT("All Users"); _listView.InsertColumn(2, &ci); } #endif |