Page 1 of 1

[WCX] Add new API-functions for faster file extraction

Posted: 2019-11-12, 10:17 UTC
by remittor
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.

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);
See also: https://www.ghisler.ch/board/viewtopic.php?f=14&t=54681&p=362431#p362431

Re: [WCX] Add new API-functions for faster file extraction

Posted: 2019-11-12, 20:37 UTC
by ghisler(Author)
TC currently uses functions similar to the UnRAR DLL, which are optimized for archives supporting solid archives which need to be accessed linearly from start to end.

Re: [WCX] Add new API-functions for faster file extraction

Posted: 2019-11-13, 07:41 UTC
by remittor
ghisler(Author) wrote: 2019-11-12, 20:37 UTC TC currently uses functions similar to the UnRAR DLL, which are optimized for archives supporting solid archives which need to be accessed linearly from start to end.
So I did not ask to remove the current functionality. I ask for expanded functionality.

RAR support solid mode as additional option!