The CAP file has not been opened, see the FAdpCreateFile function.
HNERR_ADDR_ERR
pPacket has the wrong value (a memory write error).
HNERR_INCOMPATIBLE_MODE
Incompatible mode of HNFileAdapter. Occurs when HNFileAdapter.AutoMode was set
[Get/Set]),
or if the CAP file was opened for data writing (see FAdpCreateFile
function).
HNERR_WRITE_FILE
File write error.
HNERR_INVALID_HANDLE
hFAdp parameter is not the HNFileAdapter object handle.
Description:
After successful creation of CAP file by FAdpCreateFile function
you may dump packets to it by this function synchronously.
Example of writing packets to CAP file with FAdpSyncSend:
// Create HNPacket object
HANDLE hPkt = PktCreate(1514);
LPVOID pPacketData = PktGetPacketData(hPkt);
// Write data to the packet buffer
...
// Create CAP file
DWORD Res = FAdpCreateFile(hFAdp, "packets.cap");
...
// Write packet to file
Res = FAdpSyncSend(hFAdp, pPacketData, 1514);