Skip to content

Commit

Permalink
16.04
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Pavlov authored and kornelski committed Dec 8, 2016
1 parent 232ce79 commit 603abd5
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 25 deletions.
8 changes: 4 additions & 4 deletions C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#define MY_VER_MAJOR 16
#define MY_VER_MINOR 03
#define MY_VER_MINOR 04
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "16.03"
#define MY_VERSION "16.03"
#define MY_DATE "2016-09-28"
#define MY_VERSION_NUMBERS "16.04"
#define MY_VERSION "16.04"
#define MY_DATE "2016-10-04"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
4 changes: 2 additions & 2 deletions C/DllSecur.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* DllSecur.c -- DLL loading security
2016-09-15 : Igor Pavlov : Public domain */
2016-10-04 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -42,7 +42,7 @@ void LoadSecurityDlls()
// at Vista (ver 6.0) : CoCreateInstance(CLSID_ShellLink, ...) doesn't work after SetDefaultDllDirectories() : Check it ???
OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMajorVersion != 0)
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
{
Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
Expand Down
19 changes: 17 additions & 2 deletions CPP/7zip/Archive/Rar/Rar5Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,18 @@ bool CItem::Is_CopyLink() const
return FindExtra_Link(link) && link.Type == NLinkType::kFileCopy;
}

bool CItem::Is_HardLink() const
{
CLinkInfo link;
return FindExtra_Link(link) && link.Type == NLinkType::kHardLink;
}

bool CItem::Is_CopyLink_or_HardLink() const
{
CLinkInfo link;
return FindExtra_Link(link) && (link.Type == NLinkType::kFileCopy || link.Type == NLinkType::kHardLink);
}

