Closed vincenthawke closed 3 months ago
As per the docs, WinDivertRecvEx
will change the value to reflect the actual number of packets received:
pAddrLen
: Initially, a pointer to the length of the pAddr buffer in bytes. This value is updated to the total bytes written to pAddr.Re-initializing addr_len
once per loop was correct.
I noticed that if I change the code from:
to:
Should
addr_len = batch * sizeof(WINDIVERT_ADDRESS);
not evaluate to the same value regardless of if it is initialized inside or outside the while loop? Instead it changesaddr_len
to always be80
, which then logically means thatWinDivertRecvEx
can't receive more than one packet.