- Remove the PASSTHRU flag; The same result can be achieved with a "false"

filter.
This commit is contained in:
basil00
2013-09-10 17:52:43 +08:00
parent bbd3b0e9e9
commit 835d604d4e
3 changed files with 3 additions and 23 deletions
-10
View File
@@ -431,16 +431,6 @@ WinDivert <a href="#filter_language">filter language</a>.
</tr>
<tr>
<td>
<tt>WINDIVERT_FLAG_PASSTHRU</tt>
</td>
<td>
This flag creates a WinDivert handle in "passthru" mode that does not divert
packets.
Such handle can still be used for packet injection.
</td>
</tr>
<tr>
<td>
<tt>WINDIVERT_FLAG_NO_CHECKSUM</tt>
</td>
<td>
-1
View File
@@ -79,7 +79,6 @@ typedef enum
*/
#define WINDIVERT_FLAG_SNIFF 1
#define WINDIVERT_FLAG_DROP 2
#define WINDIVERT_FLAG_PASSTHRU 4
#define WINDIVERT_FLAG_NO_CHECKSUM 1024
/*
+3 -12
View File
@@ -1615,16 +1615,8 @@ extern VOID windivert_ioctl(IN WDFQUEUE queue, IN WDFREQUEST request,
goto windivert_ioctl_exit;
}
if ((context->flags & WINDIVERT_FLAG_PASSTHRU) != 0)
{
// Passthru mode.
is_inbound = is_outbound = is_ipv4 = is_ipv6 = FALSE;
}
else
{
windivert_filter_analyze(context->filter, &is_inbound,
&is_outbound, &is_ipv4, &is_ipv6);
}
windivert_filter_analyze(context->filter, &is_inbound,
&is_outbound, &is_ipv4, &is_ipv6);
status = windivert_register_callouts(context, is_inbound,
is_outbound, is_ipv4, is_ipv6);
@@ -1935,8 +1927,7 @@ static void windivert_classify_callout(IN UINT8 direction, IN UINT32 if_idx,
packet_state = FwpsQueryPacketInjectionState0(injectv6_handle,
buffers, &packet_context);
}
if (!windivert_context_verify(context, WINDIVERT_CONTEXT_STATE_OPEN) ||
(context->flags & WINDIVERT_FLAG_PASSTHRU) != 0)
if (!windivert_context_verify(context, WINDIVERT_CONTEXT_STATE_OPEN))
{
result->actionType = FWP_ACTION_PERMIT;
return;