Scanning

After the KAV SDK is successfully initialized, all other functions can be invoked. These are scanning and monitoring functions providing principal SDK functionality, and also various service functions giving more opportunities for developers.

For detailed descriptions of functions and their parameters, see section "KAV SDK API Reference".

Handling long names at scanning

Some scanned files, archives, embedded objects or other types of file objects may have extra long names. Packed files such as archives may have high nesting levels. Such files are unpacked at scanning, which may result in long paths to the extracted file that exceed file system limits for long names.

When KAV SDK invokes your callback, it strips down on the right long file names (pointed by pObjectName) and long names of threats (pointed by pVirusName) found in scanned files.

The following names are considered long:

If memory allocation for the stripped down strings fails, E_OUTOFMEMORY is returned.

Scanning in gateway configurations

If you implement scanning on gateway computers, it is recommended to use extended scanning functions. Using these functions will facilitate better detection rates on such configurations.

The following extended scanning functions are recommended:

Web and mail gateways are a special case. Extended functions contain a parameter that is a pointer to a KAV_EXTRA_OBJECT_INFO_HTTP object. It is casted KAV_EXTRA_OBJECT_INFO_BASE*. Objects of KAV_EXTRA_OBJECT_INFO_HTTP type contain additional technical data to facilitate scanning of encrypted areas on the basis of the data gathered from HTTP traffic.

When you specify the value of objectUrl member of the KAV_EXTRA_OBJECT_INFO_HTTP data structure, use the following format:

An example for mail gateways:

Example:

exInfo.objectUrl = "[from:test@relay.example]";

hr = kaveScanFileEx(argv[1], &exInfo.baseInfo, 4, dwScanMode, KAV_CLEAN_SKIP, INFINITE, 0, NULL, &Result);

An example for web gateways:

Example:

exInfo.objectUrl = "http://example.com";

hr = kaveScanFileEx(argv[1], &exInfo.baseInfo, 4, dwScanMode, KAV_CLEAN_SKIP, INFINITE, 0, NULL, &Result);

In this section

Scanning functions

Synchronous and asynchronous scanning

Common parameters of scanning functions

Regular file scanning

Memory block scanning

IStream scanning

Using klbscan tool

Page top