Expected return codes for callback function

When the scanning or monitoring function calls a callback function with one of the events, it expects that the function will return a consistent callback return value. For example, if the scanning function calls the callback function with the EVENT_RELOAD_DATABASES_STARTED event, there is no sense to return the CLBK_DELETE_OBJECT value, and this value will not be taken into consideration by the engine. There are certain expected return values for each event, and only such values will be processed.

If your callback function returns an event code that does not match a raised event code following table, KAV SDK interprets the code as CLBK_OK. Callback codes that match their specific event notification codes are listed in a table later in this section.

The expected callback function return values for each callback event are listed in the table below. There are also Proactive Defense Monitor events which have their own expected return codes. For more details on these codes, see table "Expected return values for PDM events".

Callback event codes can be classified into the following types:

Handling specific Proactive Defense actions

When the monitoring function calls a callback function with one of the Proactive Defense Monitor events, it expects that the function will return a consistent callback return value. This value depends on the PDM action which is passed to the callback function as the dwParam1 parameter value while the PDM event is written to the dwEvent parameter value.

If the callback function returns a value not listed as expected for the specific event notification code, the KAV SDK handles this value as CLBK_OK return code.

The expected callback function return values for each PDM action received with one of the PDM events are listed in the table below. For expected return codes for callback events raised not for Proactive Defense Monitor, see table "Expected return codes from callback".

The KAV SDK library does NOT notify you when it completes to handle the code returned by your application in a response to the PDM action received in the callback with a particular PDM event.

Expected return values for PDM events

PDM action

Expected return code

PDM_ACTION_DETECT

  • CLBK_TERMINATE—try to terminate suspicious process.
  • CLBK_DELETE_OBJECT—terminate malicious process and delete its image, then revert changes made to your system by detected malware and remove the leftovers of malicious activity.

    To remove traces left by malicious activity and revert malicious changes, KAV SDK requests rollback of malware actions by calling your callback function with dwParam1 set to PDM_ACTION_ROLLBACK.

  • CLBK_OK—allow suspicious activity.

PDM_ACTION_DETECT_DENIABLE

  • CLBK_DENY—prevent suspicious activity

    KAV SDK returns in response one of the following constants.

    PDM_ACTION_DENY_SUCCEEDED—KAV SDK successfully prevented activity of the application intercepted by PDM.

    PDM_ACTION_DENY_FAILED—KAV SDK could not prevent activity.

    Return CLBK_OK when these constants are received.

  • CLBK_OK—allow suspicious activity.

PDM_ACTION_ROLLBACK

  • CLBK_ROLLBACK—try to perform a rollback operation.
  • CLBK_OK—allow suspicious activity.

PDM_ACTION_DENY_SUCCEEDED

PDM_ACTION_DENY_FAILED

PDM_ACTION_ROLLBACK_SUCCEEDED

PDM_ACTION_ROLLBACK_FAILED

PDM_ACTION_PROCESS_TERMINATED

PDM_ACTION_TERMINATE_FAILED

PDM_ACTION_UNKNOWN

  • CLBK_OK—continue processing of the current object.

For more information about the PDM actions, see section "Proactive Defense actions". For more information about the PDM events, see section "Proactive Defense events".

Page top