Initializing an NDK-Capable Miniport Driver
A miniport driver that supports Network Direct kernel (NDK) is initialized in the same way as other miniport drivers. However, it must also register additional NDKPI entry points.
DriverEntry function
Every miniport driver's DriverEntry function initializes an NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure and passes it to NdisMRegisterMiniportDriver as described in the following pages:
The NDK-capable miniport driver must do the following when initializing the NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure:
In the OidRequestHandler member, the miniport driver must register a MiniportOidRequest function that supports:
All NDKPI OIDs.
Any OIDs that are mandatory for NDIS miniport drivers in general.
Note For a list of these mandatory OIDs, see Mandatory OIDs for Miniport Drivers.
In the SetOptionsHandler member, the miniport driver must register a MiniportSetOptions function as described in Configuring Optional Miniport Driver Services and the following MiniportSetOptions function section.
MiniportSetOptions function
NDIS calls the MiniportSetOptions function immediately after the miniport driver's DriverEntry function returns. The MiniportSetOptions function is called in the context of the miniport driver's call to NdisMRegisterMiniportDriver.
In its MiniportSetOptions function, the NDK-capable miniport driver registers its NDK capability and registers the following required NDKPI function entry points as described in Configuring Optional Miniport Driver Services:
OpenNDKAdapterHandler (OPEN_NDK_ADAPTER_HANDLER)
CloseNDKAdapterHandler (CLOSE_NDK_ADAPTER_HANDLER)
To register NDKPI entry points for these functions, the miniport driver's MiniportSetOptions function must do the following:
Initialize an NDIS_NDK_PROVIDER_CHARACTERISTICS structure.
Note Pay particular attention to the Header member description. The miniport driver must set this member correctly to identify itself as an NDK-capable miniport driver.
Store the function entry points in the OpenNDKAdapterHandler and CloseNDKAdapterHandler members of the structure.
Call the NdisSetOptionalHandlers function, passing the structure in the OptionalHandlers parameter.