[WCX] Add new API-functions for faster file extraction
Posted: 2019-11-12, 10:17 UTC
Now TotalCmd fully reads internal archive cache for extraction one file. And it is not very efficient.
It is necessary to make the WCX-plugin immediately understand which file is asked to unpack it.
See also: https://www.ghisler.ch/board/viewtopic.php?f=14&t=54681&p=362431#p362431
It is necessary to make the WCX-plugin immediately understand which file is asked to unpack it.
Code: Select all
#pragma pack(push, 1)
const int AdditionalDataSize = 64;
struct TArcElemInfo {
UINT64 PackSize; /* Packed file size */
UINT64 UnpSize; /* Unpacked file size */
int FileAttr;
FILETIME CreationTime; /* birthtime, Win32 format, GMT+0 */
FILETIME LastWriteTime; /* mtime, Win32 format, GMT+0 */
FILETIME LastAccessTime; /* atime, Win32 format, GMT+0 */
BYTE AdditionalData[AdditionalDataSize];
};
struct TArchiveElem {
TArcElemInfo ElemInfo;
WCHAR FileName[5000]; /* like as Unix filename limit */
};
#pragma pack(pop)
Code: Select all
/* Function GetArchiveElemW should be called instead ReadHeaderExW. */
int __stdcall GetArchiveElemW (HANDLE hArcData, TArchiveElem * elem);
/* Function ExtractElemW should be called instead ProcessFile. */
/* Flag PK_SKIP not needed, because */
/* WCX-plugin should find the element in the archive by AdditionalData info. */
int __stdcall ExtractElemW (HANDLE hArcData, int Operation, const WCHAR * DestName, const TArcElemInfo * ElemInfo);