Packet Sniffer SDK DLL Edition

HNAdapter :: Methods :: AdpCloseAdapter

 Previous Next

Closes the network adapter.

Syntax:

DWORD __stdcall AdpCloseAdapter(HANDLE hAdp);

Parameters:

hAdp

[in] HNAdapter object handle.

Return values:

HNERR_OKNetwork adapter has been closed successfully.
HNERR_INVALID_HANDLEhAdp parameter is not the HNAdapter object handle.

Description:

Use the AdpCloseAdapter function to close the network adapter opened by AdpOpenAdapter.

AdpCloseAdapter function frees the OS resources, provided for the opened network adapter and stops the corresponding thread inside the HNAdapter component.

While processing traffic by HNQueue component (see ReceiveQueue [Get/Set]) you should remember that HNQueue object can be deleted only after calling AdpCloseAdapter, otherwise an early HNQueue object deletion will lead to the application crash.
See also:HNAdapter, AdpOpenAdapter, HNQueue, AdpGetReceiveQueue, AdpSetReceiveQueue