Initialization flags

This section describes flags which are set in dwScannerHostType parameter of KAV SDK initializing functions: kaveInitialize, kaveInitializeEx, and kaveInitializeService. The flags are intended to specify the scanner host type, enable the necessary antimalware engines, and specify the KAV SDK overall settings.

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. The table below describes possible host type values.

Scanner host types

Scanner host type

Description

KAV_SHT_INPROC

Scanner is placed in the current process.

KAV_SHT_OUTPROC

Scanner is placed in the separate process.

KAV_SHT_SERVICE

Scanner is placed in the service.

For additional information on the service mode, see sections "Organizing service mode in Windows" and "Organizing service mode in Linux".

In addition to the scanner host type, there is an option to load necessary types of the anti-virus engines.

Adding a special flag to the dwScannerHostType parameter value enables loading the corresponding type of the anti-virus engine. The table below lists possible flags.

Anti-virus database loading options

Scanner host type

Description

KAV_SHT_ENGINE_KLAV

A bit flag that enables loading new (KLAV) main anti-virus engine.

It can be combined with any scanner host type listed in the table above.

If you set this flag, there is no need to specify the KAV_SHT_ENGINE_KLAVEMU flag. Enabling the KLAV Engine automatically turns on the KLAV emulator.

KAV_SHT_ENGINE_KLAVEMU

A bit flag that enables loading advanced heuristic anti-virus engine (KLAV emulator).

You should add this flag if you are going to use advanced heuristic scanning mode. For more information about scanning modes, see section "Scanning modes".

There is no need to specify the KAV_SHT_ENGINE_KLAVEMU flag if the KAV_SHT_ENGINE_KLAV has already been specified. Enabling the KLAV Engine automatically turns on the KLAV emulator.

The flag can be combined with any scanner host type listed in the table above.

KAV_SHT_ENGINE_WMUF

Enables WMUF Filtering component.

The component uses WMUF database. Must be used together with one of or all the other host type flags.

For example, if the following mask is specified for the dwScannerHostType parameter

KAV_SHT_INPROC|KAV_SHT_ENGINE_WMUF

the in-process hosting is used for the kavehost.exe and the WMUF database is used for scanning.

KAV_SHT_ENGINE_KSN

A bit flag that enables usage of the Cloud Protection to check reputation of files and URLs.

Please note, that to enable reputation checking of URLs the KAV_SHT_ENGINE_WMUF and KAV_SHT_ENGINE_KSN flags should be set.

To enable reputation checking of files the KAV_SHT_ENGINE_KSN is enough.

KAV_SHT_ENGINE_STATISTIC

A bit flag that enables KAV SDK to submit statistical information to KSN (see section "Using Cloud protection").

The flag can be combined with any scanner host type listed in the table above.

Please note that this flag is not supported in 64-bit native versions of KAV SDK.

KAV_SHT_NO_IDLE_SWAP

A bit flag that forces the KAV SDK to not swap its processes with embedded KAV Engine out of RAM when the KAV Engine is idle. When this bit flag is specified, the SDK does not save the KAV Engine into paging even if it has been detected that the Engine is idle and does not process any task.

KAV_SHT_AVBASES_SWAP

A bit flag that enables the KAV Engine to quickly reload the anti-virus database by loading the database using permanent mapped files.

Specifying this flag in the kaveIntializeEx function allows you to significantly reduce memory consumption when running the KAV Engine.

 

Please note, that this flag is not applicable for 64-bit native versions of KAV SDK.

KAV_SHT_AVBASES_REPLACEABLE_ON

A bit flag that forces the SDK to load the databases into the memory, so that KAV Engine does not read data from the database files on the HDD when scanning or another operation is performed.

In KAV SDK for Linux, this flag is used by default.

In KAV SDK for Windows, you must use this flag if the KAV SDK databases are copied without using Updater SDK.

KAV_SHT_AVBASES_REPLACEABLE_OFF

A bit flag that forces the SDK to load only a part of the databases into the memory, so that KAV Engine reads data from the database files on the HDD when scanning or another operation is performed. Using this flag can reduce the amount of the memory used by the SDK.

In KAV SDK for Linux, you can use this flag if new databases are loaded only when KAV SDK is initialized, and they are not reloaded automatically.

In KAV SDK for Windows, this flag is used by default.

If neither of the flags listed in the anti-virus database loading options table above is added to the dwScannerHostType parameter value, the KAV_SHT_ENGINE_KLAV flag will be used by default.

Page top