void CItem::Link_to_Prop(unsigned linkType, NWindows::NCOM::CPropVariant &prop) const
{
CLinkInfo link;
Expand Down Expand Up @@ -2587,7 +2599,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
{
if (testMode)
{
if (item->Is_CopyLink() && item->PackSize == 0)
if (item->NeedUse_as_CopyLink_or_HardLink())
{
RINOK(extractCallback->PrepareOperation(askMode));
RINOK(extractCallback->SetOperationResult(NExtract::NOperationResult::kOK));
Expand All @@ -2599,6 +2611,9 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
if (item->IsService())
continue;

if (item->NeedUse_as_HardLink())
continue;

bool needDecode = false;

for (unsigned n = i + 1; n < _refs.Size(); n++)
Expand Down Expand Up @@ -2639,7 +2654,7 @@ STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
continue;
}

if (item->Is_CopyLink() && item->PackSize == 0)
if (item->NeedUse_as_CopyLink())
{
RINOK(extractCallback->SetOperationResult(
realOutStream ?
Expand Down
4 changes: 4 additions & 0 deletions CPP/7zip/Archive/Rar/Rar5Handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,12 @@ struct CItem
bool FindExtra_Link(CLinkInfo &link) const;
void Link_to_Prop(unsigned linkType, NWindows::NCOM::CPropVariant &prop) const;
bool Is_CopyLink() const;
bool Is_HardLink() const;
bool Is_CopyLink_or_HardLink() const;

bool NeedUse_as_CopyLink() const { return PackSize == 0 && Is_CopyLink(); }
bool NeedUse_as_HardLink() const { return PackSize == 0 && Is_HardLink(); }
bool NeedUse_as_CopyLink_or_HardLink() const { return PackSize == 0 && Is_CopyLink_or_HardLink(); }

bool GetAltStreamName(AString &name) const;

Expand Down
14 changes: 11 additions & 3 deletions CPP/7zip/Compress/Rar2Decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ static const UInt32 kHistorySize = 1 << 20;
static const UInt32 kWindowReservSize = (1 << 22) + 256;

CDecoder::CDecoder():
m_IsSolid(false)
m_IsSolid(false),
m_TablesOK(false)
{
}

Expand All @@ -100,6 +101,8 @@ UInt32 CDecoder::ReadBits(unsigned numBits) { return m_InBitStream.ReadBits(numB

bool CDecoder::ReadTables(void)
{
m_TablesOK = false;

Byte levelLevels[kLevelTableSize];
Byte newLevels[kMaxTableSize];
m_AudioMode = (ReadBits(1) == 1);
Expand Down Expand Up @@ -170,6 +173,9 @@ bool CDecoder::ReadTables(void)
}

memcpy(m_LastLevels, newLevels, kMaxTableSize);

m_TablesOK = true;

return true;
}

Expand Down Expand Up @@ -340,10 +346,12 @@ HRESULT CDecoder::CodeReal(ISequentialInStream *inStream, ISequentialOutStream *
return S_FALSE;
return S_OK;
}
if (!ReadTables())
return S_FALSE;
ReadTables();
}

if (!m_TablesOK)
return S_FALSE;

UInt64 startPos = m_OutWindowStream.GetProcessedSize();
while (pos < unPackSize)
{
Expand Down
21 changes: 12 additions & 9 deletions CPP/7zip/Compress/Rar2Decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,29 @@ class CDecoder :
{
CLzOutWindow m_OutWindowStream;
CBitDecoder m_InBitStream;

UInt32 m_RepDistPtr;
UInt32 m_RepDists[kNumRepDists];

UInt32 m_LastLength;

bool m_IsSolid;
bool m_TablesOK;
bool m_AudioMode;

NHuffman::CDecoder<kNumHuffmanBits, kMainTableSize> m_MainDecoder;
NHuffman::CDecoder<kNumHuffmanBits, kDistTableSize> m_DistDecoder;
NHuffman::CDecoder<kNumHuffmanBits, kLenTableSize> m_LenDecoder;
NHuffman::CDecoder<kNumHuffmanBits, kMMTableSize> m_MMDecoders[NMultimedia::kNumChanelsMax];
NHuffman::CDecoder<kNumHuffmanBits, kLevelTableSize> m_LevelDecoder;

bool m_AudioMode;
UInt64 m_PackSize;

NMultimedia::CFilter2 m_MmFilter;
unsigned m_NumChannels;
NMultimedia::CFilter2 m_MmFilter;

UInt32 m_RepDists[kNumRepDists];
UInt32 m_RepDistPtr;

UInt32 m_LastLength;

Byte m_LastLevels[kMaxTableSize];

UInt64 m_PackSize;
bool m_IsSolid;

void InitStructures();
UInt32 ReadBits(unsigned numBits);
Expand Down
4 changes: 2 additions & 2 deletions DOC/7zip.inf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ AppName = "7-Zip"
InstallDir = %CE1%\%AppName%

[Strings]
AppVer = "16.03"
AppDate = "2016-10-28"
AppVer = "16.04"
AppDate = "2016-10-04"

[CEDevice]
; ProcessorType = 2577 ; ARM
Expand Down
2 changes: 1 addition & 1 deletion DOC/7zip.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
;Defines

!define VERSION_MAJOR 16
!define VERSION_MINOR 03
!define VERSION_MINOR 04
!define VERSION_POSTFIX_FULL ""
!ifdef WIN64
!ifdef IA64
Expand Down
2 changes: 1 addition & 1 deletion DOC/7zip.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<?define VerMajor = "16" ?>
<?define VerMinor = "03" ?>
<?define VerMinor = "04" ?>
<?define VerBuild = "00" ?>
<?define MmVer = "$(var.VerMajor).$(var.VerMinor)" ?>
<?define MmHex = "$(var.VerMajor)$(var.VerMinor)" ?>
Expand Down
2 changes: 1 addition & 1 deletion DOC/readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
7-Zip 16.02 Sources
7-Zip 16.04 Sources
-------------------

7-Zip is a file archiver for Windows.
Expand Down

0 comments on commit 603abd5

Please sign in to comment.