This function is called by UnRAR.dll library to process different UnRAR events listed below. You can specify the address of this function either in RAROpenArchiveEx (preferable) or in RARSetCallback (obsolete)
The function will be passed four parameters:
Event type. Possible values:
- UCM_CHANGEVOLUME
Process volume change.
P1 points to the zero terminated name of the next volume.
P2 defines the function call mode.
RAR_VOL_ASK Required volume is absent. The function should prompt user and return zero or positive value to retry or return -1 value to terminate operation. The function may also specify a new volume name, placing it to the address specified by P1 parameter. RAR_VOL_NOTIFY Required volume is successfully opened. This is a notification call and volume name modification is not allowed. The function should return zero or positive value to continue or -1 to terminate operation. - UCM_PROCESSDATA
Process unpacked data. It can be used to read a file from memory, while it is being extracted or tested. If you use this event while testing a file, then it makes possible to read file data without extracting file to disk.
Return zero or a positive value to continue process or -1 to cancel the archive operation.
P1 contains the address pointing to the unpacked data. Callback function can read the data but must not modify it.
P2 contains the size of the unpacked data. It is guaranteed that this size will not exceed the maximum dictionary size (4 Mb in RAR 3.0).
- UCM_NEEDPASSWORD
DLL needs a password to process archive. This message must be processed if you wish to be able to handle encrypted archives.
Return zero or a positive value to continue process or -1 to cancel the archive operation.
P1 contains the address pointing to the buffer for a password in single byte encoding. You need to copy a password here.
P2 contains the size of password buffer.
User defined value passed to RARSetCallback. You can specify it, when defining the callback function in RAROpenArchiveEx or RARSetCallback
Event dependent parameters. Read msg description above for detailed information.
In general returning -1 means canceling the operation and returning zero or positive value continues processing. But please also read event descriptions above just in case we'll add some exceptions from this rule.
Other UnRAR.dll functions must not be called from the callback function.