When there is no packet in the interface, then this call goes in blocking state. Is anything else needs to be tuned ?
if (!WinDivertRecvEx(handle, packet, packet_len, &recv_len, 0,
addr, &addr_len, NULL))
For non-blocking, you need to pass a valid OVERLAPPED structure into WinDivertRecvEx. For more information, see the microsoft documentation for overlapped I/O.
It is the sample from the example passthru.c.
When there is no packet in the interface, then this call goes in blocking state. Is anything else needs to be tuned ? if (!WinDivertRecvEx(handle, packet, packet_len, &recv_len, 0, addr, &addr_len, NULL))