kaveGetVirusList

Retrieves a list of detectable objects (such as malicious software, archives, packed and crypted files) that are stored in the anti-virus database.

To retrieve the list:

  1. Call the kaveGetVirusList function with a custom callback function.

    The custom callback function is specified as a parameter of the kaveGetVirusList function.

    Make sure that the custom callback function is based on the provided prototype (see section "Callback function prototype").

  2. KAV SDK calls the callback function specified in the previous step with the EVENT_RECORD_NAME event code passed in the dwEvent parameter.

    The following information is passed to the callback function by KAV Engine:

    • The name of detected malware, archiver, EXE-packer, or file cryptor

      The name is passed in the pVirusName parameter of the callback function.

    • The type of detected malware

      The type is passed in the dwParam1 parameter of the callback function.

    • Severity level of detectable object

      The severity level is passed in the dwParam2 parameter of the callback function.

      For more information, see section "Detection types and severity".

    All other parameters of the callback function are not used.

    This step is performed until there are no detectable object names left, or the callback function returns CLBK_CANCEL_ALL to stop retrieving the list of malware.

  3. The kaveGetVirusList function returns.

For more information about callback function and callback events, see section "Callback function".

The following information is specific to using the kaveGetVirusList function on Linux platforms. Each time the kaveGetVirusList function is invoked, a new instance of KAV Engine is started. If KAV Engine has been already initialized by the time you invoke kaveGetVirusList, the newly started instance of KAV Engine will load the anti-virus database files from the folder specified for that first instance of KAV Engine. In other words, even if you pass an alternate location of the anti-virus database in the value referenced by the pDatabasesPath parameter of kaveGetVirusList, the function retrieves the list of detectable objects contained in the instance of the anti-virus database, which has been specified in the pDatabasesPath parameter of the kaveInitializeEx function. The alternate path specified in the kaveGetVirusList will be ignored and the anti-virus database located under this path will not be used in this query.

The same engine is as when the SDK is initialized with the KAV_SHT_ENGINE_KLAV option. This flag is added by default to the dwScannerHostType parameter of the initialization function, but may be absent if you explicitly omitted it. For more information about initialization functions, see kaveInitializeEx.

The size of the list of detected objects may not match the number of records in the anti-virus database.

Syntax

HRESULT kaveGetVirusList (

const char *pDatabasesPath,

PFNCALLBACK *pfnUserCallback);

Parameters

The kaveGetVirusList function has the following parameters.

kaveGetVirusList function parameters

Name

Type

Description

pDatabasesPath

in

A pointer to a string containing the path to the anti-virus database (used while calling the kaveInitialize or kaveInitializeEx function).

If this parameter is NULL, the anti-virus database is loaded from the default folder %SDK_folder%/bases.

pfnUserCallback

in

A pointer to the callback function. This function is called with the EVENT_RECORD_NAME event and should process the parameters containing information about detectable objects.

The format of the callback function passed in this parameter should match the format of the callback function already used by the KAV SDK.

 

No KAV SDK function must be called from the callback function passed in this parameter.

Return value

If the kaveGetVirusList function succeeds, the return value is S_OK.

For other return codes, see section "Return codes".

Page top