NDIS_STATUS
NdisMRegisterMiniport(
IN NDIS_HANDLE NdisWrapperHandle,
IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics,
IN UINT CharacteristicsLength
);
NdisMRegisterMiniport registers a NIC or intermediate driver’s MiniportXxx entry points and name with the NDIS library when the driver initializes.
typedef struct _NDIS_MINIPORT_CHARACTERISTICS {
UCHAR MajorNdisVersion;
UCHAR MinorNdisVersion;
UINT Reserved;
W_CHECK_FOR_HANG_HANDLER CheckForHangHandler;
W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler;
W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler;
W_HALT_HANDLER HaltHandler;
W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler;
W_INITIALIZE_HANDLER InitializeHandler;
W_ISR_HANDLER ISRHandler;
W_QUERY_INFORMATION_HANDLER QueryInformationHandler;
W_RECONFIGURE_HANDLER ReconfigureHandler;
W_RESET_HANDLER ResetHandler;
W_SEND_HANDLER SendHandler;
W_SET_INFORMATION_HANDLER SetInformationHandler;
W_TRANSFER_DATA_HANDLER TransferDataHandler;
//
// MajorNdisVersion must be set to 0x04 with following members
//
W_RETURN_PACKET_HANDLER ReturnPacketHandler;
W_SEND_PACKETS_HANDLER SendPacketsHandler;
W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler;
} NDIS_MINIPORT_CHARACTERISTICS, *PNDIS_MINIPORT_CHARACTERISTICS;
The driver should initialize this structure with zeros before setting up any of the following members:
This member must be set to 0x04 if the caller sets entry points in any members
following Name.
If the miniport supports multipacket sends, it sets the SendPacketsHandler
member instead and sets this member to NULL.
If the driver includes the build instruction NDIS40_MINIPORT (or NDIS30_MINIPORT, as appropriate) in its sources or if the driver writer uses the -DNDIS40_MINIPORT (or ..30..) compiler switch, this parameter is set when the driver is built.
NdisMRegisterMiniport returns NDIS_STATUS_SUCCESS if it registered the miniport, or it can return one of the following status values:
A NIC driver calls NdisMRegisterMiniport from its DriverEntry function after DriverEntry calls NdisMInitializeWrapper.
Every NIC driver exports only MiniportXxx functions must set up a characteristics structure and call NdisMRegisterMiniport. This structure is copied in the NdisMRegisterMiniport request to the NDIS library’s internal storage. Thus, once it has registered, a miniport driver cannot change its handler functions.
The NDIS library currently does not call MiniportReconfigure functions, so such a function in an existing miniport driver is dead code unless the miniport makes internal calls to its MiniportReconfigure function from MiniportInitialize.
After the driver has called NdisMRegisterMiniport, it should be prepared to be called back at the MiniportInitialize entry point specified in the characteristics structure.
NDIS intermediate drivers, which export both MiniportXxx and ProtocolXxx functions, usually call NdisIMRegisterLayeredMiniport instead of NdisMRegisterMiniport. Intermediate drivers that export only a set of MiniportXxx usually call NdisMRegisterMiniport.
Callers of NdisMRegisterMiniport run at IRQL PASSIVE_LEVEL.
DriverEntry of NDIS Miniport Drivers, MiniportAllocateComplete, MiniportCheckForHang, MiniportDisableInterrupt, MiniportEnableInterrupt, MiniportHalt, MiniportHandleInterrupt, MiniportInitialize, MiniportISR, MiniportQueryInformation, MiniportReconfigure, MiniportReset, MiniportReturnPacket, MiniportSend, MiniportSendPackets, MiniportSetInformation, MiniportTransferData, MiniportWanSend, NdisIMRegisterLayeredMiniport, NdisZeroMemory