ReadPacketsUnsorted

Available since: Windows Packet Filter 3.4.0

The CNdisApi::ReadPacketsUnsorted method reads a batch of network packets from multiple adapters in a single driver call. For each packet, the source adapter handle is stored in _INTERMEDIATE_BUFFER::m_hAdapter.

Syntax

BOOL CNdisApi::ReadPacketsUnsorted(
    PINTERMEDIATE_BUFFER* Packets,
    DWORD                 dwPacketsNum,
    PDWORD                pdwPacketsSuccess
) const;

Parameters

Packets
Array of pointers to pre-allocated INTERMEDIATE_BUFFER structures.

dwPacketsNum
Number of buffers in the array.

pdwPacketsSuccess
Pointer to a DWORD receiving the number of packets read.

Return Value

Returns TRUE on success; otherwise returns FALSE.

Remarks

This method is not supported under WOW64; it returns FALSE before issuing a driver request. Use the ordinary per-adapter ReadPacket or ReadPackets methods under WOW64.

Native SDK 3.6.2 output count

Use the output count only when the function returns TRUE. On the IOCTL path, the SDK copies request.packets_num into the output variable before returning, including on FALSE. If the driver has not changed that field, it still contains the requested packet count and is not evidence of successful processing.

The WOW64 precheck returns FALSE before writing the output count and does not set a new last-error value. Initialize your count if needed and check the Boolean before using it. See the pinned read/send implementations.