This commit is contained in:
Igor Pavlov
2018-12-30 14:01:47 +00:00
committed by Kornel
parent 18dc2b4161
commit 5b2a99c548
113 changed files with 1805 additions and 932 deletions

View File

@@ -111,7 +111,9 @@ HRESULT CUnpacker::UnpackChunk(
}
else if (method == NMethod::kLZX)
{
lzxDecoderSpec->SetExternalWindow(unpackBuf.Data, chunkSizeBits);
res = lzxDecoderSpec->SetExternalWindow(unpackBuf.Data, chunkSizeBits);
if (res != S_OK)
return E_NOTIMPL;
lzxDecoderSpec->KeepHistoryForNext = false;
lzxDecoderSpec->SetKeepHistory(false);
res = lzxDecoderSpec->Code(packBuf.Data, inSize, (UInt32)outSize);
@@ -563,7 +565,13 @@ void CDatabase::GetItemPath(unsigned index1, bool showImageNumber, NWindows::NCO
wchar_t *dest = s + size;
meta += 2;
for (unsigned i = 0; i < len; i++)
dest[i] = Get16(meta + i * 2);
{
wchar_t c = Get16(meta + i * 2);
// 18.06
if (c == CHAR_PATH_SEPARATOR || c == '/')
c = '_';
dest[i] = c;
}
}
if (index < 0)
return;
@@ -866,7 +874,11 @@ HRESULT CDatabase::ParseImageDirs(CByteBuffer &buf, int parent)
if (DirProcessed == DirSize - 8 && Get64(p + DirSize - 8) != 0)
return S_OK;
return S_FALSE;
// 18.06: we support cases, when some old dism can capture images
// where DirProcessed much smaller than DirSize
HeadersError = true;
return S_OK;
// return S_FALSE;
}

View File

@@ -468,7 +468,7 @@ public:
int ExludedItem; // -1 : if there are no exclude items
CUIntVector VirtualRoots; // we use them for old 1.10 WIM archives
bool ThereIsError() const { return RefCountError; }
bool ThereIsError() const { return RefCountError || HeadersError; }
unsigned GetNumUserItemsInImage(unsigned imageIndex) const
{
@@ -544,7 +544,10 @@ public:
HeadersError = false;
}
CDatabase(): RefCountError(false) {}
CDatabase():
RefCountError(false),
HeadersError(false)
{}
void GetShortName(unsigned index, NWindows::NCOM::CPropVariant &res) const;
void GetItemName(unsigned index1, NWindows::NCOM::CPropVariant &res) const;