VOID
NdisRegisterMac(
OUT PNDIS_STATUS Status,
OUT PNDIS_HANDLE NdisMacHandle,
IN NDIS_HANDLE NdisWrapperHandle,
IN NDIS_HANDLE MacMacContext,
IN PNDIS_MAC_CHARACTERISTICS MacCharacteristics,
IN UINT CharacteristicsLength
);
NdisRegisterMac is called by the NIC driver immediately after it calls NdisInitializeWrapper.
NDIS_STATUS_BAD_CHARACTERISTICS
NDIS_STATUS_BAD_VERSION
NDIS_STATUS_FAILURE
NDIS_STATUS_NOT_ACCEPTED
NDIS_STATUS_RESOURCES
NDIS_STATUS_SUCCESS
typedef struct _NDIS_MAC_CHARACTERISTICS { UCHAR MajorNdisVersion; UCHAR MinorNdisVersion; UINT Reserved; OPEN_ADAPTER_HANDLER OpenAdapterHandler; CLOSE_ADAPTER_HANDLER CloseAdapterHandler; SEND_HANDLER SendHandler; TRANSFER_DATA_HANDLER TransferDataHandler; RESET_HANDLER ResetHandler; REQUEST_HANDLER RequestHandler; QUERY_GLOBAL_STATISTICS_HANDLER
QueryGlobalStatisticsHandler; UNLOAD_MAC_HANDLER UnloadMacHandler; ADD_ADAPTER_HANDLER AddAdapterHandler; REMOVE_ADAPTER_HANDLER RemoveAdapterHandler; NDIS_STRING Name; } NDIS_MAC_CHARACTERISTICS, *PNDIS_MAC_CHARACTERISTICS;
This structure’s members provide the following information:
NdisRegisterMac provides the NDIS library with information about the NIC driver, including the addresses of its upper-edge driver functions. In response, the NDIS library registers the NIC driver and provides a connection for it.
Every NIC driver should initialize the characteristics structure with NdisZeroMemory before it sets values in this structure and calls NdisRegisterMac.
NdisRegisterMac saves the information at MacCharacteristics in the NDIS library.
All upper-edge function addresses in the characteristics structure must be valid. After it has registered, the NIC driver cannot alter its upper-edge functions.
After NdisRegisterMac returns control, the NDIS interface library calls the supplied MacAddAdapter function.
Callers of NdisRegisterMac run at IRQL PASSIVE_LEVEL.
MacAddAdapter, MacCloseAdapter, MacOpenAdapter, MacQueryGlobalStatistics, MacRemoveAdapter, MacRequest, MacReset, MacSend, MacTransferData, MacUnload, NdisDeregisterMac, NdisInitializeString, NdisInitializeWrapper, NdisRegisterAdapter, NdisZeroMemory