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);