Share via


NdisFRegisterFilterDriver (Compact 7)

3/12/2014

A filter driver calls this function to register its FilterXxx functions with NDIS.

Syntax

NDIS_STATUS
  NdisFRegisterFilterDriver(
    IN PDRIVER_OBJECT  DriverObject,
    IN NDIS_HANDLE  FilterDriverContext,
    IN PNDIS_FILTER_DRIVER_CHARACTERISTICS  FilterCharacteristics,
    OUT PNDIS_HANDLE  NdisFilterDriverHandle
    );

Parameters

  • FilterDriverContext
    A handle to a driver-allocated context area where the driver maintains state and configuration information.
  • FilterCharacteristics
    A pointer to an NDIS_FILTER_DRIVER_CHARACTERISTICS structure that the filter driver created and initialized with its FilterXxx function entry points.
  • NdisFilterDriverHandle
    A pointer to a handle variable. If the call to NdisFRegisterFilterDriver succeeds, NDIS fills this variable with a filter driver handle. The filter driver saves this handle and then later passes this handle to NDIS functions, such as NdisFDeregisterFilterDriver, that require a filter driver handle as an input parameter.

Return Value

NdisFRegisterFilterDriver returns one of the following status values:

Value Description

NDIS_STATUS_SUCCESS

NdisFRegisterFilterDriver returns NDIS_STATUS_SUCCESS if it registered the filter driver.

NDIS_STATUS_BAD_VERSION

The version that is specified in the MajorNdisVersion member of the structure at FilterCharacteristics is invalid.

NDIS_STATUS_BAD_CHARACTERISTICS

At least one of the members that are specified in NDIS_FILTER_DRIVER_CHARACTERISTICS is invalid.

NDIS_STATUS_INVALID_PARAMETER

At least one of the input parameters that the driver passed to NdisFRegisterFilterDriver is invalid.

NDIS_STATUS_RESOURCES

NdisFRegisterFilterDriver failed because of insufficient resources.

NDIS_STATUS_FAILURE

NdisFRegisterFilterDriver returns NDIS_STATUS_FAILURE if no previous values apply.

Remarks

A filter driver calls the NdisFRegisterFilterDriver function from its DriverEntry routine. For more information about DriverEntry, see DriverEntry of NDIS Filter Drivers.

Every filter driver exports a set of FilterXxx functions by setting up the NDIS_FILTER_DRIVER_CHARACTERISTICS structure and calling NdisFRegisterFilterDriver. NDIS copies this structure to the NDIS library's internal storage.

To allow filter drivers to register optional services, NDIS calls the FilterSetOptions function within the context of NdisFRegisterFilterDriver.

After it has registered, a filter driver can later call the NdisSetOptionalHandlers function to change the entry points for optional FilterXxx functions.

Filter drivers call the NdisFDeregisterFilterDriverfunction to release resources that were previously allocated with NdisFRegisterFilterDriver.

Requirements

Header

ndis.h

See Also

Reference

NDIS Functions for Filter Drivers
DriverEntry of NDIS Filter Drivers
FilterAttach
NDIS_FILTER_DRIVER_CHARACTERISTICS
NdisFDeregisterFilterDriver
NdisSetOptionalHandlers
NDIS Filter Driver Functions