Partager via


NdisSetOptionalHandlers (Compact 7)

3/12/2014

NDIS drivers can call this function to set or change the entry points of driver functions.

Syntax

NDIS_STATUS
  NdisSetOptionalHandlers(
    IN NDIS_HANDLE  NdisHandle,
    IN PNDIS_DRIVER_OPTIONAL_HANDLERS  OptionalHandlers
    );

Parameters

  • NdisHandle
    An NDIS handle that identifies a driver or driver instance.

    For a protocol driver, this is the NdisDriverHandle value that is passed to the ProtocolSetOptions function or the NdisBindingHandle value obtained by calling the NdisOpenAdapterEx function.

    For a miniport driver, this is the NdisDriverHandle value that is passed to the MiniportSetOptions function.

    For a filter driver, this is the NdisDriverHandle value that is passed to the FilterSetOptions function or the NdisFilterHandle value that is passed to the FilterAttach function.

  • OptionalHandlers
    A pointer to one of the following NDIS structures:

    • NDIS_PROTOCOL_CO_CHARACTERISTICS
    • NDIS_MINIPORT_CO_CHARACTERISTICS
    • NDIS_MINIPORT_PNP_CHARACTERISTICS
    • NDIS_CO_CLIENT_OPTIONAL_HANDLERS
    • NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS
    • NDIS_FILTER_PARTIAL_CHARACTERISTICS
    • NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
    • NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS
    • NDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
    • NDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS

Return Value

Value Description

NDIS_STATUS_SUCCESS

The driver entry points were set.

NDIS_STATUS_RESOURCES

Failed because of insufficient resources.

NDIS_STATUS_NOT_SUPPORTED

Failed because the miniport driver did not specify that it supports NDIS 6.0 or later versions. A miniport driver specifies its NDIS version when it calls the NdisMRegisterMiniportDriver function.

NDIS_STATUS_FAILURE

None of the previous values applies.

Remarks

An NDIS driver can call NdisSetOptionalHandlers to overwrite its default entry points. The structure types that are passed at OptionalHandlers vary according to the type of driver.

Protocol drivers can call NdisSetOptionalHandlers in the context of the ProtocolSetOptions function. As an option, protocol drivers can call NdisSetOptionalHandlers from the ProtocolBindAdapterEx function or the ProtocolOpenAdapterCompleteEx function after the protocol driver has a valid handle from the NdisOpenAdapterEx function.

In this case, the valid structures are as follows:

  • NDIS_PROTOCOL_CO_CHARACTERISTICS
  • NDIS_CO_CLIENT_OPTIONAL_HANDLERS
  • NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS

For information about the last two structures, see NDIS 6.0 TCP chimney offload documentation.

Miniport drivers call NdisSetOptionalHandlers in the context of the MiniportSetOptions function.

In this case, the valid structures are as follows:

  • NDIS_MINIPORT_CO_CHARACTERISTICS
  • NDIS_MINIPORT_PNP_CHARACTERISTICS
  • NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS

For information about the last two structures, see NDIS 6.0 TCP chimney offload documentation.

Filter drivers call NdisSetOptionalHandlers in the context of the FilterSetOptions function.

Filter drivers can call NdisSetOptionalHandlers for a filter module. Filter drivers call NdisSetOptionalHandlers in the context of the FilterSetModuleOptionsfunction.

In this case, the valid structures are as follows:

  • NDIS_FILTER_PARTIAL_CHARACTERISTICS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
  • NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS
  • NDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
  • NDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS

For information about the last four structures, see NDIS 6.0 TCP chimney offload documentation.

Important For important legal information about TCP chimney offload, see Legal Information.

Requirements

Header

ndis.h

See Also

Reference

NDIS Configuration Interface
FilterAttach
FilterRestart
FilterSetOptions
MiniportSetOptions
NDIS_FILTER_PARTIAL_CHARACTERISTICS
NdisOpenAdapterEx
NdisMRegisterMiniportDriver
ProtocolBindAdapterEx
ProtocolOpenAdapterCompleteEx
ProtocolSetOptions