Callback function return values

The values returned by the callback function are used by the scanning or monitor function that has called it. For example, if the scanning function has the KAV_REQUEST cleaning mode, then, if malware is detected, the callback function asks the user for a decision. If the user wants to delete the infected object, the return value of the callback function should be CLBK_DELETE_OBJECT, and the KAV SDK will delete the indicated object if this is possible.

The possible callback function return values are listed in the table below.

Callback function return values

Return code

Description

CLBK_OK

Continue processing of the current object.

When Proactive Defense Monitor (PDM) is active, the started application will be allowed to run if the user application returns the CLBK_OK code from the callback function to the PDM.

If the scanning function is called with the KAV_REQUEST cleaning mode, this return value is equivalent to the CLBK_CLEAN_OBJECT code, in other words the engine will try to disinfect the current object.

If the function is called with the EVENT_BACKUP event, this value certifies that the object has been successfully added to the backup storage.

CLBK_CANCEL_OBJECT

Cancel processing of the current object which is a part of a compound object (for example, the file from an archive) in case the function has been called with one of the following events:

  • EVENT_INPROGRESS
  • EVENT_DETECT
  • EVENT_SUSPECTED
  • EVENT_DISINFECTED
  • EVENT_DELETE_ARCHIVE.

    Do not add current object to the backup storage in case the function is called with the EVENT_BACKUP event.

    If the function has been called with another callback event, returning this value is equal to returning CLBK_CANCEL_ALL.

    When scanning files or messages in a container file such as a DBX file (Outlook Express E-Mail Folder) or an archive file with the KAV_CLEAN_DELETE or KAV_DELETE mode enabled, the whole the container file will be removed if disinfection of an embedded file (for example, an attachment within a message contained in the DBX file or an infected archived file) is impossible.

    If you return the CLBK_CANCEL_OBJECT to KAV Engine on the EVENT_DELETE_ARCHIVE event raised, scanning of entire DBX e-mail folder or the whole archive file is skipped and KAV Engine proceeds the next scanning task. No other attachments or e-mail messages contained in the scanned DBX file or ether archived files in the scanned archive is scanned by KAV Engine.

    After you answer with the CLBK_CANCEL_OBJECT to the callback message received with the EVENT_DELETE_ARCHIVE event when scanning containers in the KAV_CLEAN_DELETE or KAV_DELETE modes, KAV Engine stops processing the current tasks (scanning of entire container file). For both modes CLBK_CANCEL_OBJECT is handled same way as CLBK_CANCEL_ALL callback return value.

    When returned to the EVENT_SSL_BAD_CERTIFICATE code, Web Monitor component rejects the digital certificate provided by the remote host and blocks the application from establishing the connection.

CLBK_CANCEL_ALL

Cancel processing of an object which is the parent of the current object (for example, the whole archive).

Skip deleting infected compound object when the EVENT_DELETE_ARCHIVE event appears.

Do not add current object to the backup storage if the function is called with the EVENT_BACKUP event.

CLBK_CLEAN_DELETE_OBJECT

Disinfect the current object, delete if disinfection is impossible.

There is a sense to return this value only when the scanning function is called with the KAV_REQUEST cleaning mode.

CLBK_CLEAN_OBJECT

Disinfect the current object.

There is a sense to return this value only when the scanning function is called with the KAV_REQUEST cleaning mode.

CLBK_DELETE_OBJECT

Delete the current object.

There is a sense to return this value only when the scanning function is called with the KAV_REQUEST cleaning mode.

CLBK_GETPID

Obtain process ID data.

Web Monitor will obtain identifier of the process that requested a malicious URL.

This code can be returned to Web Monitor when this component detects a malicious web address in the scanned traffic.

CLBK_MORE_BYTES

This value is used only in case the function was called with the EVENT_FIRSTBYTES event, and there is a need to retrieve next portion of object data.

The specified number of next bytes will be written to the KAV_FIRSTBYTES structure and the callback function will be called again with the corresponding parameters.

CLBK_DENY

The Proactive Defense Monitor should block the suspicious action.

There is a sense to return this value only for the Proactive Defense Monitor events. For more information about such events, see section "Proactive Defense events".

CLBK_TERMINATE

The Proactive Defense Monitor should terminate the suspicious process.

There is a sense to return this value only for the Proactive Defense Monitor events. For more information about such events, see section "Proactive Defense events".

CLBK_ROLLBACK

The Proactive Defense Monitor should roll malware activity back cleaning all the malware activity traces.

There is a sense to return this value only for the Proactive Defense Monitor events. For more information about such events, see section "Proactive Defense events".

CLBK_REBOOT

The KAV Engine should forcibly restart the operating system and reboot the computer.

This code may be returned upon the completion of the Advanced Disinfection procedure when the EVENT_REBOOTNEEDED event is received from the KAV Engine with dwParam1 set to KRT_REQUIRED.

CLBK_USE_PROXY

KAV SDK should establish connection to the Cloud using proxy server and the specified connection settings.

CLBK_GET_OBJECT_HASH

Return MD5 hash sum for the dwObjectID passed from KAV SDK in callback handler.

This code must be used when you want KAV SDK to obtain a MD5 footprint for the scanned object with detected threat, see section "Obtaining MD5 hash sums".

The MD5 hash is returned in an instance of KAV_OBJECT_HASH.

CLBK_USE_INVALID_CERT

Accept the expired or not-yet-valid digital certificate and allow the application to connect to the remote host.

Page top