namespace NArcInfoFlags
{ const UInt32 kKeepName = 1 << 0; // keep name of file in archive name const UInt32 kAltStreams = 1 << 1; // the handler supports alt streams const UInt32 kNtSecure = 1 << 2; // the handler supports NT security const UInt32 kFindSignature = 1 << 3; // the handler can find start of archive const UInt32 kMultiSignature = 1 << 4; // there are several signatures const UInt32 kUseGlobalOffset = 1 << 5; // the seek position of stream must be set as global offset const UInt32 kStartOpen = 1 << 6; // call handler for each start position const UInt32 kPureStartOpen = 1 << 7; // call handler only for start of file const UInt32 kBackwardOpen = 1 << 8; // archive can be open backward const UInt32 kPreArc = 1 << 9; // such archive can be stored before real archive (like SFX stub) const UInt32 kSymLinks = 1 << 10; // the handler supports symbolic links const UInt32 kHardLinks = 1 << 11; // the handler supports hard links
}
7-Zip doesn't call IArchiveExtractCallback functions GetStream() PrepareOperation() SetOperationResult() from different threads simultaneously. But 7-Zip can call functions for IProgress or ICompressProgressInfo functions from another threads simultaneously with calls for IArchiveExtractCallback interface.
IArchiveExtractCallback::GetStream() UInt32 index - index of item in Archive Int32 askExtractMode (Extract::NAskMode) if (askMode != NExtract::NAskMode::kExtract) { then the callee can not real stream: (*inStream == NULL) } Out: (*inStream == NULL) - for directories (*inStream == NULL) - if link (hard link or symbolic link) was created if (*inStream == NULL && askMode == NExtract::NAskMode::kExtract) { then the caller must skip extracting of that file. }
returns: S_OK : OK S_FALSE : data error (for decoders)
if (IProgress::SetTotal() was called) { IProgress::SetCompleted(completeValue) uses packSize - for some stream formats (xz, gz, bz2, lzma, z, ppmd). unpackSize - for another formats. } else { IProgress::SetCompleted(completeValue) uses packSize. }
SetOperationResult() 7-Zip calls SetOperationResult at the end of extracting, so the callee can close the file, set attributes, timestamps and security information.
/* IArchiveExtractCallbackMessage can be requested from IArchiveExtractCallback object by Extract() or UpdateItems() functions to report about extracting errors ReportExtractResult() UInt32 indexType (NEventIndexType) UInt32 index Int32 opRes (NExtract::NOperationResult)
*/
/* IInArchive::Open stream if (kUseGlobalOffset), stream current position can be non 0. if (!kUseGlobalOffset), stream current position is 0. if (maxCheckStartPosition == NULL), the handler can try to search archive start in stream if (*maxCheckStartPosition == 0), the handler must check only current position as archive start
IInArchive::Extract: indices must be sorted numItems = (UInt32)(Int32)-1 = 0xFFFFFFFF means "all files" testMode != 0 means "test files without writing to outStream"
IInArchive::GetArchiveProperty: kpidOffset - start offset of archive. VT_EMPTY : means offset = 0. VT_UI4, VT_UI8, VT_I8 : result offset; negative values is allowed kpidPhySize - size of archive. VT_EMPTY means unknown size. kpidPhySize is allowed to be larger than file size. In that case it must show supposed size.
kpidIsDeleted: kpidIsAltStream: kpidIsAux: kpidINode: must return VARIANT_TRUE (VT_BOOL), if archive can support that property in GetProperty.
Notes: Don't call IInArchive functions for same IInArchive object from different threads simultaneously. Some IInArchive handlers will work incorrectly in that case.
*/
// UTF string (pointer to wchar_t) with zero end and little-endian. #define PROP_DATA_TYPE_wchar_t_PTR_Z_LE ((NPropDataType::kMask_Utf | NPropDataType::kMask_ZeroEnd) + (sizeof(wchar_t) >> 1))
/* GetRawProp: Result: S_OK - even if property is not set
*/
/* Flags: 0 - opens archive with IInStream, if IInStream interface is supported - if phySize is not available, it doesn't try to make full parse to get phySize kOpenFlags_NoSeek - ArcOpen2 function doesn't use IInStream interface, even if it's available kOpenFlags_RealPhySize - the handler will try to get PhySize, even if it requires full decompression for file if handler is not allowed to use IInStream and the flag kOpenFlags_RealPhySize is not specified, the handler can return S_OK, but it doesn't check even Signature. So next Extract can be called for that sequential stream.
*/
/* GetUpdateItemInfo outs: *newData *newProps 0 0 - Copy data and properties from archive 0 1 - Copy data from archive, request new properties 1 0 - that combination is unused now 1 1 - Request new data and new properties. It can be used even for folders
indexInArchive = -1 if there is no item in archive, or if it doesn't matter.
GetStream out: Result: S_OK: (*inStream == NULL) - only for directories - the bug was fixed in 9.33: (*Stream == NULL) was in case of anti-file (*inStream != NULL) - for any file, even for empty file or anti-file S_FALSE - skip that file (don't add item to archive) - (client code can't open stream of that file by some reason) (*inStream == NULL)
The order of calling for hard links: - GetStream() - GetProperty(kpidHardLink)
outStream: output stream. (the handler) MUST support the case when Seek position in outStream is not ZERO. but the caller calls with empty outStream and seek position is ZERO?? archives with stub:
If archive is open and the handler and (Offset > 0), then the handler knows about stub size. UpdateItems(): 1) the handler MUST copy that stub to outStream 2) the caller MUST NOT copy the stub to outStream, if "rsfx" property is set with SetProperties
the handler must support the case where ISequentialOutStream *outStream
*/
/* Exe handler: the handler for executable format (PE, ELF, Mach-O). SFX archive: executable stub + some tail data. before 9.31: exe handler didn't parse SFX archives as executable format.
for 9.31+: exe handler parses SFX archives as executable format, only if AllowTail(1) was called */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.