FilterStatus routine

The FilterStatus function indicates status changes that are reported by NDIS or an underlying driver.

Note  You must declare the function by using the FILTER_STATUS type. For more information, see the following Examples section.

Syntax


FILTER_STATUS FilterStatus;

VOID FilterStatus(
  _In_  NDIS_HANDLE FilterModuleContext,
  _In_  PNDIS_STATUS_INDICATION StatusIndication
)
{ ... }

Parameters

FilterModuleContext [in]

A handle to the context area for the filter module. The filter driver created and initialized this context area in the FilterAttach function.

StatusIndication [in]

A pointer to an NDIS_STATUS_INDICATION structure that contains the status information.

Return value

None

Remarks

FilterStatus is an optional function. If a filter driver does not use status indications, it can set the entry point for this function to NULL when it calls the NdisFRegisterFilterDriver function.

To determine link status, use the status indications from underlying drivers instead of OID queries. These status indications will improve system performance and avoid possible race conditions.

A filter driver usually calls the NdisFIndicateStatus function at the end of its FilterStatus function to pass on the status indication to overlying drivers.

A filter driver can filter out certain status indications or modify the indicated status. To filter out a status indication, the driver simply does not call NdisFIndicateStatus.

NDIS calls FilterStatus at IRQL <= DISPATCH_LEVEL.

Examples

To define a FilterStatus function, you must first provide a function declaration that identifies the type of function you're defining. Windows provides a set of function types for drivers. Declaring a function using the function types helps Code Analysis for Drivers, Static Driver Verifier (SDV), and other verification tools find errors, and it's a requirement for writing drivers for the Windows operating system.

For example, to define a FilterStatus function that is named "MyStatus", use the FILTER_STATUS type as shown in this code example:


FILTER_STATUS MyStatus;

Then, implement your function as follows:


_Use_decl_annotations_
VOID
 MyStatus(
    NDIS_HANDLE  FilterModuleContext,
    PNDIS_STATUS_INDICATION  StatusIndication
    )
  {...}

The FILTER_STATUS function type is defined in the Ndis.h header file. To more accurately identify errors when you run the code analysis tools, be sure to add the _Use_decl_annotations_ annotation to your function definition. The _Use_decl_annotations_ annotation ensures that the annotations that are applied to the FILTER_STATUS function type in the header file are used. For more information about the requirements for function declarations, see Declaring Functions by Using Function Role Types for NDIS Drivers. For information about _Use_decl_annotations_, see Annotating Function Behavior.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

<= DISPATCH_LEVEL

See also

FilterAttach
NDIS_STATUS_INDICATION
NdisFIndicateStatus
NdisFRegisterFilterDriver

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft