A miniport driver calls the NdisMRegisterMiniportDriver function to register MiniportXxx entry points with NDIS as the first step in initialization.
NDIS_STATUS NdisMRegisterMiniportDriver( PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath, NDIS_HANDLE MiniportDriverContext, PNDIS_MINIPORT_DRIVER_CHARACTERISTICS MiniportDriverCharacteristics, PNDIS_HANDLE NdisMiniportDriverHandle );
A pointer to an opaque registry path that the miniport driver received in its DriverEntry routine at the Argument2 parameter.
A handle to a driver-allocated context area where the driver maintains state and configuration information.
A pointer to an NDIS_MINIPORT_DRIVER_CHARACTERISTICS structure that the caller initialized.
A pointer to a caller-supplied handle variable. NDIS writes a handle to this variable that uniquely identifies this driver. The driver must save this handle for use in subsequent NdisXxx function calls.
NdisMRegisterMiniportDriver returns one of the following status values:
NdisMRegisterMiniportDriver registered the miniport driver successfully.
||The CharacteristicsLength parameter is incorrect for the NDIS version that is specified at the MajorNdisVersion member in the structure at MiniportDriverCharacteristics .|
||The MajorNdisVersion or MinorNdisVersion specified in the characteristics structure is invalid.|
||A shortage of resources, possibly memory, prevented NDIS from registering the caller.|
||This is a default error status, returned when none of the preceding errors caused the registration to fail.|
Every miniport driver exports a set of standard MiniportXxx functions by setting up the characteristics structure and calling NdisMRegisterMiniportDriver. NDIS copies the characteristics structure to NDIS internal storage. Therefore, after it has registered, a driver cannot change its MiniportXxx entry points.
To register its virtual miniport interface, an NDIS intermediate drivers must call NdisMRegisterMiniportDriver with the NDIS_INTERMEDIATE_DRIVER flag set in the structure at MiniportDriverCharacteristics . NDIS drivers that have a WDM lower edge must call NdisMRegisterMiniportDriver with the NDIS_WDM_DRIVER flag set in the structure at MiniportDriverCharacteristics .
Drivers can register as a combined miniport driver and intermediate driver. To register its physical miniport driver, a miniport-intermediate driver calls NdisMRegisterMiniportDriver with appropriate parameters just as for any miniport driver. To register its virtual miniport interface, the driver calls NdisMRegisterMiniportDriver again, but with the NDIS_INTERMEDIATE_DRIVER flag set in the MiniportDriverCharacteristics parameter.
To enable miniport drivers to register optional services, NDIS calls the MiniportSetOptions function within the context of NdisMRegisterMiniportDriver.
After a driver calls NdisMRegisterMiniportDriver, the driver should be prepared to be called back at the MiniportInitializeEx function that is specified in the MiniportDriverCharacteristics parameter any time after DriverEntry returns.
If an error occurs in DriverEntry after NdisMRegisterMiniportDriver returns successfully, the driver must call the NdisMDeregisterMiniportDriver function before DriverEntry returns. If DriverEntry succeeds, the driver must call NdisMDeregisterMiniportDriver from its MiniportDriverUnload function.
|Minimum supported client||Supported in NDIS 6.0 and later.|
|Header||ndis.h (include Ndis.h)|
|DDI compliance rules||Irql_Miniport_Driver_Function|
See AlsoNDIS_MINIPORT_DRIVER_CHARACTERISTICS NdisMDeregisterMiniportDriver