kaveScanStream

Scans an IStream objects.

Each IStream object has its own internal state. This state is changed each time a caller thread calls the kaveScanStream function against the specific IStream object. Invoking the kaveScanStream function with the same value of pIStream from several caller threads may result in abnormal behavior. Avoid concurrent scanning of the same IStream object from different threads of your application.

Please note that on Windows this function takes an object provided by IStream system interface.

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

Syntax

HRESULT kaveScanStream (

  IStream   *pIStream,

  unsigned long dwScanPriority,

  unsigned long dwScanningMode,

  unsigned long dwCleaningMode,

  unsigned long dwScanTimeout,

  void   *pUserContext,

  unsigned long *pdwObjectID,

  KAV_RESULT  *pResult);

Parameters

The kaveScanStream function has the following parameters.

kaveScanStream function parameters

Name

Type

Description

pIStream

in

A pointer to an IStream instance—the object to scan.

When working on a Windows platform, functionality is provided by functions declared in the IStream interface.

On a UNIX-like platform you can use a custom IStream interface provided in the %SDK_folder%\include\stdafx\stdafx_istream.h header file.

dwScanPriority

in

A priority level for scanning the indicated stream. 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 the value of this variable is not NULL, 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 the value of this variable is NULL, 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

In case the kaveScanStream function succeeds, its return value is S_OK. For information on other return codes, see section "Return codes".

Page top