The FindPreviousFrame function finds the previous frame in the current capture context that matches the filter.
HFRAME FindPreviousFrame(
HFRAME hCurrentFrame,
LPSTR ProtocolName,
LPADDRESS DestinationAddress,
LPADDRESS SourceAddress,
LPWORD ProtocolOffset,
DWORD OriginalFrameNumber,
DWORD LowestFrame
);
The return value is the handle to the frame. If the return value is not NULL, then the protocol offset is valid; if it is NULL, then BHGetLastError is valid.
Error code | Meaning |
---|---|
BHERR_SUCCESS | No problems were encountered. |
BHERR_INTERNAL_ERROR | An internal error occurred. |
BHERR_INVALID_HFRAME | The hFrame was invalid. |
This function finds a frame in the current capture context that matches the filter. The filter is defined primarily by the ProtocolName, and this is the only required filter input. The DestinationAddress and SourceAddress can be given as a speed enhancement. The ProtocolOffset is returned to the calling parser, which adds this DWORD to the pointer returned by locking the frame (with the ParserTemporaryLockFrame API call) to get the LPBYTE of the protocol that is being searched for. On return, the HFRAME that passed the filter is given to the parser. If the parser finds that this frame is not the one it is looking for, it can hand this HFRAME back to FindPreviousFrame to get the next frame back. The source and destination addresses are not required, and can be passed in as NULL. When used, they can be of type ADDRESS_TYPE_IP, and so on, not just MAC types.