CAP file has not been opened, see the FAdpOpenFile function.
HNERR_ADDR_ERR
hPkt 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_READ_FILE
File read error.
HNERR_BAD_PACKET_LEN
HNPacket.IncPacketSize property
[Get/Set]
for hPkt parameter is set incorrectly.
HNERR_EOF
End of CAP file.
HNERR_INVALID_HANDLE
hFAdp parameter is not the HNFileAdapter object handle.
Description:
Use this function to get access to the packets stored in a CAP file. This function may be called
only after successfull call of the FAdpOpenFile function.
If you already read packets from certain file, and need to read the first packet, please use
FAdpRewindFile.
Example of reading packets from CAP file using FAdpGetNextPacket function:
// Create HNPacket object
HANDLE hPkt = PktCreate(1514);
// Open CAP file
DWORD Res = FAdpOpenFile(hFAdp, "packets.cap");
...
do
{
// Read packet from file
Res = FAdpGetNextPacket(hFAdp,hPkt);
// Getting access to the HNPacket properties and functions
...
}
while (Res == HNERR_OK);