SendPacketsToAdaptersUnsorted

Available since: Windows Packet Filter 3.4.0

The SendPacketsToAdaptersUnsorted function transmits a batch of packets across one or more network adapters in a single call. Each packet’s destination adapter is determined by the m_hAdapter field of its INTERMEDIATE_BUFFER.

Syntax

BOOL WINAPI SendPacketsToAdaptersUnsorted(
    _In_    HANDLE                hOpen,
    _Inout_ PINTERMEDIATE_BUFFER* Packets,
    _In_    DWORD                 dwPacketsNum,
    _Out_   PDWORD                pdwPacketsSuccess
);

Remarks

This batched injection API provides efficient packet re-injection without requiring multiple single-adapter calls. This function is not supported under WOW64; the native SDK returns FALSE in that case. Use the ordinary per-adapter packet send APIs under WOW64.

See Also

ReadPacketsUnsorted, SendPacketsToMstcpUnsorted

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.