From 8601f07ce112916b51f0f21a185fd73696c66eea Mon Sep 17 00:00:00 2001
From: basil00
BOOL WinDivertRecvEx(
__in HANDLE handle,
- __out PVOID pPacket,
+ __out VOID *pPacket,
__in UINT packetLen,
- __in UINT64 flags,
- __out_opt PWINDIVERT_ADDRESS pAddr,
__out_opt UINT *recvLen,
+ __in UINT64 flags,
+ __out_opt WINDIVERT_ADDRESS *pAddr,
+ __inout_opt UINT *pAddrLen,
__inout_opt LPOVERLAPPED lpOverlapped
);
@@ -1108,14 +1109,20 @@ BOOL WinDivertRecvEx(
@@ -1131,9 +1138,31 @@ All other codes indicate an error.
Remarks
This function is equivalent to
-WinDivertRecv() except that it
-supports overlapped I/O via the lpOverlapped parameter.
+WinDivertRecv() except:
+Batched I/O makes it possible to receive multiple packets at once using a
+single operation.
+This reduces the number of kernel/user-mode context switches, improving
+performance.
+To use batched I/O, pass an array of more than one
+WINDIVERT_ADDRESS to pAddr, set pAddrLen
+to be the total length of the pAddr array, and ensure that
+pPacket points to a sufficiently large buffer for multiple
+packets.
+When the operation completes, the value pointed to by pAddrLen
+is updated to the total number of address bytes actually received.
+For example, if a batch of 5 packets were to be received, then
+pAddrLen will be updated to point to the value
+(5*sizeof(WINDIVERT_ADDRESS)).
+The received packets are packed continuously into the pPacket buffer
+without gaps.
5.6 WinDivertSend