kaveCheckUrl

Checks a URL against the Web Malicious URL Filter (WMUF) database, when KAV_SHT_ENGINE_WMUF flag is set during the initialization of KAV SDK, and additionally checks URL reputation via KSN, when both KAV_SHT_ENGINE_WMUF and KAV_SHT_ENGINE_KSN flags are set.

Starting from version 8.1.x.x, KAV SDK supports volume anti-malware database storage where malware definition files and anti-malware components used in KAV SDK are stored in a dedicated component storage database (CSD). Unlike the obsolete component, storage scheme deemed flat storage, where you have all your updated files stored as separate files, volume storage allows components and anti-malware definition files be put in a single log0 file known as CSD database.

When CSD is used, components and definition files are placed to the log0 database file during update procedure performed by external API provided by Updater SDK or separate keepup2date8 command line tool used for updating and shipped with Updater SDK.

Updater SDK, the keepup2date8 tool, and related documentation are delivered in a separate package but can be used together with KAV SDK.

The kaveCheckUrl function in KAV SDK version 8.3.x.x and later requires that the CSD volume storage is used. Enable CSD mode when updating your malware database with Updater SDK and keepup2date8 tool by setting DoNotUseStorage configuration option to 0. See documentation shipped with Updater SDK for details.

Make sure you do not use volume and flat storage simultaneously. When upgrading to KAV SDK version 8.3.x.x or later, always perform fresh malware database update. Always remove existing flat database storage before starting to use the kaveCheckUrl function in KAV SDK version 8.3.x.x and later. When flat database is removed, enable the CSD storage for kaveCheckUrl and start database update.

When malware database update is started, Updater API in Updater SDK or keepup2date8 creates the CSD volume storage and stores libraries used by the following components to the CSD volume log0 storage database:

Libraries used by other KAV SDK components will be stored in a flat view.

The function allows you to lookup the WMUF database to see if the provided URL matches records in the database. If matching is found, opening this URL by the end user or external program will be blocked by the Web Monitor.

Note that Unicode web addresses, such as URLs in Internationalized Domain Names in Applications (IDNA) format, are stored within the WMUF database using Punycode encoding. The Punycode is an encoding syntax used to represent an Unicode string as a standard ASCII-character string. Such a syntax allows overcoming restrictions applied in practice (but not defined in the RFC 2181) to Domain Name System (DNS), where all domain names are stored as ASCII strings within the DNS database.

For example, a URL such as касперскийтест.ru, containing characters from Cyrillic alphabet, will be stored in the WMUF database as a Punycode-encoded string xn--80akalfcc2bkhdelc.ru. Note that this particular URL address is fictitious and any similarity to this name and address used by an actual business enterprise is entirely coincidental. For more details on the Punycode, please refer to RFC 3492.

If you need to check URL addresses in IDNA format by the WMUF database, please first transform them to Punycode-formatted strings before passing these strings to kaveCheckUrl in the pURL parameter. Such a transform feature is not provided by KAV SDK and must be implemented by your application.

To cancel scanning of a URL, return CLBK_CANCEL_OBJECT to the callback function as a response to the EVENT_PREDETECT event returned from the SDK when scanning a URL. Returning CLBK_CANCEL_ALL is equal to returning CLBK_CANCEL_OBJECT.

For more information about the WMUF database, see section "About WMUF database".

Syntax

HRESULT kaveCheckUrl (

  const wchar_t *pUrl,

  unsigned long dwScanPriority,

  void  *pUserContext,

  unsigned long *pdwObjectID,

  KAV_RESULT  *pResult);

Parameters

Members of kaveCheckUrl

Name

Type

Description

pUrl

in

A pointer to a string with the URL to look up in the WMUF database.

dwScanPriority

in

URL scanning task priority.

pUserContext

in

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

Its value can be NULL.

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.

pResult

out

A pointer to a variable that describes the scan result. If the value of this parameter is not NULL, the function will be called synchronously—the function does not return until the scan is completed. The scan result will be stored to the pResult variable.

If the value of this parameter 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

If the kaveCheckUrl function succeeds, the return value is S_OK, otherwise a system error code is returned such as E_INVALIDARG.

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

When function succeeds, and the EVENT_RESULT event code is returned to the dwEvent parameter of your callback handler, KAV Engine assigns one of the following scan results to the dwParam1 callback parameter:

For detailed description of these scan results, see section "Scan results".

Page top