kaveScanMemory

Scans a memory block.

When the Cloud Protection is enabled, this function performs additional checking of object reputation via Kaspersky Security Network.

Syntax

HRESULT kaveScanMemory (

  BYTE   *pbyScanMemory,

  DWORD   dwScanMemorySize,

  DWORD   dwScanPriority,

  DWORD   dwScanningMode,

  DWORD   dwCleaningMode,

  DWORD   dwScanTimeout,

  void   *pUserContext,

  DWORD   *pdwObjectID,

  KAV_RESULT *pResult);

Parameters

The kaveScanMemory function has the following parameters.

kaveScanMemory function parameters

Name

Type

Description

pbyScanMemory

in

A pointer to the beginning of the memory block to be scanned.

dwScanMemorySize

in

The size of the indicated memory block.

dwScanPriority

in

A priority level for scanning the indicated memory block. The higher the value is, the higher the priority is.

Priority level is taken into consideration when selecting the objects from the scanning queue. The queue is sorted according to the objects’ priority. The objects with higher priority are scanned first.

dwScanningMode

in

Scanning mode.

The mode can be specified as a mask of scanning options, which defines types of files to be scanned for presence of malware and turns on various scanning technologies such as Advanced Disinfection mechanism.

For example, you may specify the following mask:

dwScanningMode = KAV_O_M_ARCHIVED | KAV_O_M_MAILBASES | KAV_O_M_PACKED | KAV_O_M_MAILPLAIN | KAV_O_M_ADVDIS

This mask enables scanning of memory range containing archived files and packed binaries, mail database and plain mail message files and turns on Advanced Disinfection that triggers when active malware is detected during the scan. For more information, see section "Scanning modes".

In case the user is supposed to decide on the action with an infected object, such action is requested by calling the callback function with the appropriate parameters.

dwCleaningMode

in

A cleaning mode that determines the action to be performed by KAV Engine upon detection of a malware.

For possible parameter values, see section "Cleaning modes".

Regardless of the cleaning mode settings, the KAV SDK reacts to the malware detection event by calling a callback function with the appropriate parameters.

dwScanTimeout

 

The maximum time in milliseconds allotted for performing a scan task. After the specified timeout expires, the scanning is stopped and the function returns with the KAV_E_TIMEOUT error code.

To set no time limit for the scanning task, use the INFINITE value or set it to zero.

pUserContext

in

A pointer to any user data that can be used by a callback function.

pdwObjectID

out

A pointer to the scan task identifier. It helps to distinguish scan tasks and their results in case of asynchronous scanning and monitoring—it is used for accessing the scanning result through a callback function.

The scan task ID can also be used for canceling this particular scanning task. For more information, see kaveCancelScan.

When scanning files via File Monitor, unique identifiers assigned to scanned files by KAV SDK are returned directly to callback function in the dwObjectID parameter. For more details, see section "Callback function prototype".

pResult

out

A pointer to the variable describing the scan result.

If this variable does not have the NULL value, the function is called synchronously—the function does not return until the scan is completed. The scan result will be written to the pResult variable.

If this variable has the NULL value, the function is called asynchronously. In this case the scan result can be obtained only by calling a callback function with the appropriate parameters.

Return value

If the kaveScanMemory function succeeds and no malware is detected, the return value is S_OK.

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

Page top