@@ -294,8 +294,8 @@ typedef struct flow_s *flow_t;
294
294
/*
295
295
* Global state.
296
296
*/
297
- static HANDLE inject_handle_forward = NULL ;
298
- static HANDLE injectv6_handle_forward = NULL ;
297
+ static HANDLE inject_handle_forward = NULL ;
298
+ static HANDLE injectv6_handle_forward = NULL ;
299
299
static HANDLE inject_handle_in = NULL ;
300
300
static HANDLE inject_handle_out = NULL ;
301
301
static HANDLE injectv6_handle_in = NULL ;
@@ -1059,35 +1059,37 @@ extern NTSTATUS DriverEntry(IN PDRIVER_OBJECT driver_obj,
1059
1059
& inject_handle_forward );
1060
1060
if (!NT_SUCCESS (status ))
1061
1061
{
1062
- DEBUG_ERROR ("failed to create WFP forward packet injection handle" , status );
1062
+ DEBUG_ERROR ("failed to create WFP forward packet injection handle" ,
1063
+ status );
1063
1064
goto driver_entry_exit ;
1064
1065
}
1065
1066
status = FwpsInjectionHandleCreate0 (AF_INET6 ,
1066
1067
FWPS_INJECTION_TYPE_NETWORK | FWPS_INJECTION_TYPE_FORWARD ,
1067
1068
& injectv6_handle_forward );
1068
1069
if (!NT_SUCCESS (status ))
1069
1070
{
1070
- DEBUG_ERROR ("failed to create WFP ipv6 forward packet injection handle" , status );
1071
+ DEBUG_ERROR ("failed to create WFP ipv6 forward packet injection handle" ,
1072
+ status );
1071
1073
goto driver_entry_exit ;
1072
1074
}
1073
-
1074
1075
status = FwpsInjectionHandleCreate0 (AF_INET ,
1075
1076
FWPS_INJECTION_TYPE_NETWORK | FWPS_INJECTION_TYPE_FORWARD ,
1076
1077
& inject_handle_in );
1077
1078
if (!NT_SUCCESS (status ))
1078
1079
{
1079
- DEBUG_ERROR ("failed to create WFP inbound packet injection handle" , status );
1080
+ DEBUG_ERROR ("failed to create WFP inbound packet injection handle" ,
1081
+ status );
1080
1082
goto driver_entry_exit ;
1081
1083
}
1082
1084
status = FwpsInjectionHandleCreate0 (AF_INET ,
1083
1085
FWPS_INJECTION_TYPE_NETWORK | FWPS_INJECTION_TYPE_FORWARD ,
1084
1086
& inject_handle_out );
1085
1087
if (!NT_SUCCESS (status ))
1086
1088
{
1087
- DEBUG_ERROR ("failed to create WFP outbound packet injection handle" , status );
1089
+ DEBUG_ERROR ("failed to create WFP outbound packet injection handle" ,
1090
+ status );
1088
1091
goto driver_entry_exit ;
1089
1092
}
1090
-
1091
1093
status = FwpsInjectionHandleCreate0 (AF_INET6 ,
1092
1094
FWPS_INJECTION_TYPE_NETWORK | FWPS_INJECTION_TYPE_FORWARD ,
1093
1095
& injectv6_handle_in );
@@ -3758,30 +3760,36 @@ static void windivert_network_classify(context_t context,
3758
3760
}
3759
3761
if (ipv4 )
3760
3762
{
3761
- if ( context -> layer == WINDIVERT_LAYER_NETWORK_FORWARD ) {
3762
- packet_state = FwpsQueryPacketInjectionState0 (inject_handle_forward , buffers ,
3763
- & packet_context );
3763
+ if (context -> layer == WINDIVERT_LAYER_NETWORK_FORWARD )
3764
+ {
3765
+ packet_state = FwpsQueryPacketInjectionState0 (inject_handle_forward ,
3766
+ buffers , & packet_context );
3764
3767
}
3765
- else if ( outbound ) {
3766
- packet_state = FwpsQueryPacketInjectionState0 (inject_handle_out , buffers ,
3767
- & packet_context );
3768
+ else if (outbound )
3769
+ {
3770
+ packet_state = FwpsQueryPacketInjectionState0 (inject_handle_out ,
3771
+ buffers , & packet_context );
3768
3772
}
3769
- else {
3770
- packet_state = FwpsQueryPacketInjectionState0 (inject_handle_in , buffers ,
3771
- & packet_context );
3773
+ else
3774
+ {
3775
+ packet_state = FwpsQueryPacketInjectionState0 (inject_handle_in ,
3776
+ buffers , & packet_context );
3772
3777
}
3773
3778
}
3774
3779
else
3775
3780
{
3776
- if ( context -> layer == WINDIVERT_LAYER_NETWORK_FORWARD ) {
3777
- packet_state = FwpsQueryPacketInjectionState0 (injectv6_handle_forward , buffers ,
3778
- & packet_context );
3781
+ if (context -> layer == WINDIVERT_LAYER_NETWORK_FORWARD )
3782
+ {
3783
+ packet_state = FwpsQueryPacketInjectionState0 (
3784
+ injectv6_handle_forward , buffers , & packet_context );
3779
3785
}
3780
- else if ( outbound ) {
3786
+ else if (outbound )
3787
+ {
3781
3788
packet_state = FwpsQueryPacketInjectionState0 (injectv6_handle_out ,
3782
3789
buffers , & packet_context );
3783
3790
}
3784
- else {
3791
+ else
3792
+ {
3785
3793
packet_state = FwpsQueryPacketInjectionState0 (injectv6_handle_in ,
3786
3794
buffers , & packet_context );
3787
3795
}
0 commit comments