Codex API: Archives

QueryArchive

The QueryArchive function opens an archive and returns basic archive information.

Note This function is provided for backwards compatibility only. Newer applications should use the QueryArchiveFieldLength and QueryArchiveEx functions.

 

LPCTSTR QueryArchive(
    LPCTSTR lpFileName,  // name of file to open
    LPTSTR lpItems,      // points to file names inside archive
    LPTSTR lpPwdItems,   // points to password protected file names inside archive
    LPTSTR lpDateTimes,  // points to dates and times of files inside archive
    LPTSTR lpSizes,      // points to sizes of files inside archive
    LPTSTR lpCompSizes   // points to compressed sizes of files inside archive
);

Parameters

lpFileName

[in] Pointer to a null-terminated string that specifies the full path of the archive to query.

lpItems

[out] Pointer to the buffer that receives the names of all the files inside the archive.

lpPwdItems

[out] Pointer to the buffer that receives the names of all the password protected files inside the archive.

lpDateTimes

[out] Pointer to the buffer that receives the dates and times of all the files inside the archive.
The dates and times are already formatted as strings with textual date and time information.

lpSizes

[out] Pointer to the buffer that receives the original sizes of all the files inside the archive.
For archive types which cannot support this value, expect a return of 0 for each of the files inside the archive. An example to such archive types might be single-file compressors such as GZIP.

lpCompSizes

[out] Pointer to the buffer that receives the compressed sizes of all the files inside the archive.
For archive types which cannot support this value, expect a return of 0 for each of the files inside the archive. An example to such archive types might be solid compressors such as CAB.

Return Values

If the function succeeds, the return value is an empty string.

If the function fails, the returned string contains a textual description of the error that occurred while querying the archive. This error is returned by the plug-in handling the archive.

Remarks

The buffers filled in by this function are formatted as COMMATEXT to facilitate the representation of a collection of items in a single buffer.

Requirements

Windows NT/2000/XP: Requires Windows NT 4.0 SP4 or later.
Windows 95/98/Me:
Requires Windows 98 (or Windows 95 with DCOM 1.2).
Header:
Declared in mCodexAPI.h.
Library:
Use mCodexAPI.dll.

See Also

Codex API Overview, Codex API Functions, LoadPlugIns, COMMATEXT