FwpsQueryPacketInjectionState0 (Compact 2013)
3/26/2014
This function queries the injection state of packet data.
Syntax
FWPS_PACKET_INJECTION_STATE NTAPI
FwpsQueryPacketInjectionState0(
IN HANDLE injectionHandle,
IN const NET_BUFFER_LIST *netBufferList,
OUT OPTIONAL HANDLE *injectionContext
);
Parameters
- injectionHandle
An injection handle that was previously created by a call to the FwpsInjectionHandleCreate0 function
- netBufferList
A pointer to a NET_BUFFER_LIST structure that describes the packet data that is being classified. The packet can originate from the network stack or be injected into the network stack by a WFP callout driver
- injectionContext
An optional handle to the injection context. If it is specified, it can be obtained by calling the FwpsQueryPacketInjectionState0 function when the packet injection state FWPS_PACKET_INJECTION_STATE is FWPS_PACKET_INJECTED_BY_SELF or FWPS_PACKET_PREVIOUSLY_INJECTED_BY_SELF
Return Value
The FwpsQueryPacketInjectionState0 function returns a constant value from the FWPS_PACKET_INJECTION_STATE enumeration.
Remarks
Because injected packet data can be reclassified against the callout that injected it, this function allows a callout to inspect the injection history of packet data and thereby avoid repetitive inspections of packet data.
A callout can track other callout-specific information by using the optional injectionContext handle in a packet injection function during packet data injection. If the FwpsQueryPacketInjectionState0 function returns FWPS_PACKET_INJECTED_BY_SELF or FWPS_PACKET_PREVIOUSLY_INJECTED_BY_SELF, the supplied injectionContext is returned as the completionContext parameter of the function that performed the injection.
If the return value is FWPS_PACKET_INJECTED_BY_SELF or FWPS_PACKET_PREVIOUSLY_INJECTED_BY_SELF, the NET_BUFFER_LIST pointed to by netBufferList should not be additionally modified or pended as part of a cloning and injection procedure. In this case, the callout should set the actionType member of the FWPS_CLASSIFY_OUT0 structure pointed to by the classifyOut parameter of the classifyFn function to one of the following values:
- FWP_ACTION_BLOCK
Specifies that subsequent modification of the clone net buffer list is not allowed - FWP_ACTION_PERMIT
Specifies that the injection function has not modified the clone net buffer list or modification is allowed
Requirements
Header |
fwpsk.h |
See Also
Reference
Functions Called by Callout Drivers
NET_BUFFER_LIST
FWPS_CLASSIFY_OUT0
FWPS_PACKET_INJECTION_STATE
classifyFn
FwpsInjectionHandleCreate0
WFP Callout Driver Functions