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. When checking the license validity, the SDK engine will first look for the application ID file (appinfo.kli) and the license keys in the folder with the application executable file, then in the folder with the kave8.dll library.
If the QSCAN cleanup functionality is turned on and the QSCAN component is missing from the set of files comprising the anti-virus database, KAV SDK returns the KAV_E_MOD_NOT_FOUND error on the initialization stage. For more information about turning on the QSCAN cleanup funcitonality, see section "Turning on QSCAN Cleanup".
Using this function is not recommended. Use the kaveInitializeEx function instead. For more information, please appeal to your Technical Account Manager.
This function is declared in kave8_dll_loader.h and implemented in kave8_dll_loader.cpp.
The kaveInitialize 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 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, 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, KAV SDK overwrites the registry key with the new value as contained in the 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 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 kaveInitialize (
const char *pTempFolder,
const char *pDatabasesPath,
unsigned long dwScannerHostType,
unsigned long dwOutprocScannersCount,
unsigned long dwScanningThreadsCount,
unsigned long dwQueueLength,
PFNCALLBACK pfnUserCallback);
Parameters
The kaveInitialize function has the following parameters.
kaveInitialize 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. |
Return value
The table below contains possible values that the kaveInitialize function can return.
kaveInitialize 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. |
|
|
Note that in Windows initializing with large number of scanner processes consumes considerable time and memory resources. On minimal hardware and software configuration initializing with 32 scanner processes can fail.
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.