kaveScanMemoryEx

Scans a memory block for malware.

This function allows you to scan a block of memory on the basis of the information obtained from the HTTP protocol data. If you do not provide this information to the function, it will behave in the same way as the kaveScanMemory function.

If you do not have extra detail for the file that may be associated with the memory block you scan, or you want KAV Engine to perform a regular scanning procedure, do either of the following:

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

Syntax

HRESULT kaveScanMemory (

  unsigned char   *pbyScanMemory,

  unsigned long   dwScanMemorySize,

  const KAV_EXTRA_OBJECT_INFO_BASE *pScanMemoryExtraInfo

  unsigned long   dwScanPriority,

  unsigned long   dwScanningMode,

  unsigned long   dwCleaningMode,

  unsigned long   dwScanTimeout,

  void   *pUserContext,

  unsigned long   *pdwObjectID,

  KAV_RESULT   *pResult);

Parameters

The kaveScanMemoryEx function has the following parameters.

kaveScanMemoryEx 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.

pScanMemoryExtraInfo

in

A pointer (casted to KAV_EXTRA_OBJECT_INFO_BASE*) to a KAV_EXTRA_OBJECT_INFO_HTTP object that contains additional technical data to facilitate scanning of encrypted areas on the basis of the data gathered from HTTP traffic.

If you do not have additional information to provide, initialize this pointer to NULL. If you only have some additional information, initialize the data fields of the KAV_EXTRA_OBJECT_INFO_HTTP structure for which you do not have the information, to NULL.

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.

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

An action upon detection 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

in

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 kaveScanMemoryEx function succeeds and no malware is detected, the return value is S_OK.

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

Page top