IsoHandler.cpp (p7zip_15.14.1_src_all) | : | IsoHandler.cpp (p7zip_16.02_src_all) | ||
---|---|---|---|---|
skipping to change at line 360 | skipping to change at line 360 | |||
COM_TRY_END | COM_TRY_END | |||
} | } | |||
STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream) | STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream) | |||
{ | { | |||
COM_TRY_BEGIN | COM_TRY_BEGIN | |||
*stream = 0; | *stream = 0; | |||
UInt64 blockIndex; | UInt64 blockIndex; | |||
UInt64 currentItemSize; | UInt64 currentItemSize; | |||
if (index < (UInt32)_archive.Refs.Size()) | if (index < _archive.Refs.Size()) | |||
{ | { | |||
const CRef &ref = _archive.Refs[index]; | const CRef &ref = _archive.Refs[index]; | |||
const CDir &item = ref.Dir->_subItems[ref.Index]; | const CDir &item = ref.Dir->_subItems[ref.Index]; | |||
if (item.IsDir()) | if (item.IsDir()) | |||
return S_FALSE; | return S_FALSE; | |||
if (ref.NumExtents > 1) | if (ref.NumExtents > 1) | |||
{ | { | |||
CExtentsStream *extentStreamSpec = new CExtentsStream(); | CExtentsStream *extentStreamSpec = new CExtentsStream(); | |||
CMyComPtr<ISequentialInStream> extentStream = extentStreamSpec; | CMyComPtr<ISequentialInStream> extentStream = extentStreamSpec; | |||
extentStreamSpec->Stream = _stream; | extentStreamSpec->Stream = _stream; | |||
UInt64 virtOffset = 0; | UInt64 virtOffset = 0; | |||
for (UInt32 i = 0; i < ref.NumExtents; i++) | for (UInt32 i = 0; i < ref.NumExtents; i++) | |||
{ | { | |||
const CDir &item = ref.Dir->_subItems[ref.Index + i]; | const CDir &item2 = ref.Dir->_subItems[ref.Index + i]; | |||
if (item.Size == 0) | if (item2.Size == 0) | |||
continue; | continue; | |||
CSeekExtent se; | CSeekExtent se; | |||
se.Phy = (UInt64)item.ExtentLocation * kBlockSize; | se.Phy = (UInt64)item2.ExtentLocation * kBlockSize; | |||
se.Virt = virtOffset; | se.Virt = virtOffset; | |||
extentStreamSpec->Extents.Add(se); | extentStreamSpec->Extents.Add(se); | |||
virtOffset += item.Size; | virtOffset += item2.Size; | |||
} | } | |||
if (virtOffset != ref.TotalSize) | if (virtOffset != ref.TotalSize) | |||
return S_FALSE; | return S_FALSE; | |||
CSeekExtent se; | CSeekExtent se; | |||
se.Phy = 0; | se.Phy = 0; | |||
se.Virt = virtOffset; | se.Virt = virtOffset; | |||
extentStreamSpec->Extents.Add(se); | extentStreamSpec->Extents.Add(se); | |||
extentStreamSpec->Init(); | extentStreamSpec->Init(); | |||
*stream = extentStream.Detach(); | *stream = extentStream.Detach(); | |||
return S_OK; | return S_OK; | |||
} | } | |||
currentItemSize = item.Size; | currentItemSize = item.Size; | |||
blockIndex = item.ExtentLocation; | blockIndex = item.ExtentLocation; | |||
} | } | |||
else | else | |||
{ | { | |||
unsigned bootIndex = index - _archive.Refs.Size(); | unsigned bootIndex = index - _archive.Refs.Size(); | |||
const CBootInitialEntry &be = _archive.BootEntries[bootIndex]; | const CBootInitialEntry &be = _archive.BootEntries[bootIndex]; | |||
currentItemSize = _archive.GetBootItemSize(bootIndex); | currentItemSize = _archive.GetBootItemSize(bootIndex); | |||
blockIndex = be.LoadRBA; | blockIndex = be.LoadRBA; | |||
} | } | |||
End of changes. 5 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added |