A protocol driver calls the NdisRegisterProtocolDriver function to register its ProtocolXxx functions with NDIS.
NDIS_STATUS NdisRegisterProtocolDriver( NDIS_HANDLE ProtocolDriverContext, PNDIS_PROTOCOL_DRIVER_CHARACTERISTICS ProtocolCharacteristics, PNDIS_HANDLE NdisProtocolHandle );
A handle to a driver-allocated context area where the driver maintains state and configuration information.
A pointer to an NDIS_PROTOCOL_DRIVER_CHARACTERISTICS structure that the protocol driver created and initialized with its ProtocolXxx function entry points.
A pointer to a caller-supplied handle variable. NDIS writes a handle to this variable that uniquely identifies the driver that is registering. The driver must save this handle for use in subsequent NdisXxx function calls.
NdisRegisterProtocolDriver returns one of the following status values:
||NdisRegisterProtocolDriver returns NDIS_STATUS_SUCCESS if it registered the protocol driver.|
||The version specified in the MajorNdisVersion member of the structure at ProtocolCharacteristics is invalid.|
||Some members of the structure at the ProtocolCharacteristics parameter are invalid.|
||NdisRegisterProtocolDriver failed due to insufficient resources.|
||NdisRegisterProtocolDriver returns NDIS_STATUS_FAILURE if none of the preceding values applies.|
Drivers that call NdisRegisterProtocolDriver must be prepared for an immediate call to any of their ProtocolXxx functions.
Every protocol driver exports a set of ProtocolXxx functions by setting up the NDIS_PROTOCOL_DRIVER_CHARACTERISTICS structure and calling NdisRegisterProtocolDriver. NDIS copies this structure to the NDIS library's internal storage.
To allow protocol drivers to register optional services, NDIS calls the ProtocolSetOptions function within the context of NdisRegisterProtocolDriver.
Protocol drivers call the NdisDeregisterProtocolDriver function to release resources that were previously allocated with NdisRegisterProtocolDriver.
|Windows version||Supported in NDIS 6.0 and later.|
|Header||ndis.h (include Ndis.h)|
|DDI compliance rules||Irql_Protocol_Driver_Function|