basil00 / Divert

WinDivert: Windows Packet Divert
https://reqrypt.org/windivert.html
Other
2.32k stars 491 forks source link

WinDivertRecvEX goes into blocking state when no packets #328

Closed prakashkolandaivelu closed 1 year ago

prakashkolandaivelu commented 1 year ago

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))

basil00 commented 1 year ago

For non-blocking, you need to pass a valid OVERLAPPED structure into WinDivertRecvEx. For more information, see the microsoft documentation for overlapped I/O.