Packet Sniffer SDK DLL Edition

HNAdapter :: Methods :: AdpAsyncSendEx

 Previous Next

Sends a packet asynchronously.

Syntax:

DWORD __stdcall AdpAsyncSendEx(HANDLE hAdp, HANDLE hPkt, DWORD Count, DWORD_PTR Key);

Parameters:

hAdp

[in] HNAdapter object handle.

hPacket

[in] HNPacket object handle.

Count

[in] The number of times this packet must be sent.

Key

[in] A user-defined parameter.

Return values:

HNERR_OKThe packet has been sent successfully.
HNERR_ADAPTER_NOT_OPENEDThe adapter has not been opened, see the AdpOpenAdapter function.
HNERR_COUNT_ERRThe Count parameter value must be greater than 0.
HNERR_SIZE_ERRThe HNPacket.IncPacketSize[Get/Set] property value is greater than the maximum size, see AdpCfgGetMaxPacketSize.
HNERR_ADDR_ERRpPacket has the wrong value (a memory reading error).
HNERR_ADAPTER_REQ_ERRAn internal driver request error.
HNERR_INVALID_HANDLEhAdp parameter is not the HNAdapter object handle.

Description:

After the network adapter has been opened successfully by AdpOpenAdapter, you can send a raw packet directly, without using the OS functions. This packet will be sent asynchronously. Use OnAdpAsyncSend to assure this packet has been sent successfully.

Having created HNPacket object by PktCreate function you can use it to create Raw packet. Note that when using AdpAsyncSendEx function you should set HNPacket.IncPacketSize[Get/Set] property correctly, because this property value is used for sending data through the network adapter.

This function cannot work with devices recognized as atWAN. See HNNetAdapterType.
See also:Packets processing diagram, HNAdapter, HNNetAdapterType, AdpOpenAdapter, AdpCfgGetMaxPacketSize, AdpSyncSend, OnAdpAsyncSend, HNPacket, PktCreate, PktGetIncPacketSize, PktSetIncPacketSize, AdpSyncSendEx