Export (0) Print
Expand All

NdisRegisterProtocolDriver function

A protocol driver calls the NdisRegisterProtocolDriver function to register its ProtocolXxx functions with NDIS.

Syntax


NDIS_STATUS NdisRegisterProtocolDriver(
  _In_opt_  NDIS_HANDLE ProtocolDriverContext,
  _In_      PNDIS_PROTOCOL_DRIVER_CHARACTERISTICS ProtocolCharacteristics,
  _Out_     PNDIS_HANDLE NdisProtocolHandle
);

Parameters

ProtocolDriverContext [in, optional]

A handle to a driver-allocated context area where the driver maintains state and configuration information.

ProtocolCharacteristics [in]

A pointer to an NDIS_PROTOCOL_DRIVER_CHARACTERISTICS structure that the protocol driver created and initialized with its ProtocolXxx function entry points.

NdisProtocolHandle [out]

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.

Return value

NdisRegisterProtocolDriver returns one of the following status values:

Return codeDescription
NDIS_STATUS_SUCCESS

NdisRegisterProtocolDriver returns NDIS_STATUS_SUCCESS if it registered the protocol driver.

NDIS_STATUS_BAD_VERSION

The version specified in the MajorNdisVersion member of the structure at ProtocolCharacteristics is invalid.

NDIS_STATUS_BAD_CHARACTERISTICS

Some members of the structure at the ProtocolCharacteristics parameter are invalid.

NDIS_STATUS_RESOURCES

NdisRegisterProtocolDriver failed due to insufficient resources.

NDIS_STATUS_FAILURE

NdisRegisterProtocolDriver returns NDIS_STATUS_FAILURE if none of the preceding values applies.

 

Remarks

A protocol driver calls the NdisRegisterProtocolDriver function from its DriverEntry routine. For more information about DriverEntry, see DriverEntry of NDIS Protocol Drivers.

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.

Requirements

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL

DDI compliance rules

Irql_Protocol_Driver_Function

See also

DriverEntry of NDIS Protocol Drivers
NDIS_PROTOCOL_DRIVER_CHARACTERISTICS
NdisDeregisterProtocolDriver
NdisSetOptionalHandlers

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft