Initializes KAV Engine: checks license validity, sets path to the anti-virus database, sets scanner host type, indicates the anti-virus database part not to load, sets the number of scanning threads, and so on.
This function is declared in kave8_dll_loader.h and implemented in kave8_dll_loader.cpp.
The kaveInitializeEx function must be called before any other KAV SDK functions, except for the kaveLoad function.
The application must call the kaveUninitialize function after it finishes working with the SDK interface.
When initializing the KAV SDK on a Windows platform, the installation of the klbg boot guard driver is validated and, if necessary, the driver registration within the operating system gets automatically updated. Re-registering is performed by updating the system registry. After the updated anti-virus database is retrieved, the KAV SDK compares the key value within the system registry with the data within the database. If the current registry value does not match the driver dump value within the database, the KAV SDK overwrites the registry key with the new value as contained in anti-virus database.
The driver update is performed only if you have an already installed copy of the klbg driver. The driver can be installed using the udinstaller32(64) utility (see section "Drivers"). If the driver has not been installed using this utility prior to updating the anti-virus database, the update is not performed even if the newer version of this driver has been retrieved by the KAV SDK with the updated database.
Scanner host types and options
The KAV scanner can be run as a separate process or from inside the application. The dwScannerHostType parameter defines the scanner host type; it is specified during SDK initialization. For detailed information about KAV SDK initializing flags, which can be specified in the dwScannerHostType parameter, refer to section "Initialization flags".
Syntax
HRESULT kaveInitializeEx (
const char *pTempFolder,
const char *pDatabasesPath,
unsigned long dwScannerHostType,
unsigned long dwOutprocScannersCount,
unsigned long dwScanningThreadsCount,
unsigned long dwQueueLength,
PFNCALLBACK pfnUserCallback,
const char *pLicensingFolder,
int nLicensingMode);
Parameters
The kaveInitializeEx function has the following parameters.
kaveInitializeEx function parameters
Name |
Type |
Description |
|---|---|---|
|
in |
A pointer to a string containing the path to a folder where, if necessary, temporary files will be created. The folder is used, for example, for unpacking archives while scanning. Make sure that permissions assigned to the specified temporary folder grant the execution rights to the user account used to run the process that integrates KAV SDK components. If this parameter is This setting can be changed later by using the |
|
in |
A pointer to a string that contains the path to the anti-virus database. If this parameter is |
|
in |
One of the host scanner types that can be combined with one or two anti-virus database loading options. For possible values, see table "Scanner host types" in section "Initialization flags". |
|
in |
Windows platforms
Unix-like platforms
Both platforms The maximum permissible number of scanning processes is Note that in out-of-process mode ( |
|
in |
The maximum number of simultaneously running scanning threads. If this parameter is set to The scanning threads are distributed among scanning processes, number of which is specified by the If The maximum permissible number of scanning threads is |
|
in |
The maximum length of the scanning task queue. The queue is used in asynchronous scanning. All the scanning processes take the scanning tasks from a single queue. If you set the To organize an infinite queue, set The length can be changed later by calling the |
|
in |
A pointer to the callback function. This function is called if one of the callback events occurs, for example, malware is detected, or an error occurs, or inquiry on disinfection is needed, or the user must be notified about scan completion, and so on. |
|
in |
A pointer to the folder where the application ID file (appinfo.kli) and license key files are stored. If this parameter is For more information about license key files, appinfo.kli file, and licensing modes, see section "Licensing". |
|
in |
The licensing mode. If this parameter is If this parameter is not For more information about licensing modes, see section "Licensing". |
Return value
The table below contains possible values that the kaveInitializeEx function can return.
kaveInitializeEx function return codes
Return code |
Description |
|---|---|
|
The function succeeds and the anti-virus database is valid. |
|
The function succeeds, but the anti-virus database is corrupted and cannot be used. |
|
|
Do not remove the default web page template files from the /bin/loc/common directory. Missing template files cause KAV SDK initialization process to fail with KAV_E_MOD_NOT_FOUND error.