Partager via


FwpsFlowAssociateContext0 (Compact 2013)

3/26/2014

This 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
    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's classifyFn callout function
  • layerId
    The run-time identifier for the filtering layer with which the context is being associated.
  • calloutId
    The run-time identifier for the callout in the filter engine. This identifier was returned when the callout driver called the FwpsCalloutRegister0 function to register the callout with the filter engine.
  • flowContext
    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:

Value

Description

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, or the call to the FwpsFlowAssociateContext0 function returns an error. The filter engine calls the flowDeleteFn callout function when the flow is terminated so that the callout driver can clean up the associated context.

Requirements

Header

fwpsk.h

See Also

Reference

Functions Called by Callout Drivers
classifyFn
FwpsCalloutRegister0
FwpsFlowRemoveContext0
flowDeleteFn
WFP Callout Driver Run-time Filtering Layer Identifiers
WFP Callout Driver Functions