aboutsummaryrefslogtreecommitdiff
path: root/CPP/7zip/Archive/VhdxHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/VhdxHandler.cpp')
-rw-r--r--CPP/7zip/Archive/VhdxHandler.cpp133
1 files changed, 71 insertions, 62 deletions
diff --git a/CPP/7zip/Archive/VhdxHandler.cpp b/CPP/7zip/Archive/VhdxHandler.cpp
index 0fc83ac..e3ddedd 100644
--- a/CPP/7zip/Archive/VhdxHandler.cpp
+++ b/CPP/7zip/Archive/VhdxHandler.cpp
@@ -20,8 +20,8 @@
20#define Get32(p) GetUi32(p) 20#define Get32(p) GetUi32(p)
21#define Get64(p) GetUi64(p) 21#define Get64(p) GetUi64(p)
22 22
23#define G32(_offs_, dest) dest = Get32(p + (_offs_)); 23#define G32(_offs_, dest) dest = Get32(p + (_offs_))
24#define G64(_offs_, dest) dest = Get64(p + (_offs_)); 24#define G64(_offs_, dest) dest = Get64(p + (_offs_))
25 25
26using namespace NWindows; 26using namespace NWindows;
27 27
@@ -33,7 +33,7 @@ EXTERN_C_BEGIN
33 33
34static UInt32 g_Crc32c_Table[256]; 34static UInt32 g_Crc32c_Table[256];
35 35
36static void MY_FAST_CALL Crc32c_GenerateTable() 36static void Z7_FASTCALL Crc32c_GenerateTable()
37{ 37{
38 UInt32 i; 38 UInt32 i;
39 for (i = 0; i < 256; i++) 39 for (i = 0; i < 256; i++)
@@ -46,13 +46,24 @@ static void MY_FAST_CALL Crc32c_GenerateTable()
46 } 46 }
47} 47}
48 48
49UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table);
50 49
51#define CRC32C_INIT_VAL 0xFFFFFFFF 50#define CRC32C_INIT_VAL 0xFFFFFFFF
52 51
53static UInt32 MY_FAST_CALL Crc32c_Calc(const void *data, size_t size) 52#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
53
54// UInt32 Z7_FASTCALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table);
55static UInt32 Z7_FASTCALL CrcUpdateT1_vhdx(UInt32 v, const void *data, size_t size, const UInt32 *table)
54{ 56{
55 return CrcUpdateT1(CRC32C_INIT_VAL, data, size, g_Crc32c_Table) ^ CRC32C_INIT_VAL; 57 const Byte *p = (const Byte *)data;
58 const Byte *pEnd = p + size;
59 for (; p != pEnd; p++)
60 v = CRC_UPDATE_BYTE_2(v, *p);
61 return v;
62}
63
64static UInt32 Z7_FASTCALL Crc32c_Calc(const void *data, size_t size)
65{
66 return CrcUpdateT1_vhdx(CRC32C_INIT_VAL, data, size, g_Crc32c_Table) ^ CRC32C_INIT_VAL;
56} 67}
57 68
58EXTERN_C_END 69EXTERN_C_END
@@ -61,12 +72,11 @@ EXTERN_C_END
61namespace NArchive { 72namespace NArchive {
62namespace NVhdx { 73namespace NVhdx {
63 74
64static struct C_CRC32c_TableInit { C_CRC32c_TableInit() { Crc32c_GenerateTable(); } } g__CRC32c_TableInit; 75static struct C_CRC32c_TableInit { C_CRC32c_TableInit() { Crc32c_GenerateTable(); } } g_CRC32c_TableInit;
65 76
66#define SIGNATURE { 'v', 'h', 'd', 'x', 'f', 'i', 'l', 'e' }
67
68static const unsigned kSignatureSize = 8; 77static const unsigned kSignatureSize = 8;
69static const Byte kSignature[kSignatureSize] = SIGNATURE; 78static const Byte kSignature[kSignatureSize] =
79 { 'v', 'h', 'd', 'x', 'f', 'i', 'l', 'e' };
70 80
71static const unsigned kBitmapSize_Log = 20; 81static const unsigned kBitmapSize_Log = 20;
72static const size_t kBitmapSize = (size_t)1 << kBitmapSize_Log; 82static const size_t kBitmapSize = (size_t)1 << kBitmapSize_Log;
@@ -105,7 +115,7 @@ static int DecodeFrom2HexChars(const wchar_t *s)
105{ 115{
106 const int v0 = HexToVal(s[0]); if (v0 < 0) return -1; 116 const int v0 = HexToVal(s[0]); if (v0 < 0) return -1;
107 const int v1 = HexToVal(s[1]); if (v1 < 0) return -1; 117 const int v1 = HexToVal(s[1]); if (v1 < 0) return -1;
108 return ((unsigned)v0 << 4) | (unsigned)v1; 118 return (int)(((unsigned)v0 << 4) | (unsigned)v1);
109} 119}
110 120
111 121
@@ -183,7 +193,7 @@ struct CHeader
183 if (!Guids[i].IsEqualTo(h.Guids[i])) 193 if (!Guids[i].IsEqualTo(h.Guids[i]))
184 return false; 194 return false;
185 return true; 195 return true;
186 }; 196 }
187 197
188 bool Parse(Byte *p); 198 bool Parse(Byte *p);
189}; 199};
@@ -195,7 +205,7 @@ bool CHeader::Parse(Byte *p)
195 if (Get32(p) != 0x64616568) // "head" 205 if (Get32(p) != 0x64616568) // "head"
196 return false; 206 return false;
197 const UInt32 crc = Get32(p + 4); 207 const UInt32 crc = Get32(p + 4);
198 SetUi32(p + 4, 0); 208 SetUi32(p + 4, 0)
199 if (Crc32c_Calc(p, kHeader2Size) != crc) 209 if (Crc32c_Calc(p, kHeader2Size) != crc)
200 return false; 210 return false;
201 G64(8, SequenceNumber); 211 G64(8, SequenceNumber);
@@ -277,7 +287,7 @@ bool CRegion::Parse(Byte *p)
277 if (Get32(p) != 0x69676572) // "regi" 287 if (Get32(p) != 0x69676572) // "regi"
278 return false; 288 return false;
279 const UInt32 crc = Get32(p + 4); 289 const UInt32 crc = Get32(p + 4);
280 SetUi32(p + 4, 0); 290 SetUi32(p + 4, 0)
281 const UInt32 crc_calced = Crc32c_Calc(p, kRegionSize); 291 const UInt32 crc_calced = Crc32c_Calc(p, kRegionSize);
282 if (crc_calced != crc) 292 if (crc_calced != crc)
283 return false; 293 return false;
@@ -372,7 +382,7 @@ bool CMetaEntry::Parse(const Byte *p)
372 if ((Flags1 & 3) != 0) // Reserved2 382 if ((Flags1 & 3) != 0) // Reserved2
373 return false; 383 return false;
374 return true; 384 return true;
375}; 385}
376 386
377 387
378struct CParentPair 388struct CParentPair
@@ -406,7 +416,7 @@ struct CMetaHeader
406 { 416 {
407 const CParentPair &pair = ParentPairs[i]; 417 const CParentPair &pair = ParentPairs[i];
408 if (pair.Key.IsEqualTo(name)) 418 if (pair.Key.IsEqualTo(name))
409 return i; 419 return (int)i;
410 } 420 }
411 return -1; 421 return -1;
412 } 422 }
@@ -628,7 +638,7 @@ struct CBat
628 638
629 639
630 640
631class CHandler: public CHandlerImg 641Z7_class_CHandler_final: public CHandlerImg
632{ 642{
633 UInt64 _phySize; 643 UInt64 _phySize;
634 644
@@ -657,11 +667,11 @@ class CHandler: public CHandlerImg
657 CMyComPtr<IInStream> ParentStream; 667 CMyComPtr<IInStream> ParentStream;
658 CHandler *Parent; 668 CHandler *Parent;
659 UString _errorMessage; 669 UString _errorMessage;
660 UString _Creator; 670 UString _creator;
661 671
662 bool _nonEmptyLog; 672 bool _nonEmptyLog;
663 bool _isDataContiguous; 673 bool _isDataContiguous;
664 // bool _BatOverlap; 674 // bool _batOverlap;
665 675
666 CGuid _parentGuid; 676 CGuid _parentGuid;
667 bool _parentGuid_IsDefined; 677 bool _parentGuid_IsDefined;
@@ -756,15 +766,15 @@ class CHandler: public CHandlerImg
756 bool CheckBat(); 766 bool CheckBat();
757 767
758 HRESULT Open3(); 768 HRESULT Open3();
759 HRESULT Open2(IInStream *stream, IArchiveOpenCallback *openArchiveCallback); 769 HRESULT Open2(IInStream *stream, IArchiveOpenCallback *openArchiveCallback) Z7_override;
760 HRESULT OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_parentFileWasOpen); 770 HRESULT OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_parentFileWasOpen);
761 virtual void CloseAtError(); 771 virtual void CloseAtError() Z7_override;
762 772
763public: 773public:
764 INTERFACE_IInArchive_Img(;) 774 Z7_IFACE_COM7_IMP(IInArchive_Img)
765 775
766 STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream); 776 Z7_IFACE_COM7_IMP(IInArchiveGetStream)
767 STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); 777 Z7_IFACE_COM7_IMP(ISequentialInStream)
768 778
769 CHandler(): 779 CHandler():
770 _child(NULL), 780 _child(NULL),
@@ -777,7 +787,7 @@ public:
777 787
778HRESULT CHandler::Seek2(UInt64 offset) 788HRESULT CHandler::Seek2(UInt64 offset)
779{ 789{
780 return Stream->Seek(offset, STREAM_SEEK_SET, NULL); 790 return InStream_SeekSet(Stream, offset);
781} 791}
782 792
783 793
@@ -833,8 +843,8 @@ HRESULT CHandler::ReadPhy(UInt64 offset, void *data, UInt32 size, UInt32 &proces
833#define SB_BLOCK_NOT_PRESENT 0 843#define SB_BLOCK_NOT_PRESENT 0
834#define SB_BLOCK_PRESENT 6 844#define SB_BLOCK_PRESENT 6
835 845
836#define BAT_GET_OFFSET(v) ((v) & ~(UInt64)0xFFFFF); 846#define BAT_GET_OFFSET(v) ((v) & ~(UInt64)0xFFFFF)
837#define BAT_GET_STATE(v) ((UInt32)(v) & 7); 847#define BAT_GET_STATE(v) ((UInt32)(v) & 7)
838 848
839/* The log contains only updates to metadata, bat and region tables 849/* The log contains only updates to metadata, bat and region tables
840 The log doesn't contain updates to start header, and 2 headers (first 192 KB of file). 850 The log doesn't contain updates to start header, and 2 headers (first 192 KB of file).
@@ -1154,10 +1164,10 @@ bool CHandler::CheckBat()
1154HRESULT CHandler::Open3() 1164HRESULT CHandler::Open3()
1155{ 1165{
1156 { 1166 {
1157 static const unsigned kHeaderSize = 512; // + 8 1167 const unsigned kHeaderSize = 512; // + 8
1158 Byte header[kHeaderSize]; 1168 Byte header[kHeaderSize];
1159 1169
1160 RINOK(Read_FALSE(header, kHeaderSize)); 1170 RINOK(Read_FALSE(header, kHeaderSize))
1161 1171
1162 if (memcmp(header, kSignature, kSignatureSize) != 0) 1172 if (memcmp(header, kSignature, kSignatureSize) != 0)
1163 return S_FALSE; 1173 return S_FALSE;
@@ -1168,7 +1178,7 @@ HRESULT CHandler::Open3()
1168 const wchar_t c = Get16(p + i); 1178 const wchar_t c = Get16(p + i);
1169 if (c < 0x20 || c > 0x7F) 1179 if (c < 0x20 || c > 0x7F)
1170 break; 1180 break;
1171 _Creator += c; 1181 _creator += c;
1172 } 1182 }
1173 } 1183 }
1174 1184
@@ -1178,8 +1188,8 @@ HRESULT CHandler::Open3()
1178 Byte header[kHeader2Size]; 1188 Byte header[kHeader2Size];
1179 for (unsigned i = 0; i < 2; i++) 1189 for (unsigned i = 0; i < 2; i++)
1180 { 1190 {
1181 RINOK(Seek2((1 << 16) * (1 + i))); 1191 RINOK(Seek2((1 << 16) * (1 + i)))
1182 RINOK(Read_FALSE(header, kHeader2Size)); 1192 RINOK(Read_FALSE(header, kHeader2Size))
1183 bool headerIsOK = headers[i].Parse(header); 1193 bool headerIsOK = headers[i].Parse(header);
1184 if (!headerIsOK) 1194 if (!headerIsOK)
1185 return S_FALSE; 1195 return S_FALSE;
@@ -1233,8 +1243,8 @@ HRESULT CHandler::Open3()
1233 { 1243 {
1234 CByteBuffer temp; 1244 CByteBuffer temp;
1235 temp.Alloc(kRegionSize * 2); 1245 temp.Alloc(kRegionSize * 2);
1236 RINOK(Seek2((1 << 16) * 3)); 1246 RINOK(Seek2((1 << 16) * 3))
1237 RINOK(Read_FALSE(temp, kRegionSize * 2)); 1247 RINOK(Read_FALSE(temp, kRegionSize * 2))
1238 unsigned numTables = 1; 1248 unsigned numTables = 1;
1239 if (memcmp(temp, temp + kRegionSize, kRegionSize) != 0) 1249 if (memcmp(temp, temp + kRegionSize, kRegionSize) != 0)
1240 { 1250 {
@@ -1249,7 +1259,7 @@ HRESULT CHandler::Open3()
1249 if (regions[i].Parse(temp)) 1259 if (regions[i].Parse(temp))
1250 { 1260 {
1251 if (correctRegionIndex < 0) 1261 if (correctRegionIndex < 0)
1252 correctRegionIndex = i; 1262 correctRegionIndex = (int)i;
1253 } 1263 }
1254 else 1264 else
1255 { 1265 {
@@ -1281,8 +1291,8 @@ HRESULT CHandler::Open3()
1281 // static const kMetaTableSize = 1 << 16; 1291 // static const kMetaTableSize = 1 << 16;
1282 CByteBuffer temp; 1292 CByteBuffer temp;
1283 { 1293 {
1284 RINOK(Seek2(e.Offset)); 1294 RINOK(Seek2(e.Offset))
1285 RINOK(ReadToBuf_FALSE(temp, e.Len)); 1295 RINOK(ReadToBuf_FALSE(temp, e.Len))
1286 } 1296 }
1287 if (!Meta.Parse(temp, temp.Size())) 1297 if (!Meta.Parse(temp, temp.Size()))
1288 return S_FALSE; 1298 return S_FALSE;
@@ -1297,15 +1307,15 @@ HRESULT CHandler::Open3()
1297 return S_FALSE; 1307 return S_FALSE;
1298 // UpdatePhySize(e.GetEndPos()); 1308 // UpdatePhySize(e.GetEndPos());
1299 { 1309 {
1300 RINOK(Seek2(e.Offset)); 1310 RINOK(Seek2(e.Offset))
1301 RINOK(ReadToBuf_FALSE(Bat.Data, e.Len)); 1311 RINOK(ReadToBuf_FALSE(Bat.Data, e.Len))
1302 } 1312 }
1303 if (!ParseBat()) 1313 if (!ParseBat())
1304 return S_FALSE; 1314 return S_FALSE;
1305 if (!CheckBat()) 1315 if (!CheckBat())
1306 { 1316 {
1307 AddErrorMessage("BAT overlap"); 1317 AddErrorMessage("BAT overlap");
1308 // _BatOverlap = true; 1318 // _batOverlap = true;
1309 // return S_FALSE; 1319 // return S_FALSE;
1310 } 1320 }
1311 } 1321 }
@@ -1327,13 +1337,13 @@ HRESULT CHandler::Open3()
1327 { 1337 {
1328 // absolute paths for parent stream can be rejected later in client callback 1338 // absolute paths for parent stream can be rejected later in client callback
1329 // the order of check by specification: 1339 // the order of check by specification:
1330 static const char * const g_ParentKeys[] = 1340 const char * const g_ParentKeys[] =
1331 { 1341 {
1332 "relative_path" // "..\..\path2\sub3\parent.vhdx" 1342 "relative_path" // "..\..\path2\sub3\parent.vhdx"
1333 , "volume_path" // "\\?\Volume{26A21BDA-A627-11D7-9931-806E6F6E6963}\path2\sub3\parent.vhdx") 1343 , "volume_path" // "\\?\Volume{26A21BDA-A627-11D7-9931-806E6F6E6963}\path2\sub3\parent.vhdx")
1334 , "absolute_win32_path" // "d:\path2\sub3\parent.vhdx" 1344 , "absolute_win32_path" // "d:\path2\sub3\parent.vhdx"
1335 }; 1345 };
1336 for (unsigned i = 0; i < ARRAY_SIZE(g_ParentKeys); i++) 1346 for (unsigned i = 0; i < Z7_ARRAY_SIZE(g_ParentKeys); i++)
1337 { 1347 {
1338 const int index = Meta.FindParentKey(g_ParentKeys[i]); 1348 const int index = Meta.FindParentKey(g_ParentKeys[i]);
1339 if (index < 0) 1349 if (index < 0)
@@ -1368,7 +1378,7 @@ HRESULT CHandler::Open3()
1368 1378
1369 // _posInArc = 0; 1379 // _posInArc = 0;
1370 // Reset_PosInArc(); 1380 // Reset_PosInArc();
1371 // RINOK(Stream->Seek(0, STREAM_SEEK_SET, NULL)); 1381 // RINOK(InStream_SeekToBegin(Stream))
1372 1382
1373 return S_OK; 1383 return S_OK;
1374} 1384}
@@ -1384,7 +1394,7 @@ static struct CCounter { ~CCounter()
1384} } g_Counter; 1394} } g_Counter;
1385*/ 1395*/
1386 1396
1387STDMETHODIMP CHandler::Read(void *data, UInt32 size, UInt32 *processedSize) 1397Z7_COM7F_IMF(CHandler::Read(void *data, UInt32 size, UInt32 *processedSize))
1388{ 1398{
1389 // g_NumCalls++; 1399 // g_NumCalls++;
1390 if (processedSize) 1400 if (processedSize)
@@ -1489,7 +1499,7 @@ STDMETHODIMP CHandler::Read(void *data, UInt32 size, UInt32 *processedSize)
1489 return S_FALSE; 1499 return S_FALSE;
1490 // if (ParentStream) 1500 // if (ParentStream)
1491 { 1501 {
1492 RINOK(ParentStream->Seek(_virtPos, STREAM_SEEK_SET, NULL)); 1502 RINOK(InStream_SeekSet(ParentStream, _virtPos))
1493 size_t processed = size; 1503 size_t processed = size;
1494 res = ReadStream(ParentStream, (Byte *)data, &processed); 1504 res = ReadStream(ParentStream, (Byte *)data, &processed);
1495 size = (UInt32)processed; 1505 size = (UInt32)processed;
@@ -1668,7 +1678,7 @@ void CHandler::AddComment(UString &s) const
1668 1678
1669 1679
1670 1680
1671STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value) 1681Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
1672{ 1682{
1673 COM_TRY_BEGIN 1683 COM_TRY_BEGIN
1674 NCOM::CPropVariant prop; 1684 NCOM::CPropVariant prop;
@@ -1735,8 +1745,8 @@ STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
1735 } 1745 }
1736 case kpidCreatorApp: 1746 case kpidCreatorApp:
1737 { 1747 {
1738 if (!_Creator.IsEmpty()) 1748 if (!_creator.IsEmpty())
1739 prop = _Creator; 1749 prop = _creator;
1740 break; 1750 break;
1741 } 1751 }
1742 case kpidId: 1752 case kpidId:
@@ -1808,7 +1818,7 @@ HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *openArchiveCall
1808 if (_level >= (1 << 20)) 1818 if (_level >= (1 << 20))
1809 return S_FALSE; 1819 return S_FALSE;
1810 1820
1811 RINOK(Open3()); 1821 RINOK(Open3())
1812 1822
1813 NumLevels = 1; 1823 NumLevels = 1;
1814 PackSize_Total = GetPackSize(); 1824 PackSize_Total = GetPackSize();
@@ -1882,12 +1892,11 @@ HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *openArchiveCall
1882HRESULT CHandler::OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_parentFileWasOpen) 1892HRESULT CHandler::OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_parentFileWasOpen)
1883{ 1893{
1884 _parentFileWasOpen = false; 1894 _parentFileWasOpen = false;
1885 CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback; 1895 Z7_DECL_CMyComPtr_QI_FROM(
1886 openArchiveCallback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&openVolumeCallback); 1896 IArchiveOpenVolumeCallback,
1887 1897 openVolumeCallback, openArchiveCallback)
1888 if (!openVolumeCallback) 1898 if (!openVolumeCallback)
1889 return S_FALSE; 1899 return S_FALSE;
1890
1891 { 1900 {
1892 CMyComPtr<IInStream> nextStream; 1901 CMyComPtr<IInStream> nextStream;
1893 HRESULT res = S_FALSE; 1902 HRESULT res = S_FALSE;
@@ -1961,7 +1970,7 @@ HRESULT CHandler::OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_p
1961 UInt64 numBytes = (UInt64)NumUsedBitMaps << kBitmapSize_Log; 1970 UInt64 numBytes = (UInt64)NumUsedBitMaps << kBitmapSize_Log;
1962 if (openArchiveCallback && numBytes != 0) 1971 if (openArchiveCallback && numBytes != 0)
1963 { 1972 {
1964 RINOK(openArchiveCallback->SetTotal(NULL, &numBytes)); 1973 RINOK(openArchiveCallback->SetTotal(NULL, &numBytes))
1965 } 1974 }
1966 numBytes = 0; 1975 numBytes = 0;
1967 for (size_t i = ChunkRatio; i < TotalBatEntries; i += ChunkRatio + 1) 1976 for (size_t i = ChunkRatio; i < TotalBatEntries; i += ChunkRatio + 1)
@@ -1975,12 +1984,12 @@ HRESULT CHandler::OpenParent(IArchiveOpenCallback *openArchiveCallback, bool &_p
1975 { 1984 {
1976 if (openArchiveCallback) 1985 if (openArchiveCallback)
1977 { 1986 {
1978 RINOK(openArchiveCallback->SetCompleted(NULL, &numBytes)); 1987 RINOK(openArchiveCallback->SetCompleted(NULL, &numBytes))
1979 } 1988 }
1980 numBytes += kBitmapSize; 1989 numBytes += kBitmapSize;
1981 buf.Alloc(kBitmapSize); 1990 buf.Alloc(kBitmapSize);
1982 RINOK(Seek2(offset)); 1991 RINOK(Seek2(offset))
1983 RINOK(Read_FALSE(buf, kBitmapSize)); 1992 RINOK(Read_FALSE(buf, kBitmapSize))
1984 /* 1993 /*
1985 for (unsigned i = 0; i < (1 << 20); i+=4) 1994 for (unsigned i = 0; i < (1 << 20); i+=4)
1986 { 1995 {
@@ -2018,11 +2027,11 @@ void CHandler::CloseAtError()
2018 Parent = NULL; 2027 Parent = NULL;
2019 ParentStream.Release(); 2028 ParentStream.Release();
2020 _errorMessage.Empty(); 2029 _errorMessage.Empty();
2021 _Creator.Empty(); 2030 _creator.Empty();
2022 _nonEmptyLog = false; 2031 _nonEmptyLog = false;
2023 _parentGuid_IsDefined = false; 2032 _parentGuid_IsDefined = false;
2024 _isDataContiguous = false; 2033 _isDataContiguous = false;
2025 // _BatOverlap = false; 2034 // _batOverlap = false;
2026 2035
2027 ParentNames.Clear(); 2036 ParentNames.Clear();
2028 ParentName_Used.Empty(); 2037 ParentName_Used.Empty();
@@ -2039,14 +2048,14 @@ void CHandler::CloseAtError()
2039 _isCyclic_or_CyclicParent = false; 2048 _isCyclic_or_CyclicParent = false;
2040} 2049}
2041 2050
2042STDMETHODIMP CHandler::Close() 2051Z7_COM7F_IMF(CHandler::Close())
2043{ 2052{
2044 CloseAtError(); 2053 CloseAtError();
2045 return S_OK; 2054 return S_OK;
2046} 2055}
2047 2056
2048 2057
2049STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value) 2058Z7_COM7F_IMF(CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value))
2050{ 2059{
2051 COM_TRY_BEGIN 2060 COM_TRY_BEGIN
2052 NCOM::CPropVariant prop; 2061 NCOM::CPropVariant prop;
@@ -2064,7 +2073,7 @@ STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIAN
2064} 2073}
2065 2074
2066 2075
2067STDMETHODIMP CHandler::GetStream(UInt32 /* index */, ISequentialInStream **stream) 2076Z7_COM7F_IMF(CHandler::GetStream(UInt32 /* index */, ISequentialInStream **stream))
2068{ 2077{
2069 COM_TRY_BEGIN 2078 COM_TRY_BEGIN
2070 *stream = NULL; 2079 *stream = NULL;