kaveGetMonitorPorts

Gets the list of ports that are monitored by Web Monitor and Mail Monitor.

This function is available in KAV SDK for Windows platforms.

Syntax

HRESULT kaveGetMonitorPorts (

const unsigned short *ports,

unsigned short *portsCount);

Parameters

The kaveGetMonitorPorts function has the following parameters.

kaveGetMonitorPorts function parameters

Name

Type

Description

ports

In/Out

Buffer for the list of the monitored ports.

If the number of currently monitored ports exceeds the size of ports, after kaveGetMonitorPorts returns this address will contain as many port numbers as fit the buffer size specified in this parameter. You will obtain only a limited set of monitored ports. Increase the ports size to obtain all the port numbers by following steps:

  • Call kaveGetMonitorPorts with ports set to NULL.

    You will know how many ports are currently monitored, the number will be returned in portsCount.

  • Call kaveGetMonitorPorts again and initialize ports to the number obtained from portsCount.

     

    If the specified buffer is larger than the size of the current list of monitored ports, all port numbers in the list are returned.

portsCount

In/Out

Number of ports to obtain from the list of currently monitored ports.

Before the kaveGetMonitorPorts function is called (requesting ports):

  • If you want to get a certain amount of ports, allocate for ports sufficient memory and set portsCount to the size of ports.
  • If you want to learn the total number of monitored ports, set ports to NULL; the value of portsCount will be ignored in this case.

     

    After the kaveGetMonitorPorts function is called (obtaining ports):

  • If ports is not NULL, portsCount will contain the number of monitored ports which are written to ports.
  • If ports is NULL, portsCount will contain the total number of monitored ports.

Return value

The table below describes the possible return values of the kaveGetMonitorPorts function.

kaveGetMonitorPorts function return codes

Return code

Description

S_OK

The function succeeds.

E_INVALIDARG

Zero (0) value passed in portsCount.

S_FALSE

The value contained in portsCount is less than the number of the ports which are monitored by KAV SDK.

E_FAIL

The function failed.

If logging is turned on, an error message is added to the log.

For information about other return values, see section "Return codes".

Page top