次の方法で共有


NdisRegisterProtocolDriver (Compact 2013)

3/26/2014

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

Syntax

NDIS_STATUS
  NdisRegisterProtocolDriver(
    IN NDIS_HANDLE  ProtocolDriverContext,
    IN PNDIS_PROTOCOL_DRIVER_CHARACTERISTICS  ProtocolCharacteristics,
    OUT PNDIS_HANDLE  NdisProtocolHandle
    ); 

Parameters

  • ProtocolDriverContext
    A handle to a driver-allocated context area where the driver maintains state and configuration information.
  • ProtocolCharacteristics
    A pointer to an NDIS_PROTOCOL_DRIVER_CHARACTERISTICS structure that the protocol driver created and initialized with its ProtocolXxx function entry points.
  • NdisProtocolHandle
    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 later NdisXxx function calls.

Return Value

NdisRegisterProtocolDriver returns one of the following status values:

Value

Meaning

NDIS_STATUS_SUCCESS

NdisRegisterProtocolDriver returns NDIS_STATUS_SUCCESS if it registered the protocol driver.

NDIS_STATUS_BAD_VERSION

The version that is 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 because of 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.

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 enable 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

Header

ndis.h

See Also

Reference

NDIS Functions for Protocol Drivers
DriverEntry of NDIS Protocol Drivers
NDIS_PROTOCOL_DRIVER_CHARACTERISTICS
NdisDeregisterProtocolDriver
NdisSetOptionalHandlers