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 | |
parent | 7e021179cd9f46b5bf2d48aac84783ff431dd5ac (diff) |
9.389.38
Diffstat (limited to 'CPP')
137 files changed, 2667 insertions, 1427 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 diff --git a/CPP/Common/C_FileIO.h b/CPP/Common/C_FileIO.h index cb043311..ff4ec162 100644 --- a/CPP/Common/C_FileIO.h +++ b/CPP/Common/C_FileIO.h @@ -10,8 +10,10 @@ #include "MyWindows.h" #ifdef _WIN32 +#ifdef _MSC_VER typedef size_t ssize_t; #endif +#endif namespace NC { namespace NFile { diff --git a/CPP/Common/DynLimBuf.cpp b/CPP/Common/DynLimBuf.cpp index ad4ab128..388c5952 100644 --- a/CPP/Common/DynLimBuf.cpp +++ b/CPP/Common/DynLimBuf.cpp @@ -2,17 +2,10 @@ #include "StdAfx.h" -#ifdef _WIN32 -#include <windows.h> -#include <wchar.h> -#else -#include <ctype.h> -#endif - #include "DynLimBuf.h" #include "MyString.h" -CDynLimBuf::CDynLimBuf(size_t limit) +CDynLimBuf::CDynLimBuf(size_t limit) throw() { _chars = 0; _pos = 0; @@ -30,7 +23,7 @@ CDynLimBuf::CDynLimBuf(size_t limit) } } -CDynLimBuf & CDynLimBuf::operator+=(char c) +CDynLimBuf & CDynLimBuf::operator+=(char c) throw() { if (_error) return *this; @@ -62,7 +55,7 @@ CDynLimBuf & CDynLimBuf::operator+=(char c) return *this; } -CDynLimBuf &CDynLimBuf::operator+=(const char *s) +CDynLimBuf &CDynLimBuf::operator+=(const char *s) throw() { if (_error) return *this; diff --git a/CPP/Common/IntToString.cpp b/CPP/Common/IntToString.cpp index 09156e16..ed217c72 100644 --- a/CPP/Common/IntToString.cpp +++ b/CPP/Common/IntToString.cpp @@ -11,12 +11,12 @@ while (i != 0) { i--; *s++ = temp[i]; } \ *s = 0; -void ConvertUInt32ToString(UInt32 val, char *s) +void ConvertUInt32ToString(UInt32 val, char *s) throw() { CONVERT_INT_TO_STR(char, 16); } -void ConvertUInt64ToString(UInt64 val, char *s) +void ConvertUInt64ToString(UInt64 val, char *s) throw() { if (val <= (UInt32)0xFFFFFFFF) { @@ -26,7 +26,7 @@ void ConvertUInt64ToString(UInt64 val, char *s) CONVERT_INT_TO_STR(char, 24); } -void ConvertUInt64ToOct(UInt64 val, char *s) +void ConvertUInt64ToOct(UInt64 val, char *s) throw() { UInt64 v = val; unsigned i; @@ -46,7 +46,7 @@ void ConvertUInt64ToOct(UInt64 val, char *s) while (i); } -void ConvertUInt32ToHex(UInt32 val, char *s) +void ConvertUInt32ToHex(UInt32 val, char *s) throw() { UInt32 v = val; unsigned i; @@ -66,7 +66,7 @@ void ConvertUInt32ToHex(UInt32 val, char *s) while (i); } -void ConvertUInt64ToHex(UInt64 val, char *s) +void ConvertUInt64ToHex(UInt64 val, char *s) throw() { UInt64 v = val; unsigned i; @@ -86,7 +86,7 @@ void ConvertUInt64ToHex(UInt64 val, char *s) while (i); } -void ConvertUInt32ToHex8Digits(UInt32 val, char *s) +void ConvertUInt32ToHex8Digits(UInt32 val, char *s) throw() { s[8] = 0; for (int i = 7; i >= 0; i--) @@ -110,12 +110,12 @@ void ConvertUInt32ToHex8Digits(UInt32 val, wchar_t *s) } */ -void ConvertUInt32ToString(UInt32 val, wchar_t *s) +void ConvertUInt32ToString(UInt32 val, wchar_t *s) throw() { CONVERT_INT_TO_STR(wchar_t, 16); } -void ConvertUInt64ToString(UInt64 val, wchar_t *s) +void ConvertUInt64ToString(UInt64 val, wchar_t *s) throw() { if (val <= (UInt32)0xFFFFFFFF) { @@ -125,7 +125,7 @@ void ConvertUInt64ToString(UInt64 val, wchar_t *s) CONVERT_INT_TO_STR(wchar_t, 24); } -void ConvertInt64ToString(Int64 val, char *s) +void ConvertInt64ToString(Int64 val, char *s) throw() { if (val < 0) { @@ -135,7 +135,7 @@ void ConvertInt64ToString(Int64 val, char *s) ConvertUInt64ToString(val, s); } -void ConvertInt64ToString(Int64 val, wchar_t *s) +void ConvertInt64ToString(Int64 val, wchar_t *s) throw() { if (val < 0) { diff --git a/CPP/Common/Lang.cpp b/CPP/Common/Lang.cpp index c1638ba0..64e561a3 100644 --- a/CPP/Common/Lang.cpp +++ b/CPP/Common/Lang.cpp @@ -8,7 +8,7 @@ #include "../Windows/FileIO.h" -void CLang::Clear() +void CLang::Clear() throw() { delete []_text; _text = 0; @@ -149,7 +149,7 @@ bool CLang::Open(CFSTR fileName, const wchar_t *id) return false; } -const wchar_t *CLang::Get(UInt32 id) const +const wchar_t *CLang::Get(UInt32 id) const throw() { int index = _ids.FindInSorted(id); if (index < 0) diff --git a/CPP/Common/MyInitGuid.h b/CPP/Common/MyInitGuid.h index d6a48698..279fba5d 100644 --- a/CPP/Common/MyInitGuid.h +++ b/CPP/Common/MyInitGuid.h @@ -3,20 +3,43 @@ #ifndef __COMMON_MY_INITGUID_H #define __COMMON_MY_INITGUID_H +/* +This file must be included only to one C++ file in project before +declarations of COM interfaces with DEFINE_GUID macro. + +Each GUID must be initialized exactly once in project. +There are two different versions of the DEFINE_GUID macro in guiddef.h (MyGuidDef.h): + - if INITGUID is not defined: DEFINE_GUID declares an external reference to the symbol name. + - if INITGUID is defined: DEFINE_GUID initializes the symbol name to the value of the GUID. + +Also we need IID_IUnknown that is initialized in some file for linking: + MSVC: by default the linker uses some lib file that contains IID_IUnknown + MinGW: add -luuid switch for linker + WinCE: we define IID_IUnknown in this file + Other: we define IID_IUnknown in this file +*/ + #ifdef _WIN32 + #ifdef UNDER_CE #include <basetyps.h> #endif + #include <initguid.h> + #ifdef UNDER_CE DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); #endif + #else + #define INITGUID #include "MyGuidDef.h" DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); + #endif + #endif diff --git a/CPP/Common/MyMap.cpp b/CPP/Common/MyMap.cpp index db95169e..923846ae 100644 --- a/CPP/Common/MyMap.cpp +++ b/CPP/Common/MyMap.cpp @@ -18,7 +18,7 @@ static UInt32 GetSubBits(UInt32 value, unsigned startPos, unsigned numBits) thro static inline unsigned GetSubBit(UInt32 v, unsigned n) { return (unsigned)(v >> n) & 1; } -bool CMap32::Find(UInt32 key, UInt32 &valueRes) const +bool CMap32::Find(UInt32 key, UInt32 &valueRes) const throw() { valueRes = (UInt32)(Int32)-1; if (Nodes.Size() == 0) diff --git a/CPP/Common/MyString.cpp b/CPP/Common/MyString.cpp index ac407e87..a92f8428 100644 --- a/CPP/Common/MyString.cpp +++ b/CPP/Common/MyString.cpp @@ -29,7 +29,7 @@ inline const char* MyStringGetNextCharPointer(const char *p) throw() } */ -int FindCharPosInString(const char *s, char c) +int FindCharPosInString(const char *s, char c) throw() { for (const char *p = s;; p++) { @@ -41,7 +41,7 @@ int FindCharPosInString(const char *s, char c) } } -int FindCharPosInString(const wchar_t *s, wchar_t c) +int FindCharPosInString(const wchar_t *s, wchar_t c) throw() { for (const wchar_t *p = s;; p++) { @@ -65,7 +65,7 @@ void MyStringUpper_Ascii(wchar_t *s) } */ -void MyStringLower_Ascii(wchar_t *s) +void MyStringLower_Ascii(wchar_t *s) throw() { for (;;) { @@ -91,7 +91,7 @@ void MyStringLower_Ascii(wchar_t *s) // char * MyStringUpper(char *s) { return CharUpperA(s); } // char * MyStringLower(char *s) { return CharLowerA(s); } -wchar_t MyCharUpper_WIN(wchar_t c) +wchar_t MyCharUpper_WIN(wchar_t c) throw() { wchar_t *res = CharUpperW((LPWSTR)(UINT_PTR)(unsigned)c); if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) @@ -159,7 +159,7 @@ wchar_t * MyStringLower(wchar_t *s) #endif -bool IsString1PrefixedByString2(const char *s1, const char *s2) +bool IsString1PrefixedByString2(const char *s1, const char *s2) throw() { for (;;) { @@ -168,7 +168,7 @@ bool IsString1PrefixedByString2(const char *s1, const char *s2) } } -bool StringsAreEqualNoCase(const wchar_t *s1, const wchar_t *s2) +bool StringsAreEqualNoCase(const wchar_t *s1, const wchar_t *s2) throw() { for (;;) { @@ -181,7 +181,7 @@ bool StringsAreEqualNoCase(const wchar_t *s1, const wchar_t *s2) // ---------- ASCII ---------- -bool AString::IsPrefixedBy_Ascii_NoCase(const char *s) const +bool AString::IsPrefixedBy_Ascii_NoCase(const char *s) const throw() { const char *s1 = _chars; for (;;) @@ -196,7 +196,7 @@ bool AString::IsPrefixedBy_Ascii_NoCase(const char *s) const } } -bool UString::IsPrefixedBy_Ascii_NoCase(const char *s) const +bool UString::IsPrefixedBy_Ascii_NoCase(const char *s) const throw() { const wchar_t *s1 = _chars; for (;;) @@ -205,13 +205,12 @@ bool UString::IsPrefixedBy_Ascii_NoCase(const char *s) const if (c2 == 0) return true; wchar_t c1 = *s1++; - if (MyCharLower_Ascii(c1) != - MyCharLower_Ascii(c2)) + if (MyCharLower_Ascii(c1) != (unsigned char)MyCharLower_Ascii(c2)) return false; } } -bool StringsAreEqual_Ascii(const wchar_t *u, const char *a) +bool StringsAreEqual_Ascii(const wchar_t *u, const char *a) throw() { for (;;) { @@ -225,7 +224,7 @@ bool StringsAreEqual_Ascii(const wchar_t *u, const char *a) } } -bool StringsAreEqualNoCase_Ascii(const char *s1, const char *s2) +bool StringsAreEqualNoCase_Ascii(const char *s1, const char *s2) throw() { for (;;) { @@ -238,7 +237,7 @@ bool StringsAreEqualNoCase_Ascii(const char *s1, const char *s2) } } -bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const wchar_t *s2) +bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const wchar_t *s2) throw() { for (;;) { @@ -251,20 +250,20 @@ bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const wchar_t *s2) } } -bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const char *s2) +bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const char *s2) throw() { for (;;) { wchar_t c1 = *s1++; char c2 = *s2++; - if (c1 != c2 && (c1 > 0x7F || MyCharLower_Ascii(c1) != MyCharLower_Ascii(c2))) + if (c1 != (unsigned char)c2 && (c1 > 0x7F || MyCharLower_Ascii(c1) != (unsigned char)MyCharLower_Ascii(c2))) return false; if (c1 == 0) return true; } } -bool IsString1PrefixedByString2(const wchar_t *s1, const wchar_t *s2) +bool IsString1PrefixedByString2(const wchar_t *s1, const wchar_t *s2) throw() { for (;;) { @@ -274,7 +273,7 @@ bool IsString1PrefixedByString2(const wchar_t *s1, const wchar_t *s2) } // NTFS order: uses upper case -int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) +int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) throw() { for (;;) { @@ -291,7 +290,7 @@ int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) } } -int MyStringCompareNoCase_N(const wchar_t *s1, const wchar_t *s2, unsigned num) +int MyStringCompareNoCase_N(const wchar_t *s1, const wchar_t *s2, unsigned num) throw() { for (; num != 0; num--) { @@ -509,7 +508,7 @@ void AString::SetFrom(const char *s, unsigned len) // no check _len = len; } -int AString::Find(const AString &s, unsigned startIndex) const +int AString::Find(const AString &s, unsigned startIndex) const throw() { if (s.IsEmpty()) return startIndex; @@ -525,7 +524,7 @@ int AString::Find(const AString &s, unsigned startIndex) const return -1; } -int AString::ReverseFind(char c) const +int AString::ReverseFind(char c) const throw() { if (_len == 0) return -1; @@ -540,7 +539,7 @@ int AString::ReverseFind(char c) const } } -void AString::TrimLeft() +void AString::TrimLeft() throw() { const char *p = _chars; for (;; p++) @@ -557,7 +556,7 @@ void AString::TrimLeft() } } -void AString::TrimRight() +void AString::TrimRight() throw() { const char *p = _chars; int i; @@ -615,7 +614,7 @@ void AString::Insert(unsigned index, const AString &s) } } -void AString::RemoveChar(char ch) +void AString::RemoveChar(char ch) throw() { int pos = Find(ch); if (pos < 0) @@ -635,7 +634,7 @@ void AString::RemoveChar(char ch) } // !!!!!!!!!!!!!!! test it if newChar = '\0' -void AString::Replace(char oldChar, char newChar) +void AString::Replace(char oldChar, char newChar) throw() { if (oldChar == newChar) return; // 0; @@ -656,7 +655,7 @@ void AString::Replace(char oldChar, char newChar) void AString::Replace(const AString &oldString, const AString &newString) { if (oldString.IsEmpty()) - return; // 0; + return; // 0; if (oldString == newString) return; // 0; unsigned oldLen = oldString.Len(); @@ -676,13 +675,13 @@ void AString::Replace(const AString &oldString, const AString &newString) // return number; } -void AString::Delete(unsigned index) +void AString::Delete(unsigned index) throw() { MoveItems(index, index + 1); _len--; } -void AString::Delete(unsigned index, unsigned count) +void AString::Delete(unsigned index, unsigned count) throw() { if (index + count > _len) count = _len - index; @@ -693,7 +692,7 @@ void AString::Delete(unsigned index, unsigned count) } } -void AString::DeleteFrontal(unsigned num) +void AString::DeleteFrontal(unsigned num) throw() { if (num != 0) { @@ -973,7 +972,7 @@ void UString::AddAsciiStr(const char *s) -int UString::Find(const UString &s, unsigned startIndex) const +int UString::Find(const UString &s, unsigned startIndex) const throw() { if (s.IsEmpty()) return startIndex; @@ -989,7 +988,7 @@ int UString::Find(const UString &s, unsigned startIndex) const return -1; } -int UString::ReverseFind(wchar_t c) const +int UString::ReverseFind(wchar_t c) const throw() { if (_len == 0) return -1; @@ -1004,7 +1003,7 @@ int UString::ReverseFind(wchar_t c) const } } -void UString::TrimLeft() +void UString::TrimLeft() throw() { const wchar_t *p = _chars; for (;; p++) @@ -1021,7 +1020,7 @@ void UString::TrimLeft() } } -void UString::TrimRight() +void UString::TrimRight() throw() { const wchar_t *p = _chars; int i; @@ -1079,7 +1078,7 @@ void UString::Insert(unsigned index, const UString &s) } } -void UString::RemoveChar(wchar_t ch) +void UString::RemoveChar(wchar_t ch) throw() { int pos = Find(ch); if (pos < 0) @@ -1099,7 +1098,7 @@ void UString::RemoveChar(wchar_t ch) } // !!!!!!!!!!!!!!! test it if newChar = '\0' -void UString::Replace(wchar_t oldChar, wchar_t newChar) +void UString::Replace(wchar_t oldChar, wchar_t newChar) throw() { if (oldChar == newChar) return; // 0; @@ -1120,7 +1119,7 @@ void UString::Replace(wchar_t oldChar, wchar_t newChar) void UString::Replace(const UString &oldString, const UString &newString) { if (oldString.IsEmpty()) - return; // 0; + return; // 0; if (oldString == newString) return; // 0; unsigned oldLen = oldString.Len(); @@ -1140,13 +1139,13 @@ void UString::Replace(const UString &oldString, const UString &newString) // return number; } -void UString::Delete(unsigned index) +void UString::Delete(unsigned index) throw() { MoveItems(index, index + 1); _len--; } -void UString::Delete(unsigned index, unsigned count) +void UString::Delete(unsigned index, unsigned count) throw() { if (index + count > _len) count = _len - index; @@ -1157,7 +1156,7 @@ void UString::Delete(unsigned index, unsigned count) } } -void UString::DeleteFrontal(unsigned num) +void UString::DeleteFrontal(unsigned num) throw() { if (num != 0) { diff --git a/CPP/Common/MyString.h b/CPP/Common/MyString.h index b70e9a54..a2ed5382 100644 --- a/CPP/Common/MyString.h +++ b/CPP/Common/MyString.h @@ -29,7 +29,7 @@ inline char *MyStpCpy(char *dest, const char *src) { for (;;) { - Byte c = *src; + char c = *src; *dest = c; if (c == 0) return dest; @@ -248,7 +248,7 @@ public: // int CompareNoCase(const char *s) const { return MyStringCompareNoCase(_chars, s); } // int CompareNoCase(const AString &s) const { return MyStringCompareNoCase(_chars, s._chars); } bool IsPrefixedBy(const char *s) const { return IsString1PrefixedByString2(_chars, s); } - bool IsPrefixedBy_Ascii_NoCase(const char *s) const; + bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw(); int Find(char c) const { return FindCharPosInString(_chars, c); } int Find(char c, unsigned startIndex) const @@ -413,7 +413,7 @@ public: // int CompareNoCase(const wchar_t *s) const { return MyStringCompareNoCase(_chars, s); } // int CompareNoCase(const UString &s) const { return MyStringCompareNoCase(_chars, s._chars); } bool IsPrefixedBy(const wchar_t *s) const { return IsString1PrefixedByString2(_chars, s); }; - bool IsPrefixedBy_Ascii_NoCase(const char *s) const; + bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw(); int Find(wchar_t c) const { return FindCharPosInString(_chars, c); } int Find(wchar_t c, unsigned startIndex) const diff --git a/CPP/Common/MyWindows.cpp b/CPP/Common/MyWindows.cpp index 1d9b1e61..463c77c4 100644 --- a/CPP/Common/MyWindows.cpp +++ b/CPP/Common/MyWindows.cpp @@ -4,87 +4,104 @@ #ifndef _WIN32 +#include <stdlib.h> + #include "MyWindows.h" -#include "Types.h" -#include <malloc.h> static inline void *AllocateForBSTR(size_t cb) { return ::malloc(cb); } static inline void FreeForBSTR(void *pv) { ::free(pv);} -static UINT MyStringLen(const wchar_t *s) -{ - UINT i; - for (i = 0; s[i] != '\0'; i++); - return i; -} - -BSTR SysAllocStringByteLen(LPCSTR psz, UINT len) +/* Win32 uses DWORD (32-bit) type to store size of string before (OLECHAR *) string. + We must select CBstrSizeType for another systems (not Win32): + + if (CBstrSizeType is UINT32), + then we support only strings smaller than 4 GB. + Win32 version always has that limitation. + + if (CBstrSizeType is UINT), + (UINT can be 16/32/64-bit) + We can support strings larger than 4 GB (if UINT is 64-bit), + but sizeof(UINT) can be different in parts compiled by + different compilers/settings, + and we can't send such BSTR strings between such parts. +*/ + +typedef UINT32 CBstrSizeType; +// typedef UINT CBstrSizeType; + +#define k_BstrSize_Max 0xFFFFFFFF +// #define k_BstrSize_Max UINT_MAX +// #define k_BstrSize_Max ((UINT)(INT)-1) + +BSTR SysAllocStringByteLen(LPCSTR s, UINT len) { - int realLen = len + sizeof(UINT) + sizeof(OLECHAR) + sizeof(OLECHAR); - void *p = AllocateForBSTR(realLen); - if (p == 0) - return 0; - *(UINT *)p = len; - BSTR bstr = (BSTR)((UINT *)p + 1); - if (psz) - { - memcpy(bstr, psz, len); - Byte *pb = ((Byte *)bstr) + len; - for (unsigned i = 0; i < sizeof(OLECHAR) * 2; i++) - pb[i] = 0; - } + /* Original SysAllocStringByteLen in Win32 maybe fills only unaligned null OLECHAR at the end. + We provide also aligned null OLECHAR at the end. */ + + if (len >= (k_BstrSize_Max - sizeof(OLECHAR) - sizeof(OLECHAR) - sizeof(CBstrSizeType))) + return NULL; + + UINT size = (len + sizeof(OLECHAR) + sizeof(OLECHAR) - 1) & ~(sizeof(OLECHAR) - 1); + void *p = AllocateForBSTR(size + sizeof(CBstrSizeType)); + if (!p) + return NULL; + *(CBstrSizeType *)p = (CBstrSizeType)len; + BSTR bstr = (BSTR)((CBstrSizeType *)p + 1); + if (s) + memcpy(bstr, s, len); + for (; len < size; len++) + ((Byte *)bstr)[len] = 0; return bstr; } -BSTR SysAllocStringLen(const OLECHAR *sz, UINT len) +BSTR SysAllocStringLen(const OLECHAR *s, UINT len) { - int realLen = sizeof(UINT) + len * sizeof(OLECHAR) + sizeof(OLECHAR); - void *p = AllocateForBSTR(realLen); - if (p == 0) - return 0; - *(UINT *)p = len * sizeof(OLECHAR); - BSTR bstr = (BSTR)((UINT *)p + 1); - if (sz) - { - memcpy(bstr, sz, len * sizeof(OLECHAR)); - bstr[len] = 0; - } + if (len >= (k_BstrSize_Max - sizeof(OLECHAR) - sizeof(CBstrSizeType)) / sizeof(OLECHAR)) + return NULL; + + UINT size = len * sizeof(OLECHAR); + void *p = AllocateForBSTR(size + sizeof(CBstrSizeType) + sizeof(OLECHAR)); + if (!p) + return NULL; + *(CBstrSizeType *)p = (CBstrSizeType)size; + BSTR bstr = (BSTR)((CBstrSizeType *)p + 1); + if (s) + memcpy(bstr, s, size); + bstr[len] = 0; return bstr; } -BSTR SysAllocString(const OLECHAR *sz) +BSTR SysAllocString(const OLECHAR *s) { - if (sz == 0) - return 0; - UINT strLen = MyStringLen(sz); - UINT len = (strLen + 1) * sizeof(OLECHAR); - void *p = AllocateForBSTR(len + sizeof(UINT)); - if (p == 0) + if (!s) return 0; - *(UINT *)p = strLen * sizeof(OLECHAR); - BSTR bstr = (BSTR)((UINT *)p + 1); - memcpy(bstr, sz, len); - return bstr; + const OLECHAR *s2 = s; + while (*s2 != 0) + s2++; + return SysAllocStringLen(s, (UINT)(s2 - s)); } void SysFreeString(BSTR bstr) { - if (bstr != 0) - FreeForBSTR((UINT *)bstr - 1); + if (bstr) + FreeForBSTR((CBstrSizeType *)bstr - 1); } UINT SysStringByteLen(BSTR bstr) { - if (bstr == 0) + if (!bstr) return 0; - return *((UINT *)bstr - 1); + return *((CBstrSizeType *)bstr - 1); } UINT SysStringLen(BSTR bstr) { - return SysStringByteLen(bstr) / sizeof(OLECHAR); + if (!bstr) + return 0; + return *((CBstrSizeType *)bstr - 1) / sizeof(OLECHAR); } + HRESULT VariantClear(VARIANTARG *prop) { if (prop->vt == VT_BSTR) @@ -102,7 +119,7 @@ HRESULT VariantCopy(VARIANTARG *dest, const VARIANTARG *src) { dest->bstrVal = SysAllocStringByteLen((LPCSTR)src->bstrVal, SysStringByteLen(src->bstrVal)); - if (dest->bstrVal == 0) + if (!dest->bstrVal) return E_OUTOFMEMORY; dest->vt = VT_BSTR; } diff --git a/CPP/Common/MyXml.cpp b/CPP/Common/MyXml.cpp index 31e7b3df..8ae0acde 100644 --- a/CPP/Common/MyXml.cpp +++ b/CPP/Common/MyXml.cpp @@ -20,7 +20,7 @@ static bool IsSpaceChar(char c) #define SKIP_SPACES(s) while (IsSpaceChar(*s)) s++; -int CXmlItem::FindProp(const AString &propName) const +int CXmlItem::FindProp(const AString &propName) const throw() { FOR_VECTOR (i, Props) if (Props[i].Name == propName) @@ -36,12 +36,12 @@ AString CXmlItem::GetPropVal(const AString &propName) const return AString(); } -bool CXmlItem::IsTagged(const AString &tag) const +bool CXmlItem::IsTagged(const AString &tag) const throw() { return (IsTag && Name == tag); } -int CXmlItem::FindSubTag(const AString &tag) const +int CXmlItem::FindSubTag(const AString &tag) const throw() { FOR_VECTOR (i, SubItems) if (SubItems[i].IsTagged(tag)) @@ -60,7 +60,7 @@ AString CXmlItem::GetSubString() const return AString(); } -const AString * CXmlItem::GetSubStringPtr() const +const AString * CXmlItem::GetSubStringPtr() const throw() { if (SubItems.Size() == 1) { @@ -192,19 +192,17 @@ const char * CXmlItem::ParseItem(const char *s, int numAllowedLevels) } } -static bool SkipHeader(const AString &s, int &pos, const char *startString, const char *endString) +static const char * SkipHeader(const char *s, const char *startString, const char *endString) { - while (IsSpaceChar(s[pos])) - pos++; - if (IsString1PrefixedByString2(s.Ptr(pos), startString)) + SKIP_SPACES(s); + if (IsString1PrefixedByString2(s, startString)) { - const AString es = endString; - pos = s.Find(es, pos); - if (pos < 0) - return false; - pos += es.Len(); + s = strstr(s, endString); + if (!s) + return NULL; + s += strlen(endString); } - return true; + return s; } void CXmlItem::AppendTo(AString &s) const @@ -242,21 +240,21 @@ void CXmlItem::AppendTo(AString &s) const } } -bool CXml::Parse(const AString &s) +bool CXml::Parse(const char *s) { - int pos = 0; - if (!SkipHeader(s, pos, "<?xml", "?>")) - return false; - if (!SkipHeader(s, pos, "<!DOCTYPE", ">")) - return false; - const char *ptr = Root.ParseItem(s.Ptr(pos), 1000); - if (!ptr || !Root.IsTag) + s = SkipHeader(s, "<?xml", "?>"); if (!s) return false; + s = SkipHeader(s, "<!DOCTYPE", ">"); if (!s) return false; + + s = Root.ParseItem(s, 1000); + if (!s || !Root.IsTag) return false; - SKIP_SPACES(ptr); - return *ptr == 0; + SKIP_SPACES(s); + return *s == 0; } +/* void CXml::AppendTo(AString &s) const { Root.AppendTo(s); } +*/
\ No newline at end of file diff --git a/CPP/Common/MyXml.h b/CPP/Common/MyXml.h index ae3663c3..0e4b21d4 100644 --- a/CPP/Common/MyXml.h +++ b/CPP/Common/MyXml.h @@ -36,8 +36,8 @@ struct CXml { CXmlItem Root; - bool Parse(const AString &s); - void AppendTo(AString &s) const; + bool Parse(const char *s); + // void AppendTo(AString &s) const; }; #endif diff --git a/CPP/Common/StdInStream.cpp b/CPP/Common/StdInStream.cpp index 2d28c735..c35747bb 100644 --- a/CPP/Common/StdInStream.cpp +++ b/CPP/Common/StdInStream.cpp @@ -20,7 +20,7 @@ extern int g_CodePage; CStdInStream g_StdIn(stdin); -bool CStdInStream::Open(LPCTSTR fileName) +bool CStdInStream::Open(LPCTSTR fileName) throw() { Close(); _stream = _tfopen(fileName, kFileOpenMode); @@ -28,7 +28,7 @@ bool CStdInStream::Open(LPCTSTR fileName) return _streamIsOpen; } -bool CStdInStream::Close() +bool CStdInStream::Close() throw() { if (!_streamIsOpen) return true; @@ -80,7 +80,7 @@ void CStdInStream::ReadToString(AString &resultString) resultString += (char)c; } -bool CStdInStream::Eof() +bool CStdInStream::Eof() throw() { return (feof(_stream) != 0); } diff --git a/CPP/Common/StdOutStream.cpp b/CPP/Common/StdOutStream.cpp index 1d6d81a4..6aed31a3 100644 --- a/CPP/Common/StdOutStream.cpp +++ b/CPP/Common/StdOutStream.cpp @@ -18,7 +18,7 @@ extern int g_CodePage; CStdOutStream g_StdOut(stdout); CStdOutStream g_StdErr(stderr); -bool CStdOutStream::Open(const char *fileName) +bool CStdOutStream::Open(const char *fileName) throw() { Close(); _stream = fopen(fileName, kFileOpenMode); @@ -26,7 +26,7 @@ bool CStdOutStream::Open(const char *fileName) return _streamIsOpen; } -bool CStdOutStream::Close() +bool CStdOutStream::Close() throw() { if (!_streamIsOpen) return true; @@ -37,28 +37,16 @@ bool CStdOutStream::Close() return true; } -bool CStdOutStream::Flush() +bool CStdOutStream::Flush() throw() { return (fflush(_stream) == 0); } -CStdOutStream & CStdOutStream::operator<<(CStdOutStream & (*func)(CStdOutStream &)) -{ - (*func)(*this); - return *this; -} - -CStdOutStream & endl(CStdOutStream & outStream) +CStdOutStream & endl(CStdOutStream & outStream) throw() { return outStream << kNewLineChar; } -CStdOutStream & CStdOutStream::operator<<(const char *s) -{ - fputs(s, _stream); - return *this; -} - CStdOutStream & CStdOutStream::operator<<(const wchar_t *s) { int codePage = g_CodePage; @@ -68,12 +56,11 @@ CStdOutStream & CStdOutStream::operator<<(const wchar_t *s) if (codePage == CP_UTF8) ConvertUnicodeToUTF8(s, dest); else - dest = UnicodeStringToMultiByte(s, (UINT)codePage); - *this << (const char *)dest; - return *this; + UnicodeStringToMultiByte2(dest, s, (UINT)codePage); + return operator<<((const char *)dest); } -void CStdOutStream::PrintUString(const UString &s, AString &temp) +void StdOut_Convert_UString_to_AString(const UString &s, AString &temp) { int codePage = g_CodePage; if (codePage == -1) @@ -82,37 +69,36 @@ void CStdOutStream::PrintUString(const UString &s, AString &temp) ConvertUnicodeToUTF8(s, temp); else UnicodeStringToMultiByte2(temp, s, (UINT)codePage); - *this << (const char *)temp; } -CStdOutStream & CStdOutStream::operator<<(char c) +void CStdOutStream::PrintUString(const UString &s, AString &temp) { - fputc(c, _stream); - return *this; + StdOut_Convert_UString_to_AString(s, temp); + *this << (const char *)temp; } -CStdOutStream & CStdOutStream::operator<<(Int32 number) +CStdOutStream & CStdOutStream::operator<<(Int32 number) throw() { char s[32]; ConvertInt64ToString(number, s); return operator<<(s); } -CStdOutStream & CStdOutStream::operator<<(Int64 number) +CStdOutStream & CStdOutStream::operator<<(Int64 number) throw() { char s[32]; ConvertInt64ToString(number, s); return operator<<(s); } -CStdOutStream & CStdOutStream::operator<<(UInt32 number) +CStdOutStream & CStdOutStream::operator<<(UInt32 number) throw() { char s[16]; ConvertUInt32ToString(number, s); return operator<<(s); } -CStdOutStream & CStdOutStream::operator<<(UInt64 number) +CStdOutStream & CStdOutStream::operator<<(UInt64 number) throw() { char s[32]; ConvertUInt64ToString(number, s); diff --git a/CPP/Common/StdOutStream.h b/CPP/Common/StdOutStream.h index 42f43938..5cd40e40 100644 --- a/CPP/Common/StdOutStream.h +++ b/CPP/Common/StdOutStream.h @@ -17,14 +17,32 @@ public: CStdOutStream(FILE *stream): _stream(stream), _streamIsOpen(false) {}; ~CStdOutStream() { Close(); } + // void AttachStdStream(FILE *stream) { _stream = stream; _streamIsOpen = false; } + // bool IsDefined() const { return _stream != NULL; } + operator FILE *() { return _stream; } bool Open(const char *fileName) throw(); bool Close() throw(); bool Flush() throw(); - CStdOutStream & operator<<(CStdOutStream & (* func)(CStdOutStream &)); - CStdOutStream & operator<<(const char *s) throw(); - CStdOutStream & operator<<(char c) throw(); + CStdOutStream & operator<<(CStdOutStream & (* func)(CStdOutStream &)) + { + (*func)(*this); + return *this; + } + + CStdOutStream & operator<<(const char *s) throw() + { + fputs(s, _stream); + return *this; + } + + CStdOutStream & operator<<(char c) throw() + { + fputc(c, _stream); + return *this; + } + CStdOutStream & operator<<(Int32 number) throw(); CStdOutStream & operator<<(Int64 number) throw(); CStdOutStream & operator<<(UInt32 number) throw(); @@ -39,4 +57,6 @@ CStdOutStream & endl(CStdOutStream & outStream) throw(); extern CStdOutStream g_StdOut; extern CStdOutStream g_StdErr; +void StdOut_Convert_UString_to_AString(const UString &s, AString &temp); + #endif diff --git a/CPP/Common/StringToInt.cpp b/CPP/Common/StringToInt.cpp index ea59c0fa..2023fcc2 100644 --- a/CPP/Common/StringToInt.cpp +++ b/CPP/Common/StringToInt.cpp @@ -5,10 +5,11 @@ #include "StringToInt.h" static const UInt32 k_UInt32_max = 0xFFFFFFFF; -static const UInt64 k_UInt64_max = 0xFFFFFFFFFFFFFFFF; +static const UInt64 k_UInt64_max = UINT64_CONST(0xFFFFFFFFFFFFFFFF); +// static const UInt64 k_UInt64_max = (UInt64)(Int64)-1; #define CONVERT_STRING_TO_UINT_FUNC(uintType, charType) \ - uintType ConvertStringTo ## uintType(const charType *s, const charType **end) { \ + uintType ConvertStringTo ## uintType(const charType *s, const charType **end) throw() { \ if (end) *end = s; \ uintType res = 0; \ for (;; s++) { \ @@ -25,7 +26,7 @@ CONVERT_STRING_TO_UINT_FUNC(UInt32, wchar_t) CONVERT_STRING_TO_UINT_FUNC(UInt64, char) CONVERT_STRING_TO_UINT_FUNC(UInt64, wchar_t) -Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) +Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) throw() { if (end) *end = s; @@ -50,7 +51,7 @@ Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) return (Int32)res; } -UInt32 ConvertOctStringToUInt32(const char *s, const char **end) +UInt32 ConvertOctStringToUInt32(const char *s, const char **end) throw() { if (end) *end = s; @@ -71,7 +72,7 @@ UInt32 ConvertOctStringToUInt32(const char *s, const char **end) } } -UInt64 ConvertOctStringToUInt64(const char *s, const char **end) +UInt64 ConvertOctStringToUInt64(const char *s, const char **end) throw() { if (end) *end = s; @@ -92,7 +93,7 @@ UInt64 ConvertOctStringToUInt64(const char *s, const char **end) } } -UInt32 ConvertHexStringToUInt32(const char *s, const char **end) +UInt32 ConvertHexStringToUInt32(const char *s, const char **end) throw() { if (end) *end = s; @@ -117,7 +118,7 @@ UInt32 ConvertHexStringToUInt32(const char *s, const char **end) } } -UInt64 ConvertHexStringToUInt64(const char *s, const char **end) +UInt64 ConvertHexStringToUInt64(const char *s, const char **end) throw() { if (end) *end = s; diff --git a/CPP/Common/TextConfig.cpp b/CPP/Common/TextConfig.cpp index ad368791..9c7ccaf4 100644 --- a/CPP/Common/TextConfig.cpp +++ b/CPP/Common/TextConfig.cpp @@ -107,7 +107,7 @@ bool GetTextConfig(const AString &s, CObjectVector<CTextConfigPair> &pairs) return true; } -int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const UString &id) +int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const UString &id) throw() { FOR_VECTOR (i, pairs) if (pairs[i].ID == id) diff --git a/CPP/Common/UTFConvert.cpp b/CPP/Common/UTFConvert.cpp index c4b9404d..8cb1e9be 100644 --- a/CPP/Common/UTFConvert.cpp +++ b/CPP/Common/UTFConvert.cpp @@ -7,7 +7,7 @@ static const Byte kUtf8Limits[5] = { 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; -bool CheckUTF8(const char *src) +bool CheckUTF8(const char *src) throw() { for (;;) { diff --git a/CPP/Common/Wildcard.cpp b/CPP/Common/Wildcard.cpp index 182256ab..9614f63d 100644 --- a/CPP/Common/Wildcard.cpp +++ b/CPP/Common/Wildcard.cpp @@ -33,7 +33,7 @@ bool IsPath1PrefixedByPath2(const wchar_t *s1, const wchar_t *s2) } } -int CompareFileNames(const wchar_t *s1, const wchar_t *s2) +int CompareFileNames(const wchar_t *s1, const wchar_t *s2) STRING_UNICODE_THROW { if (g_CaseSensitive) return wcscmp(s1, s2); diff --git a/CPP/Windows/COM.cpp b/CPP/Windows/COM.cpp index a746de12..061ec34e 100644 --- a/CPP/Windows/COM.cpp +++ b/CPP/Windows/COM.cpp @@ -2,8 +2,10 @@ #include "StdAfx.h" -#include "Windows/COM.h" -#include "Common/StringConvert.h" +/* + +#include "COM.h" +#include "../Common/StringConvert.h" namespace NWindows { namespace NCOM { @@ -35,3 +37,5 @@ HRESULT StringToGUIDA(const char *string, GUID &classID) } }} + +*/ diff --git a/CPP/Windows/Clipboard.cpp b/CPP/Windows/Clipboard.cpp index bab9db72..e0996930 100644 --- a/CPP/Windows/Clipboard.cpp +++ b/CPP/Windows/Clipboard.cpp @@ -15,13 +15,13 @@ namespace NWindows { -bool CClipboard::Open(HWND wndNewOwner) +bool CClipboard::Open(HWND wndNewOwner) throw() { m_Open = BOOLToBool(::OpenClipboard(wndNewOwner)); return m_Open; } -bool CClipboard::Close() +bool CClipboard::Close() throw() { if (!m_Open) return true; @@ -96,7 +96,7 @@ static bool ClipboardSetData(UINT uFormat, const void *data, size_t size) throw( { NMemory::CGlobalLock globalLock(global); LPVOID p = globalLock.GetPointer(); - if (p == NULL) + if (!p) return false; memcpy(p, data, size); } @@ -117,11 +117,12 @@ bool ClipboardSetText(HWND owner, const UString &s) bool res; res = ClipboardSetData(CF_UNICODETEXT, (const wchar_t *)s, (s.Len() + 1) * sizeof(wchar_t)); #ifndef _UNICODE - AString a; - a = UnicodeStringToMultiByte(s, CP_ACP); - res |= ClipboardSetData(CF_TEXT, (const char *)a, (a.Len() + 1) * sizeof(char)); + AString a = UnicodeStringToMultiByte(s, CP_ACP); + if (ClipboardSetData(CF_TEXT, (const char *)a, (a.Len() + 1) * sizeof(char))) + res = true; a = UnicodeStringToMultiByte(s, CP_OEMCP); - res |= ClipboardSetData(CF_OEMTEXT, (const char *)a, (a.Len() + 1) * sizeof(char)); + if (ClipboardSetData(CF_OEMTEXT, (const char *)a, (a.Len() + 1) * sizeof(char))) + res = true; #endif return res; } diff --git a/CPP/Windows/CommonDialog.cpp b/CPP/Windows/CommonDialog.cpp index 6092b050..52ad77bc 100644 --- a/CPP/Windows/CommonDialog.cpp +++ b/CPP/Windows/CommonDialog.cpp @@ -31,7 +31,7 @@ public: void Finish() { *Buf = 0; } }; -bool CDoubleZeroStringListA::Add(LPCSTR s) +bool CDoubleZeroStringListA::Add(LPCSTR s) throw() { unsigned len = MyStringLen(s) + 1; if (len >= Size) @@ -54,7 +54,7 @@ public: void Finish() { *Buf = 0; } }; -bool CDoubleZeroStringListW::Add(LPCWSTR s) +bool CDoubleZeroStringListW::Add(LPCWSTR s) throw() { unsigned len = MyStringLen(s) + 1; if (len >= Size) diff --git a/CPP/Windows/Console.cpp b/CPP/Windows/Console.cpp index 7773fee2..28ba1c47 100644 --- a/CPP/Windows/Console.cpp +++ b/CPP/Windows/Console.cpp @@ -2,7 +2,7 @@ #include "StdAfx.h" -#include "Windows/Console.h" +#include "Console.h" namespace NWindows{ namespace NConsole{ diff --git a/CPP/Windows/Control/Dialog.cpp b/CPP/Windows/Control/Dialog.cpp index 01bc7d43..9df3ef5e 100644 --- a/CPP/Windows/Control/Dialog.cpp +++ b/CPP/Windows/Control/Dialog.cpp @@ -81,7 +81,7 @@ bool CDialog::OnButtonClicked(int buttonID, HWND /* buttonHWND */) static bool GetWorkAreaRect(RECT *rect) { // use another function for multi-monitor. - return BOOLToBool(::SystemParametersInfo(SPI_GETWORKAREA, NULL, rect, NULL)); + return BOOLToBool(::SystemParametersInfo(SPI_GETWORKAREA, 0, rect, 0)); } bool IsDialogSizeOK(int xSize, int ySize) diff --git a/CPP/Windows/Control/ImageList.cpp b/CPP/Windows/Control/ImageList.cpp index 16a46fa4..3e22b956 100644 --- a/CPP/Windows/Control/ImageList.cpp +++ b/CPP/Windows/Control/ImageList.cpp @@ -2,10 +2,9 @@ #include "StdAfx.h" -#include "Windows/Control/ImageList.h" +#include "ImageList.h" namespace NWindows { namespace NControl { }} - diff --git a/CPP/Windows/Control/ImageList.h b/CPP/Windows/Control/ImageList.h index 72094399..0d9c9313 100644 --- a/CPP/Windows/Control/ImageList.h +++ b/CPP/Windows/Control/ImageList.h @@ -1,7 +1,9 @@ // Windows/Control/ImageList.h -#ifndef __WINDOWS_CONTROL_IMAGELIST_H -#define __WINDOWS_CONTROL_IMAGELIST_H +#ifndef __WINDOWS_CONTROL_IMAGE_LIST_H +#define __WINDOWS_CONTROL_IMAGE_LIST_H + +#include <commctrl.h> #include "../Defs.h" diff --git a/CPP/Windows/Control/PropertyPage.h b/CPP/Windows/Control/PropertyPage.h index 4e7e088e..7df8645e 100644 --- a/CPP/Windows/Control/PropertyPage.h +++ b/CPP/Windows/Control/PropertyPage.h @@ -3,6 +3,8 @@ #ifndef __WINDOWS_CONTROL_PROPERTYPAGE_H #define __WINDOWS_CONTROL_PROPERTYPAGE_H +#include <prsht.h> + #include "Dialog.h" namespace NWindows { diff --git a/CPP/Windows/Control/Window2.cpp b/CPP/Windows/Control/Window2.cpp index e6ddb6d0..019046cd 100644 --- a/CPP/Windows/Control/Window2.cpp +++ b/CPP/Windows/Control/Window2.cpp @@ -56,8 +56,8 @@ bool CWindow2::CreateEx(DWORD exStyle, LPCTSTR className, LPCTSTR windowName, // wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = 0; wc.lpfnWndProc = WindowProcedure; - wc.cbClsExtra = NULL; - wc.cbWndExtra = NULL; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; wc.hInstance = instance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); @@ -103,8 +103,8 @@ bool CWindow2::CreateEx(DWORD exStyle, LPCWSTR className, LPCWSTR windowName, // wc.style = CS_HREDRAW | CS_VREDRAW; wc.style = 0; wc.lpfnWndProc = WindowProcedure; - wc.cbClsExtra = NULL; - wc.cbWndExtra = NULL; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; wc.hInstance = instance; wc.hIcon = NULL; wc.hCursor = LoadCursor(NULL, IDC_ARROW); diff --git a/CPP/Windows/DLL.cpp b/CPP/Windows/DLL.cpp index 367d1be1..cf3dd1ce 100644 --- a/CPP/Windows/DLL.cpp +++ b/CPP/Windows/DLL.cpp @@ -13,7 +13,7 @@ extern HINSTANCE g_hInstance; namespace NWindows { namespace NDLL { -bool CLibrary::Free() +bool CLibrary::Free() throw() { if (_module == 0) return true; @@ -23,7 +23,7 @@ bool CLibrary::Free() return true; } -bool CLibrary::LoadEx(CFSTR path, DWORD flags) +bool CLibrary::LoadEx(CFSTR path, DWORD flags) throw() { if (!Free()) return false; @@ -40,7 +40,7 @@ bool CLibrary::LoadEx(CFSTR path, DWORD flags) return (_module != NULL); } -bool CLibrary::Load(CFSTR path) +bool CLibrary::Load(CFSTR path) throw() { if (!Free()) return false; diff --git a/CPP/Windows/FileFind.cpp b/CPP/Windows/FileFind.cpp index 6d81ae85..c47c6ac9 100644 --- a/CPP/Windows/FileFind.cpp +++ b/CPP/Windows/FileFind.cpp @@ -54,7 +54,7 @@ bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, namespace NFind { -bool CFileInfo::IsDots() const +bool CFileInfo::IsDots() const throw() { if (!IsDir() || Name.IsEmpty()) return false; @@ -104,7 +104,7 @@ static void Convert_WIN32_FIND_DATA_to_FileInfo(const WIN32_FIND_DATA &fd, CFile //////////////////////////////// // CFindFile -bool CFindFileBase::Close() +bool CFindFileBase::Close() throw() { if (_handle == INVALID_HANDLE_VALUE) return true; @@ -187,7 +187,7 @@ struct CFindStreamLoader } } g_FindStreamLoader; -bool CStreamInfo::IsMainStream() const +bool CStreamInfo::IsMainStream() const throw() { return Name == L"::$DATA"; }; @@ -278,7 +278,7 @@ bool CStreamEnumerator::Next(CStreamInfo &si, bool &found) #define MY_CLEAR_FILETIME(ft) ft.dwLowDateTime = ft.dwHighDateTime = 0; -void CFileInfoBase::Clear() +void CFileInfoBase::Clear() throw() { Size = 0; MY_CLEAR_FILETIME(CTime); @@ -486,7 +486,7 @@ bool CEnumerator::Next(CFileInfo &fi, bool &found) // CFindChangeNotification // FindFirstChangeNotification can return 0. MSDN doesn't tell about it. -bool CFindChangeNotification::Close() +bool CFindChangeNotification::Close() throw() { if (!IsHandleAllocated()) return true; diff --git a/CPP/Windows/FileIO.cpp b/CPP/Windows/FileIO.cpp index 188f85fe..ea692a3d 100644 --- a/CPP/Windows/FileIO.cpp +++ b/CPP/Windows/FileIO.cpp @@ -30,6 +30,22 @@ bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, namespace NIO { +/* +WinXP-64 CreateFile(): + "" - ERROR_PATH_NOT_FOUND + :stream - OK + .:stream - ERROR_PATH_NOT_FOUND + .\:stream - OK + + folder\:stream - ERROR_INVALID_NAME + folder:stream - OK + + c:\:stream - OK + + c::stream - ERROR_INVALID_NAME, if current dir is NOT ROOT ( c:\dir1 ) + c::stream - OK, if current dir is ROOT ( c:\ ) +*/ + bool CFileBase::Create(CFSTR path, DWORD desiredAccess, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes) { @@ -55,9 +71,9 @@ bool CFileBase::Create(CFSTR path, DWORD desiredAccess, #ifdef WIN_LONG_PATH if (_handle == INVALID_HANDLE_VALUE && USE_SUPER_PATH) { - UString longPath; - if (GetSuperPath(path, longPath, USE_MAIN_PATH)) - _handle = ::CreateFileW(longPath, desiredAccess, shareMode, + UString superPath; + if (GetSuperPath(path, superPath, USE_MAIN_PATH)) + _handle = ::CreateFileW(superPath, desiredAccess, shareMode, (LPSECURITY_ATTRIBUTES)NULL, creationDisposition, flagsAndAttributes, (HANDLE)NULL); } #endif @@ -65,7 +81,7 @@ bool CFileBase::Create(CFSTR path, DWORD desiredAccess, return (_handle != INVALID_HANDLE_VALUE); } -bool CFileBase::Close() +bool CFileBase::Close() throw() { if (_handle == INVALID_HANDLE_VALUE) return true; @@ -75,12 +91,12 @@ bool CFileBase::Close() return true; } -bool CFileBase::GetPosition(UInt64 &position) const +bool CFileBase::GetPosition(UInt64 &position) const throw() { return Seek(0, FILE_CURRENT, position); } -bool CFileBase::GetLength(UInt64 &length) const +bool CFileBase::GetLength(UInt64 &length) const throw() { #ifdef SUPPORT_DEVICE_FILE if (IsDeviceFile && SizeDefined) @@ -99,7 +115,7 @@ bool CFileBase::GetLength(UInt64 &length) const return true; } -bool CFileBase::Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const +bool CFileBase::Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const throw() { #ifdef SUPPORT_DEVICE_FILE if (IsDeviceFile && SizeDefined && moveMethod == FILE_END) @@ -118,18 +134,18 @@ bool CFileBase::Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition return true; } -bool CFileBase::Seek(UInt64 position, UInt64 &newPosition) const +bool CFileBase::Seek(UInt64 position, UInt64 &newPosition) const throw() { return Seek(position, FILE_BEGIN, newPosition); } -bool CFileBase::SeekToBegin() const +bool CFileBase::SeekToBegin() const throw() { UInt64 newPosition; return Seek(0, newPosition); } -bool CFileBase::SeekToEnd(UInt64 &newPosition) const +bool CFileBase::SeekToEnd(UInt64 &newPosition) const throw() { return Seek(0, FILE_END, newPosition); } @@ -316,7 +332,7 @@ bool CInFile::Open(CFSTR fileName) static UInt32 kChunkSizeMax = (1 << 22); -bool CInFile::Read1(void *data, UInt32 size, UInt32 &processedSize) +bool CInFile::Read1(void *data, UInt32 size, UInt32 &processedSize) throw() { DWORD processedLoc = 0; bool res = BOOLToBool(::ReadFile(_handle, data, size, &processedLoc, NULL)); @@ -324,14 +340,14 @@ bool CInFile::Read1(void *data, UInt32 size, UInt32 &processedSize) return res; } -bool CInFile::ReadPart(void *data, UInt32 size, UInt32 &processedSize) +bool CInFile::ReadPart(void *data, UInt32 size, UInt32 &processedSize) throw() { if (size > kChunkSizeMax) size = kChunkSizeMax; return Read1(data, size, processedSize); } -bool CInFile::Read(void *data, UInt32 size, UInt32 &processedSize) +bool CInFile::Read(void *data, UInt32 size, UInt32 &processedSize) throw() { processedSize = 0; do @@ -367,12 +383,12 @@ bool COutFile::Create(CFSTR fileName, bool createAlways) bool COutFile::CreateAlways(CFSTR fileName, DWORD flagsAndAttributes) { return Open(fileName, FILE_SHARE_READ, GetCreationDisposition(true), flagsAndAttributes); } -bool COutFile::SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) +bool COutFile::SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) throw() { return BOOLToBool(::SetFileTime(_handle, cTime, aTime, mTime)); } -bool COutFile::SetMTime(const FILETIME *mTime) { return SetTime(NULL, NULL, mTime); } +bool COutFile::SetMTime(const FILETIME *mTime) throw() { return SetTime(NULL, NULL, mTime); } -bool COutFile::WritePart(const void *data, UInt32 size, UInt32 &processedSize) +bool COutFile::WritePart(const void *data, UInt32 size, UInt32 &processedSize) throw() { if (size > kChunkSizeMax) size = kChunkSizeMax; @@ -382,7 +398,7 @@ bool COutFile::WritePart(const void *data, UInt32 size, UInt32 &processedSize) return res; } -bool COutFile::Write(const void *data, UInt32 size, UInt32 &processedSize) +bool COutFile::Write(const void *data, UInt32 size, UInt32 &processedSize) throw() { processedSize = 0; do @@ -401,9 +417,9 @@ bool COutFile::Write(const void *data, UInt32 size, UInt32 &processedSize) return true; } -bool COutFile::SetEndOfFile() { return BOOLToBool(::SetEndOfFile(_handle)); } +bool COutFile::SetEndOfFile() throw() { return BOOLToBool(::SetEndOfFile(_handle)); } -bool COutFile::SetLength(UInt64 length) +bool COutFile::SetLength(UInt64 length) throw() { UInt64 newPosition; if (!Seek(length, newPosition)) diff --git a/CPP/Windows/FileIO.h b/CPP/Windows/FileIO.h index 7cb5e83f..4c8e694c 100644 --- a/CPP/Windows/FileIO.h +++ b/CPP/Windows/FileIO.h @@ -3,6 +3,10 @@ #ifndef __WINDOWS_FILE_IO_H #define __WINDOWS_FILE_IO_H +#if defined(_WIN32) && !defined(UNDER_CE) +#include <winioctl.h> +#endif + #include "../Common/MyString.h" #include "../Common/MyBuffer.h" @@ -19,7 +23,9 @@ namespace NWindows { namespace NFile { +#if defined(_WIN32) && !defined(UNDER_CE) bool FillLinkData(CByteBuffer &dest, const wchar_t *path, bool isSymLink); +#endif struct CReparseShortInfo { diff --git a/CPP/Windows/FileLink.cpp b/CPP/Windows/FileLink.cpp index 90ffc420..e65566fd 100644 --- a/CPP/Windows/FileLink.cpp +++ b/CPP/Windows/FileLink.cpp @@ -279,12 +279,12 @@ bool CReparseShortInfo::Parse(const Byte *p, size_t size) len -= 8; p += 8; - UInt32 Flags = 0; + // UInt32 Flags = 0; if (Tag == _my_IO_REPARSE_TAG_SYMLINK) { if (len < 4) return false; - Flags = Get32(p); + // Flags = Get32(p); len -= 4; p += 4; } diff --git a/CPP/Windows/FileMapping.cpp b/CPP/Windows/FileMapping.cpp index 55048fdb..1933f7c8 100644 --- a/CPP/Windows/FileMapping.cpp +++ b/CPP/Windows/FileMapping.cpp @@ -2,7 +2,7 @@ #include "StdAfx.h" -#include "Windows/FileMapping.h" +#include "FileMapping.h" namespace NWindows { namespace NFile { diff --git a/CPP/Windows/FileName.cpp b/CPP/Windows/FileName.cpp index fdf8845e..6f0f6bce 100644 --- a/CPP/Windows/FileName.cpp +++ b/CPP/Windows/FileName.cpp @@ -47,7 +47,7 @@ static const wchar_t *kSuperUncPrefix = L"\\\\?\\UNC\\"; ((s)[2] == 'C' || (s)[2] == 'c') && \ (s)[3] == '\\') -bool IsDevicePath(CFSTR s) +bool IsDevicePath(CFSTR s) throw() { #ifdef UNDER_CE @@ -80,20 +80,20 @@ bool IsDevicePath(CFSTR s) #endif } -bool IsSuperUncPath(CFSTR s) { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)); } +bool IsSuperUncPath(CFSTR s) throw() { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)); } -bool IsDrivePath(const wchar_t *s) { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == '\\'; } -bool IsSuperPath(const wchar_t *s) { return IS_SUPER_PREFIX(s); } -bool IsSuperOrDevicePath(const wchar_t *s) { return IS_SUPER_OR_DEVICE_PATH(s); } +bool IsDrivePath(const wchar_t *s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == '\\'; } +bool IsSuperPath(const wchar_t *s) throw() { return IS_SUPER_PREFIX(s); } +bool IsSuperOrDevicePath(const wchar_t *s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); } // bool IsSuperUncPath(const wchar_t *s) { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)); } #ifndef USE_UNICODE_FSTRING -bool IsDrivePath(CFSTR s) { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == '\\'; } -bool IsSuperPath(CFSTR s) { return IS_SUPER_PREFIX(s); } -bool IsSuperOrDevicePath(CFSTR s) { return IS_SUPER_OR_DEVICE_PATH(s); } +bool IsDrivePath(CFSTR s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == '\\'; } +bool IsSuperPath(CFSTR s) throw() { return IS_SUPER_PREFIX(s); } +bool IsSuperOrDevicePath(CFSTR s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); } #endif // USE_UNICODE_FSTRING -bool IsAbsolutePath(const wchar_t *s) +bool IsAbsolutePath(const wchar_t *s) throw() { return s[0] == WCHAR_PATH_SEPARATOR || IsDrivePath(s); } @@ -102,7 +102,7 @@ static const unsigned kDrivePrefixSize = 3; /* c:\ */ #ifndef USE_UNICODE_FSTRING -static unsigned GetRootPrefixSize_Of_NetworkPath(CFSTR s) +static unsigned GetRootPrefixSize_Of_NetworkPath(CFSTR s) throw() { // Network path: we look "server\path\" as root prefix int pos = FindCharPosInString(s, '\\'); @@ -114,7 +114,7 @@ static unsigned GetRootPrefixSize_Of_NetworkPath(CFSTR s) return pos + pos2 + 2; } -static unsigned GetRootPrefixSize_Of_SimplePath(CFSTR s) +static unsigned GetRootPrefixSize_Of_SimplePath(CFSTR s) throw() { if (IsDrivePath(s)) return kDrivePrefixSize; @@ -124,7 +124,7 @@ static unsigned GetRootPrefixSize_Of_SimplePath(CFSTR s) return (size == 0) ? 0 : 2 + size; } -static unsigned GetRootPrefixSize_Of_SuperPath(CFSTR s) +static unsigned GetRootPrefixSize_Of_SuperPath(CFSTR s) throw() { if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)) { @@ -138,7 +138,7 @@ static unsigned GetRootPrefixSize_Of_SuperPath(CFSTR s) return kSuperPathPrefixSize + pos + 1; } -unsigned GetRootPrefixSize(CFSTR s) +unsigned GetRootPrefixSize(CFSTR s) throw() { if (IS_DEVICE_PATH(s)) return kDevicePathPrefixSize; @@ -149,7 +149,7 @@ unsigned GetRootPrefixSize(CFSTR s) #endif // USE_UNICODE_FSTRING -static unsigned GetRootPrefixSize_Of_NetworkPath(const wchar_t *s) +static unsigned GetRootPrefixSize_Of_NetworkPath(const wchar_t *s) throw() { // Network path: we look "server\path\" as root prefix int pos = FindCharPosInString(s, L'\\'); @@ -161,7 +161,7 @@ static unsigned GetRootPrefixSize_Of_NetworkPath(const wchar_t *s) return pos + pos2 + 2; } -static unsigned GetRootPrefixSize_Of_SimplePath(const wchar_t *s) +static unsigned GetRootPrefixSize_Of_SimplePath(const wchar_t *s) throw() { if (IsDrivePath(s)) return kDrivePrefixSize; @@ -171,7 +171,7 @@ static unsigned GetRootPrefixSize_Of_SimplePath(const wchar_t *s) return (size == 0) ? 0 : 2 + size; } -static unsigned GetRootPrefixSize_Of_SuperPath(const wchar_t *s) +static unsigned GetRootPrefixSize_Of_SuperPath(const wchar_t *s) throw() { if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)) { @@ -185,7 +185,7 @@ static unsigned GetRootPrefixSize_Of_SuperPath(const wchar_t *s) return kSuperPathPrefixSize + pos + 1; } -unsigned GetRootPrefixSize(const wchar_t *s) +unsigned GetRootPrefixSize(const wchar_t *s) throw() { if (IS_DEVICE_PATH(s)) return kDevicePathPrefixSize; @@ -196,12 +196,12 @@ unsigned GetRootPrefixSize(const wchar_t *s) #else // _WIN32 -bool IsAbsolutePath(const wchar_t *s) { return s[0] == WCHAR_PATH_SEPARATOR } +bool IsAbsolutePath(const wchar_t *s) throw() { return s[0] == WCHAR_PATH_SEPARATOR } #ifndef USE_UNICODE_FSTRING -unsigned GetRootPrefixSize(CFSTR s) { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } +unsigned GetRootPrefixSize(CFSTR s) throw() { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } #endif -unsigned GetRootPrefixSize(const wchar_t *s) { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } +unsigned GetRootPrefixSize(const wchar_t *s) throw() { return s[0] == CHAR_PATH_SEPRATOR ? 1 : 0; } #endif // _WIN32 @@ -340,7 +340,7 @@ There are 3 cases: kSuperPathType_UseMainAndSuper : not Super, Good Path */ -int GetUseSuperPathType(CFSTR s) +int GetUseSuperPathType(CFSTR s) throw() { if (IsSuperOrDevicePath(s)) { diff --git a/CPP/Windows/MemoryGlobal.cpp b/CPP/Windows/MemoryGlobal.cpp index 07b9b249..2a22394b 100644 --- a/CPP/Windows/MemoryGlobal.cpp +++ b/CPP/Windows/MemoryGlobal.cpp @@ -7,7 +7,7 @@ namespace NWindows { namespace NMemory { -bool CGlobal::Alloc(UINT flags, SIZE_T size) +bool CGlobal::Alloc(UINT flags, SIZE_T size) throw() { HGLOBAL newBlock = ::GlobalAlloc(flags, size); if (newBlock == NULL) @@ -16,7 +16,7 @@ bool CGlobal::Alloc(UINT flags, SIZE_T size) return true; } -bool CGlobal::Free() +bool CGlobal::Free() throw() { if (_global == NULL) return true; @@ -24,7 +24,7 @@ bool CGlobal::Free() return (_global == NULL); } -bool CGlobal::ReAlloc(SIZE_T size) +bool CGlobal::ReAlloc(SIZE_T size) throw() { HGLOBAL newBlock = ::GlobalReAlloc(_global, size, GMEM_MOVEABLE); if (newBlock == NULL) diff --git a/CPP/Windows/MemoryLock.cpp b/CPP/Windows/MemoryLock.cpp index fa45f760..674af007 100644 --- a/CPP/Windows/MemoryLock.cpp +++ b/CPP/Windows/MemoryLock.cpp @@ -8,7 +8,7 @@ namespace NSecurity { #ifndef UNDER_CE #ifdef _UNICODE -#define MY_FUNC_SELECT(f) :: ## f +#define MY_FUNC_SELECT(f) :: f #else #define MY_FUNC_SELECT(f) my_ ## f extern "C" { diff --git a/CPP/Windows/NationalTime.cpp b/CPP/Windows/NationalTime.cpp index c231d3ce..afd98778 100644 --- a/CPP/Windows/NationalTime.cpp +++ b/CPP/Windows/NationalTime.cpp @@ -2,7 +2,7 @@ #include "StdAfx.h" -#include "Windows/NationalTime.h" +#include "NationalTime.h" namespace NWindows { namespace NNational { diff --git a/CPP/Windows/NationalTime.h b/CPP/Windows/NationalTime.h index 86e014bf..49b0e5e8 100644 --- a/CPP/Windows/NationalTime.h +++ b/CPP/Windows/NationalTime.h @@ -1,9 +1,9 @@ // Windows/NationalTime.h -#ifndef __WINDOWS_NATIONALTIME_H -#define __WINDOWS_NATIONALTIME_H +#ifndef __WINDOWS_NATIONAL_TIME_H +#define __WINDOWS_NATIONAL_TIME_H -#include "Common/String.h" +#include "../Common/MyString.h" namespace NWindows { namespace NNational { diff --git a/CPP/Windows/ProcessUtils.h b/CPP/Windows/ProcessUtils.h index caf9a303..fb9e8dbb 100644 --- a/CPP/Windows/ProcessUtils.h +++ b/CPP/Windows/ProcessUtils.h @@ -30,7 +30,7 @@ public: #endif bool SetPriorityClass(DWORD dwPriorityClass) { return BOOLToBool(::SetPriorityClass(_handle, dwPriorityClass)); } DWORD GetPriorityClass() { return ::GetPriorityClass(_handle); } - bool GetIoCounters(PIO_COUNTERS lpIoCounters ) { return BOOLToBool(::GetProcessIoCounters(_handle, lpIoCounters )); } + // bool GetIoCounters(PIO_COUNTERS lpIoCounters ) { return BOOLToBool(::GetProcessIoCounters(_handle, lpIoCounters )); } bool GetTimes(LPFILETIME creationTime, LPFILETIME exitTime, LPFILETIME kernelTime, LPFILETIME userTime) { return BOOLToBool(::GetProcessTimes(_handle, creationTime, exitTime, kernelTime, userTime)); } diff --git a/CPP/Windows/PropVariant.cpp b/CPP/Windows/PropVariant.cpp index caa4c319..d16f576c 100644 --- a/CPP/Windows/PropVariant.cpp +++ b/CPP/Windows/PropVariant.cpp @@ -9,7 +9,7 @@ namespace NWindows { namespace NCOM { -HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) +HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw() { p->bstrVal = ::SysAllocStringLen(0, numChars); if (!p->bstrVal) @@ -22,10 +22,10 @@ HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) return S_OK; } -HRESULT PropVarEm_Set_Str(PROPVARIANT *p, const char *s) +HRESULT PropVarEm_Set_Str(PROPVARIANT *p, const char *s) throw() { UINT len = (UINT)strlen(s); - p->bstrVal = ::SysAllocStringByteLen(0, (UINT)len * sizeof(OLECHAR)); + p->bstrVal = ::SysAllocStringLen(0, len); if (!p->bstrVal) { p->vt = VT_ERROR; @@ -88,7 +88,7 @@ CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc) vt = VT_BSTR; wReserved1 = 0; bstrVal = ::SysAllocString(lpszSrc); - if (bstrVal == NULL && lpszSrc != NULL) + if (!bstrVal && lpszSrc) { throw kMemException; // vt = VT_ERROR; @@ -103,8 +103,8 @@ CPropVariant& CPropVariant::operator=(const char *s) vt = VT_BSTR; wReserved1 = 0; UINT len = (UINT)strlen(s); - bstrVal = ::SysAllocStringByteLen(0, (UINT)len * sizeof(OLECHAR)); - if (bstrVal == NULL) + bstrVal = ::SysAllocStringLen(0, len); + if (!bstrVal) { throw kMemException; // vt = VT_ERROR; @@ -118,7 +118,7 @@ CPropVariant& CPropVariant::operator=(const char *s) return *this; } -CPropVariant& CPropVariant::operator=(bool bSrc) +CPropVariant& CPropVariant::operator=(bool bSrc) throw() { if (vt != VT_BOOL) { @@ -136,7 +136,7 @@ BSTR CPropVariant::AllocBstr(unsigned numChars) vt = VT_BSTR; wReserved1 = 0; bstrVal = ::SysAllocStringLen(0, numChars); - if (bstrVal == NULL) + if (!bstrVal) { throw kMemException; // vt = VT_ERROR; @@ -146,7 +146,7 @@ BSTR CPropVariant::AllocBstr(unsigned numChars) } #define SET_PROP_FUNC(type, id, dest) \ - CPropVariant& CPropVariant::operator=(type value) \ + CPropVariant& CPropVariant::operator=(type value) throw() \ { if (vt != id) { InternalClear(); vt = id; } \ dest = value; return *this; } @@ -191,14 +191,14 @@ HRESULT PropVariant_Clear(PROPVARIANT *prop) throw() // PropVariantClear can clear VT_BLOB. } -HRESULT CPropVariant::Clear() +HRESULT CPropVariant::Clear() throw() { if (vt == VT_EMPTY) return S_OK; return PropVariant_Clear(this); } -HRESULT CPropVariant::Copy(const PROPVARIANT* pSrc) +HRESULT CPropVariant::Copy(const PROPVARIANT* pSrc) throw() { ::VariantClear((tagVARIANT *)this); switch(pSrc->vt) @@ -226,7 +226,7 @@ HRESULT CPropVariant::Copy(const PROPVARIANT* pSrc) } -HRESULT CPropVariant::Attach(PROPVARIANT *pSrc) +HRESULT CPropVariant::Attach(PROPVARIANT *pSrc) throw() { HRESULT hr = Clear(); if (FAILED(hr)) @@ -236,7 +236,7 @@ HRESULT CPropVariant::Attach(PROPVARIANT *pSrc) return S_OK; } -HRESULT CPropVariant::Detach(PROPVARIANT *pDest) +HRESULT CPropVariant::Detach(PROPVARIANT *pDest) throw() { if (pDest->vt != VT_EMPTY) { @@ -249,7 +249,7 @@ HRESULT CPropVariant::Detach(PROPVARIANT *pDest) return S_OK; } -HRESULT CPropVariant::InternalClear() +HRESULT CPropVariant::InternalClear() throw() { if (vt == VT_EMPTY) return S_OK; @@ -274,7 +274,7 @@ void CPropVariant::InternalCopy(const PROPVARIANT *pSrc) } } -int CPropVariant::Compare(const CPropVariant &a) +int CPropVariant::Compare(const CPropVariant &a) throw() { if (vt != a.vt) return MyCompare(vt, a.vt); diff --git a/CPP/Windows/PropVariantConv.cpp b/CPP/Windows/PropVariantConv.cpp index 95891dd9..dfb93d6d 100644 --- a/CPP/Windows/PropVariantConv.cpp +++ b/CPP/Windows/PropVariantConv.cpp @@ -9,7 +9,7 @@ #define UINT_TO_STR_2(c, val) { s[0] = (c); s[1] = (char)('0' + (val) / 10); s[2] = (char)('0' + (val) % 10); s += 3; } -bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool includeSeconds) +bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool includeSeconds) throw() { SYSTEMTIME st; if (!BOOLToBool(FileTimeToSystemTime(&ft, &st))) @@ -43,7 +43,7 @@ bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool return true; } -void ConvertFileTimeToString(const FILETIME &ft, wchar_t *dest, bool includeTime, bool includeSeconds) +void ConvertFileTimeToString(const FILETIME &ft, wchar_t *dest, bool includeTime, bool includeSeconds) throw() { char s[32]; ConvertFileTimeToString(ft, s, includeTime, includeSeconds); @@ -56,7 +56,7 @@ void ConvertFileTimeToString(const FILETIME &ft, wchar_t *dest, bool includeTime } } -void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) +void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) throw() { *dest = 0; switch (prop.vt) @@ -77,7 +77,7 @@ void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) } } -void ConvertPropVariantToShortString(const PROPVARIANT &prop, wchar_t *dest) +void ConvertPropVariantToShortString(const PROPVARIANT &prop, wchar_t *dest) throw() { *dest = 0; switch (prop.vt) diff --git a/CPP/Windows/Registry.cpp b/CPP/Windows/Registry.cpp index 72685fe6..fe826276 100644 --- a/CPP/Windows/Registry.cpp +++ b/CPP/Windows/Registry.cpp @@ -18,7 +18,7 @@ namespace NRegistry { LONG CKey::Create(HKEY parentKey, LPCTSTR keyName, LPTSTR keyClass, DWORD options, REGSAM accessMask, - LPSECURITY_ATTRIBUTES securityAttributes, LPDWORD disposition) + LPSECURITY_ATTRIBUTES securityAttributes, LPDWORD disposition) throw() { MYASSERT(parentKey != NULL); DWORD dispositionReal; @@ -35,7 +35,7 @@ LONG CKey::Create(HKEY parentKey, LPCTSTR keyName, return res; } -LONG CKey::Open(HKEY parentKey, LPCTSTR keyName, REGSAM accessMask) +LONG CKey::Open(HKEY parentKey, LPCTSTR keyName, REGSAM accessMask) throw() { MYASSERT(parentKey != NULL); HKEY key = NULL; @@ -49,7 +49,7 @@ LONG CKey::Open(HKEY parentKey, LPCTSTR keyName, REGSAM accessMask) return res; } -LONG CKey::Close() +LONG CKey::Close() throw() { LONG res = ERROR_SUCCESS; if (_object != NULL) @@ -62,13 +62,13 @@ LONG CKey::Close() // win95, win98: deletes sunkey and all its subkeys // winNT to be deleted must not have subkeys -LONG CKey::DeleteSubKey(LPCTSTR subKeyName) +LONG CKey::DeleteSubKey(LPCTSTR subKeyName) throw() { MYASSERT(_object != NULL); return RegDeleteKey(_object, subKeyName); } -LONG CKey::RecurseDeleteKey(LPCTSTR subKeyName) +LONG CKey::RecurseDeleteKey(LPCTSTR subKeyName) throw() { CKey key; LONG res = key.Open(_object, subKeyName, KEY_READ | KEY_WRITE); @@ -97,7 +97,7 @@ static inline UInt32 BoolToUINT32(bool value) { return (value ? 1: 0); } static inline bool UINT32ToBool(UInt32 value) { return (value != 0); } -LONG CKey::DeleteValue(LPCTSTR name) +LONG CKey::DeleteValue(LPCTSTR name) throw() { MYASSERT(_object != NULL); return ::RegDeleteValue(_object, name); @@ -113,23 +113,23 @@ LONG CKey::DeleteValue(LPCWSTR name) } #endif -LONG CKey::SetValue(LPCTSTR name, UInt32 value) +LONG CKey::SetValue(LPCTSTR name, UInt32 value) throw() { MYASSERT(_object != NULL); - return RegSetValueEx(_object, name, NULL, REG_DWORD, + return RegSetValueEx(_object, name, 0, REG_DWORD, (BYTE * const)&value, sizeof(UInt32)); } -LONG CKey::SetValue(LPCTSTR name, bool value) +LONG CKey::SetValue(LPCTSTR name, bool value) throw() { return SetValue(name, BoolToUINT32(value)); } -LONG CKey::SetValue(LPCTSTR name, LPCTSTR value) +LONG CKey::SetValue(LPCTSTR name, LPCTSTR value) throw() { MYASSERT(value != NULL); MYASSERT(_object != NULL); - return RegSetValueEx(_object, name, NULL, REG_SZ, + return RegSetValueEx(_object, name, 0, REG_SZ, (const BYTE * )value, (lstrlen(value) + 1) * sizeof(TCHAR)); } @@ -159,11 +159,11 @@ LONG CKey::SetValue(LPCWSTR name, LPCWSTR value) #endif -LONG CKey::SetValue(LPCTSTR name, const void *value, UInt32 size) +LONG CKey::SetValue(LPCTSTR name, const void *value, UInt32 size) throw() { MYASSERT(value != NULL); MYASSERT(_object != NULL); - return RegSetValueEx(_object, name, NULL, REG_BINARY, + return RegSetValueEx(_object, name, 0, REG_BINARY, (const BYTE *)value, size); } @@ -177,7 +177,7 @@ LONG SetValue(HKEY parentKey, LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) return res; } -LONG CKey::SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) +LONG CKey::SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) throw() { MYASSERT(value != NULL); CKey key; @@ -187,9 +187,9 @@ LONG CKey::SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) return res; } -LONG CKey::QueryValue(LPCTSTR name, UInt32 &value) +LONG CKey::QueryValue(LPCTSTR name, UInt32 &value) throw() { - DWORD type = NULL; + DWORD type = 0; DWORD count = sizeof(DWORD); LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)&value, &count); @@ -198,7 +198,7 @@ LONG CKey::QueryValue(LPCTSTR name, UInt32 &value) return res; } -LONG CKey::QueryValue(LPCTSTR name, bool &value) +LONG CKey::QueryValue(LPCTSTR name, bool &value) throw() { UInt32 uintValue = BoolToUINT32(value); LONG res = QueryValue(name, uintValue); @@ -206,7 +206,7 @@ LONG CKey::QueryValue(LPCTSTR name, bool &value) return res; } -LONG CKey::GetValue_IfOk(LPCTSTR name, UInt32 &value) +LONG CKey::GetValue_IfOk(LPCTSTR name, UInt32 &value) throw() { UInt32 newVal; LONG res = QueryValue(name, newVal); @@ -215,7 +215,7 @@ LONG CKey::GetValue_IfOk(LPCTSTR name, UInt32 &value) return res; } -LONG CKey::GetValue_IfOk(LPCTSTR name, bool &value) +LONG CKey::GetValue_IfOk(LPCTSTR name, bool &value) throw() { bool newVal; LONG res = QueryValue(name, newVal); @@ -224,10 +224,10 @@ LONG CKey::GetValue_IfOk(LPCTSTR name, bool &value) return res; } -LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count) +LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count) throw() { MYASSERT(count != NULL); - DWORD type = NULL; + DWORD type = 0; LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count); MYASSERT((res != ERROR_SUCCESS) || (type == REG_SZ) || (type == REG_MULTI_SZ) || (type == REG_EXPAND_SZ)); return res; @@ -236,7 +236,7 @@ LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count) LONG CKey::QueryValue(LPCTSTR name, CSysString &value) { value.Empty(); - DWORD type = NULL; + DWORD type = 0; UInt32 currentSize = 0; LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)¤tSize); if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) @@ -250,7 +250,7 @@ LONG CKey::QueryValue(LPCTSTR name, CSysString &value) LONG CKey::QueryValue(LPCWSTR name, LPWSTR value, UInt32 &count) { MYASSERT(count != NULL); - DWORD type = NULL; + DWORD type = 0; LONG res = RegQueryValueExW(_object, name, NULL, &type, (LPBYTE)value, (DWORD *)&count); MYASSERT((res != ERROR_SUCCESS) || (type == REG_SZ) || (type == REG_MULTI_SZ) || (type == REG_EXPAND_SZ)); return res; @@ -258,7 +258,7 @@ LONG CKey::QueryValue(LPCWSTR name, LPWSTR value, UInt32 &count) LONG CKey::QueryValue(LPCWSTR name, UString &value) { value.Empty(); - DWORD type = NULL; + DWORD type = 0; UInt32 currentSize = 0; LONG res; @@ -280,9 +280,9 @@ LONG CKey::QueryValue(LPCWSTR name, UString &value) } #endif -LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count) +LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count) throw() { - DWORD type = NULL; + DWORD type = 0; LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count); MYASSERT((res != ERROR_SUCCESS) || (type == REG_BINARY)); return res; @@ -291,7 +291,7 @@ LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count) LONG CKey::QueryValue(LPCTSTR name, CByteBuffer &value, UInt32 &dataSize) { - DWORD type = NULL; + DWORD type = 0; dataSize = 0; LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)&dataSize); if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA) @@ -321,7 +321,7 @@ LONG CKey::EnumKeys(CSysStringVector &keyNames) return ERROR_SUCCESS; } -LONG CKey::SetValue_Strings(LPCTSTR valueName, const UStringVector &strings) +LONG CKey::SetValue_Strings(LPCTSTR valueName, const UStringVector &strings) throw() { UInt32 numChars = 0; unsigned i; diff --git a/CPP/Windows/TimeUtils.cpp b/CPP/Windows/TimeUtils.cpp index 0b50845b..7ef44d9c 100644 --- a/CPP/Windows/TimeUtils.cpp +++ b/CPP/Windows/TimeUtils.cpp @@ -16,7 +16,7 @@ static const UInt64 kUnixTimeOffset = (UInt64)60 * 60 * 24 * (89 + 365 * (kUnixTimeStartYear - kFileTimeStartYear)); static const UInt64 kNumSecondsInFileTime = (UInt64)(Int64)-1 / kNumTimeQuantumsInSecond; -bool DosTimeToFileTime(UInt32 dosTime, FILETIME &ft) +bool DosTimeToFileTime(UInt32 dosTime, FILETIME &ft) throw() { #if defined(_WIN32) && !defined(UNDER_CE) return BOOLToBool(::DosDateTimeToFileTime((UInt16)(dosTime >> 16), (UInt16)(dosTime & 0xFFFF), &ft)); @@ -41,7 +41,7 @@ static const UInt32 kLowDosTime = 0x210000; #define PERIOD_100 (PERIOD_4 * 25 - 1) #define PERIOD_400 (PERIOD_100 * 4 + 1) -bool FileTimeToDosTime(const FILETIME &ft, UInt32 &dosTime) +bool FileTimeToDosTime(const FILETIME &ft, UInt32 &dosTime) throw() { #if defined(_WIN32) && !defined(UNDER_CE) @@ -115,31 +115,25 @@ bool FileTimeToDosTime(const FILETIME &ft, UInt32 &dosTime) return true; } -void UnixTimeToFileTime(UInt32 unixTime, FILETIME &ft) +void UnixTimeToFileTime(UInt32 unixTime, FILETIME &ft) throw() { UInt64 v = (kUnixTimeOffset + (UInt64)unixTime) * kNumTimeQuantumsInSecond; ft.dwLowDateTime = (DWORD)v; ft.dwHighDateTime = (DWORD)(v >> 32); } -bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &ft) +bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &ft) throw() { - Int64 v = (Int64)kUnixTimeOffset + unixTime; - if (unixTime < 0) + if (unixTime > kNumSecondsInFileTime - kUnixTimeOffset) { - if (v < 0) - { - ft.dwLowDateTime = ft.dwHighDateTime = 0; - return false; - } + ft.dwLowDateTime = ft.dwHighDateTime = (UInt32)(Int32)-1; + return false; } - else + Int64 v = (Int64)kUnixTimeOffset + unixTime; + if (v < 0) { - if (v < unixTime || v > kNumSecondsInFileTime) - { - ft.dwLowDateTime = ft.dwHighDateTime = (UInt32)(Int32)-1; - return false; - } + ft.dwLowDateTime = ft.dwHighDateTime = 0; + return false; } UInt64 v2 = (UInt64)v * kNumTimeQuantumsInSecond; ft.dwLowDateTime = (DWORD)v2; @@ -147,13 +141,13 @@ bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &ft) return true; } -Int64 FileTimeToUnixTime64(const FILETIME &ft) +Int64 FileTimeToUnixTime64(const FILETIME &ft) throw() { UInt64 winTime = (((UInt64)ft.dwHighDateTime) << 32) + ft.dwLowDateTime; return (Int64)(winTime / kNumTimeQuantumsInSecond) - kUnixTimeOffset; } -bool FileTimeToUnixTime(const FILETIME &ft, UInt32 &unixTime) +bool FileTimeToUnixTime(const FILETIME &ft, UInt32 &unixTime) throw() { UInt64 winTime = (((UInt64)ft.dwHighDateTime) << 32) + ft.dwLowDateTime; winTime /= kNumTimeQuantumsInSecond; @@ -173,7 +167,7 @@ bool FileTimeToUnixTime(const FILETIME &ft, UInt32 &unixTime) } bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day, - unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds) + unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds) throw() { resSeconds = 0; if (year < kFileTimeStartYear || year >= 10000 || month < 1 || month > 12 || @@ -192,7 +186,7 @@ bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day, return true; } -void GetCurUtcFileTime(FILETIME &ft) +void GetCurUtcFileTime(FILETIME &ft) throw() { // Both variants provide same low resolution on WinXP: about 15 ms. // But GetSystemTimeAsFileTime is much faster. diff --git a/CPP/Windows/Window.h b/CPP/Windows/Window.h index 2446499a..1b12d991 100644 --- a/CPP/Windows/Window.h +++ b/CPP/Windows/Window.h @@ -238,7 +238,7 @@ public: bool SetText(LPCTSTR s) { return BOOLToBool(::SetWindowText(_window, s)); } #ifndef _UNICODE - bool CWindow::SetText(LPCWSTR s) { return MySetWindowText(_window, s); } + bool SetText(LPCWSTR s) { return MySetWindowText(_window, s); } #endif int GetTextLength() const |