Packet Sniffer SDK DLL Edition

HNQueue :: Methods :: QueAllocItems

 Previous Next

Allocates memory for queue items and creates queue synchronization objects.

Syntax:

DWORD __stdcall QueAllocItems(HANDLE hQue);

Parameters:

hQue

[in] HNQueue object handle.

Return values:

HNERR_OKNo errors.
HNERR_MEM_ALLOC_ERRORThis error may occur in case of ItemsCount or QueGetMaxPacketSize properties are equal to 0, or in case of insufficient system resources.
HNERR_CREATE_SYNCOBJ_ERRQueue synchronization object creation error.

Description:

Use this function to allocate memory for queue items and create queue synchronization objects. If this function succeeds, HNPacket and queue synchronization objects will be created.

Queue synchronization objects are used for packets extraction and enqueuing. Please see QueGetFreeItem, QueGetFullItem, QueReturnFreeItem, and QueReturnFullItem functions.

AllocatedSize [Get] property will contain total size of the memory allocated for query in bytes.

FreeCount [Get] and FullCount [Get] properties will contain total amounts of the queue items with Free and Full statuses correspondingly.

All queue items will be placed into the free packets list (may be accessed by the QueGetFreeItem function).

To leave system resources allocated by QueAllocItems use QueFreeItems function.

If you use HNQueue object together with HNAdapter object, you should remember that you have to free queue resources in time by using of QueFreeItems function or by deleting HNQueue object, otherwise your application may crash (see AdpCloseAdapter).
See also:HNQueue, ItemsCount, QueGetMaxPacketSize, QueGetAllocatedSize, QueGetFreeItem, QueGetFullItem, QueReturnFreeItem, QueReturnFullItem, QueFreeItems, AdpCloseAdapter