int PASCAL RARProcessFile(HANDLE hArcData,int Operation,char *DestPath,char *DestName)

Description

Performs the user defined action and moves the current position in the archive to the next file.

If archive is opened in RAR_OM_EXTRACT mode, this function extracts or tests the current file and sets the archive position to the next file.

If open mode is RAR_OM_LIST, then a call to this function will skip the current file and set the archive position to the next file.

It is recommended to use RARProcessFileW insted of this function, because RARProcessFileW supports Unicode.

Parameters

hArcData
This parameter should contain the archive handle obtained from RAROpenArchive or RAROpenArchiveEx function call.
Operation

File operation.

Possible values

RAR_SKIP Move to the next file in the archive. If archive is solid and RAR_OM_EXTRACT mode was set when the archive was opened, the current file is analyzed and operation is performed slower than a simple seek.
RAR_TEST Test the current file and move to the next file in the archive. If the archive was opened in RAR_OM_LIST mode, the operation is equal to RAR_SKIP.
RAR_EXTRACT Extract the current file and move to the next file in the archive. If the archive was opened with RAR_OM_LIST mode, the operation is equal to RAR_SKIP.
DestPath

This parameter should point to a zero terminated string, containing the destination directory to place the extracted files to. If DestPath is equal to NULL, it means extracting to the current directory. This parameter has meaning only if DestName is NULL.

This parameter must be in OEM encoding. If necessary, use CharToOem to convert text to OEM before passing it as DestPath.

DestName

This parameter should point to a zero terminated string, containing the full path and name to assign to extracted file or it can be NULL to use the default name. If DestName is defined (not NULL), it overrides both the original file name stored in the archive and path specified in DestPath setting.

This parameter must be in OEM encoding. If necessary, use CharToOem to convert text to OEM before passing it as DestName.

Return values

0 Success
ERAR_BAD_DATA File CRC error
ERAR_UNKNOWN_FORMAT Unknown archive format
ERAR_EOPEN Volume open error
ERAR_ECREATE File create error
ERAR_ECLOSE File close error
ERAR_EREAD Read error
ERAR_EWRITE Write error
ERAR_NO_MEMORY Not enough memory
ERAR_EREFERENCE When attempting to unpack a reference record (see RAR -oi switch), source file for this reference was not found. Entire archive needs to be unpacked to properly create file references. This error is returned when attempting to unpack the reference record without its source file.
ERAR_BAD_PASSWORD Entered password is invalid. This code is returned only for archives in RAR 5.0 format

Notes

If you wish to cancel extraction, return -1 when processing UCM_PROCESSDATA message in user defined callback function.