Partager via


MiniportSetOptions (Compact 2013)

3/26/2014

NDIS calls a miniport driver's MiniportSetOptions function to enable the miniport driver to register optional services.

Syntax

NDIS_STATUS MiniportSetOptions(
    NDIS_HANDLE  NdisDriverHandle,
    NDIS_HANDLE  DriverContext
);

Parameters

  • NdisDriverHandle
    [in] A handle that identifies this miniport driver. NDIS returns this handle to the miniport driver when it returns from the NdisMRegisterMiniportDriver function.
  • DriverContext
    [in] The handle that the driver passed to NdisMRegisterMiniportDriver that identifies the driver context area.

Return Value

MiniportSetOptions returns one of the following status values:

  • NDIS_STATUS_SUCCESS
    MiniportSetOptions successfully registered the driver's optional services and resources.
  • NDIS_STATUS_RESOURCES
    MiniportSetOptions could not allocate the resources that the driver requires.
  • NDIS_STATUS_XXX or NTSTATUS_XXX
    The miniport driver's attempt to register options failed. Usually, such an error status is propagated from an NdisXxx function or a kernel-mode support routine.

Remarks

MiniportSetOptions is an optional function. NDIS calls MiniportSetOptions within the context of the miniport driver's call to the NdisMRegisterMiniportDriver function.

MiniportSetOptions registers optional services and can allocate other driver resources. To register optional MiniportXxx functions, the miniport driver calls the NdisSetOptionalHandlers function and passes a characteristics structure at the OptionalHandlers parameter.

The optional services that apply to miniport drivers are defined in the following characteristics structures:

  • NDIS_MINIPORT_CO_CHARACTERISTICS
  • NDIS_MINIPORT_PNP_CHARACTERISTICS
  • NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS
  • NDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS
  • NDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS

If an attempt to allocate resources or services fails, MiniportSetOptions should undo all the allocations that succeeded before it returns control with a status other than NDIS_STATUS_SUCCESS.

NDIS can call the miniport driver's other MiniportXxx functions at any time after MiniportSetOptions returns. The miniport driver should be prepared to be called back at the MiniportInitializeEx function. The miniport adapters are in the Halted state before the NDIS calls MiniportInitializeEx.

The MiniportDriverUnload function should undo all the operations that were performed in MiniportSetOptions.

NDIS calls MiniportSetOptions at IRQL = PASSIVE_LEVEL.

See Also

Reference

NDIS Miniport Driver Functions
MiniportInitializeEx
MiniportDriverUnload
NdisMRegisterMiniportDriver
NdisSetOptionalHandlers
NDIS Functions for Miniport Drivers