kaveQBGetIds

Gets the number of objects stored in the backup storage, and their IDs.

The current KAV SDK version does not contain implementation of this function for Linux-based solutions.

Depending on the value of the pqwObjectIds parameter of the function, it performs the following actions:

It is recommended to follow the procedure below to get all the object identifiers:

  1. Get the total number of objects in the backup storage by calling the kaveQBGetIds function with pqwObjectIds set to NULL.
  2. Invoke the kaveQBGetIds function with pqwObjectIds set to a non-zero pointer to a buffer, and *pCount incremented by some constant value.

Syntax

HRESULT kaveQBGetIds (

unsigned long *pCount,

ULONGLONG *pqwObjectIds);

Parameters

The kaveQBGetIds function has the following parameters.

kaveQBGetIds function parameters

Name

Type

Description

pCount

in, out

A pointer to the number of object identifiers that can be stored in buffer.

If pqwObjectIds is NULL, the function sets *pCount to the current total number of objects in the backup storage.

If pqwObjectIds points to a memory buffer, *pCount defines the maximum number of records in the list of object identifiers. You can specify a number greater than the actual number of the stored objects.

If you are going to retrieve the whole list of the identifiers of all objects in the backup storage, provide for possibility of adding objects from another thread and increase *pCount and the capacity of pqwObjectIds.

pqwObjectIds

out

A pointer to the buffer in memory to store the identifiers of the objects in the backup storage.

If you set pqwObjectIds to NULL, the function retrieves the current total number of objects in the backup storage and writes it to *pCount.

To get the identifiers of objects in the backup storage, set pqwObjectIds to a pointer to the memory buffer where the function will write these identifiers. The number of the retrieved identifiers is limited by *pCount.

The buffer must be allocated by the caller before invoking the function. The buffer size in bytes must be greater or equal to sizeof(ULONGLONG)*(*pCount).

If the buffer size is not sufficient to write the requested number of identifiers, the function returns E_INVALIDARG.

Return value

If the kaveQBGetIds function succeeds, its return value is S_OK.

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

Examples

The example below demonstrates the usage of the kaveQBGetIds function according to the described procedure.

Example:

unsigned long Count = 0;

kaveQBGetIds(&Count, NULL); // retrieving the number of objects in backup storage

Count += 100; // allocating buffer with some excess to handle the case when objects are added from another thread

ULONGLONG * pqwObjectIds = new ULONGLONG[Count]; // allocating memory for storing object IDs array

kaveQBGetIds(&Count, pqwObjectIds); //building the object IDs list

Page top