Packet Sniffer SDK DLL Edition

HNFileAdapter :: Methods :: FAdpCloseFile

 Previous Next

Close the CAP file.

Syntax:

DWORD __stdcall FAdpCloseFile(HANDLE hFAdp);

Parameters:

hFAdp

[in] HNFileAdapter object handle.

Return values:

HNERR_OKCAP file has been closed successfully.
HNERR_INVALID_HANDLEhFAdp parameter is not the HNFileAdapter object handle.

Description:

Use FAdpCloseFile function to close CAP file opened/created by FAdpOpenFile/FAdpCreateFile functions.

The function releases OS resources allocated for work with CAP file and stops HNFileAdapter internal threads.

While processing traffic by HNQueue component (see Queue [Get/Set]) you should remember that HNQueue object can be deleted only after FAdpCloseFile function call, otherwise an early HNQueue object deletion will lead to the application crash.
See also:HNFileAdapter, FAdpOpenFile, FAdpCreateFile, HNQueue, FAdpGetQueue, FAdpSetQueue