Callback function is a function implemented to enable the application to react on certain events raised during the KAV SDK run. Without callback functions, the results of asynchronous scanning or monitoring are not available.
Callback function is created basing on the prototype described in detail in section "Callback function prototype". It gets callback events and other important information as argument values and then behaves as intended for the given parameters combination.
Callback function should be defined and registered during the KAV SDK initialization stage—the kaveInitializeEx and kaveInitialize functions get a pointer to the callback function as one of the parameters. In such a way the SDK recognizes the function to call if a malware is detected or other callback event occurs while scanning or monitoring. This allows the application to process the event and, for example, notify the system administrator, or perform any other action.
Callback functions are also useful when retrieving some information from the SDK. For example, the kaveGetVirusList function also uses the callback function to obtain a list of detectable objects. The details on these objects are passed in certain callback function arguments when the function is called with the corresponding event.
The application can use more than one callback function. The callback function specified on the SDK initialization stage is considered as default and used for processing on demand scanning tasks and those monitors that are loaded without specifying any particular callback function. You can also specify separate callback functions for every loaded monitor.
After the callback function completes processing, it returns one of the special return codes that are utilized by the calling scan or monitor function. For more information about callback function return codes, see section "Callback function return values".
Access to malware from the callback function using the KAV SDK is not tracked.