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

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
remittor
Junior Member
Junior Member
Posts: 49
Joined: 2019-10-02, 07:18 UTC

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

Post 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
Last edited by remittor on 2019-11-13, 07:53 UTC, edited 1 time in total.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50856
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

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

Post 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.
Author of Total Commander
https://www.ghisler.com
remittor
Junior Member
Junior Member
Posts: 49
Joined: 2019-10-02, 07:18 UTC

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

Post 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!
Post Reply