Expand Minimize
This topic has not yet been rated - Rate this topic

FwpsFlowAssociateContext0 function

The FwpsFlowAssociateContext0 function associates a callout driver–defined context with a data flow.

Syntax


NTSTATUS NTAPI FwpsFlowAssociateContext0(
  _In_  UINT64 flowId,
  _In_  UINT16 layerId,
  _In_  UINT32 calloutId,
  _In_  UINT64 flowContext
);

Parameters

flowId [in]

A run-time identifier that specifies the data flow with which to associate the context. The run-time identifier for a data flow is provided to a callout driver through the FWPS_METADATA_FIELD_FLOW_HANDLE metadata value that was passed to the callout driver's classifyFn callout function.

layerId [in]

The run-time identifier for the filtering layer with which the context is being associated. For more information, see Run-time Filtering Layer Identifiers.

calloutId [in]

The run-time identifier for the callout in the filter engine. This identifier was returned when the callout driver called either the FwpsCalloutRegister0 or FwpsCalloutRegister1 functions to register the callout with the filter engine.

flowContext [in]

The callout driver–defined context to be associated with the data flow. This parameter must not be zero. This context is opaque to the filter engine.

Return value

The FwpsFlowAssociateContext0 function returns one of the following NTSTATUS codes.

Return codeDescription
STATUS_SUCCESS

The context was successfully associated with the data flow.

STATUS_OBJECT_NAME_EXISTS

A context is already associated with the data flow. In this case, a callout driver should first call the FwpsFlowRemoveContext0 function to remove the existing context and then call the FwpsFlowAssociateContext0 function again to associate the new context with the data flow.

Other status codes

An error occurred.

 

Remarks

When filtering a data flow, a callout driver can call the FwpsFlowAssociateContext0 function to associate a context with the data flow. It can then use this context to preserve any driver-specific data or state information between calls by the filter engine to a callout's classifyFn callout function for that data flow.

There must be a callout in the filter engine at the layer identified by the layerId parameter that has registered a flowDeleteFn callout function. Otherwise, the call to the FwpsFlowAssociateContext0 function will return an error. The filter engine calls that flowDeleteFn callout function when the flow is terminated so that the callout driver can clean up the context associated with the flow.

Requirements

Version

Available starting with Windows Vista.

Header

Fwpsk.h (include Fwpsk.h)

IRQL

<= DISPATCH_LEVEL

See also

classifyFn
flowDeleteFn
FwpsCalloutRegister0
FwpsCalloutRegister1
FwpsFlowRemoveContext0

 

 

Send comments about this topic to Microsoft

Build date: 5/7/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.