次の方法で共有


Registering as an NDIS Protocol Driver (NDIS 5.1)

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

To register its ProtocolXxx functions with NDIS, a protocol driver calls NdisRegisterProtocol in the context of its DriverEntryfunction. The handle that NdisRegisterProtocolreturns at NdisProtocolHandleis opaque to a protocol driver. The handle must be retained by the protocol driver and provided as an input parameter in future calls to NDIS -- for example, to open an adapter.

Before the protocol driver calls NdisRegisterProtocol, DriverEntrymust do the following:

  1. Zero-initialize a structure of type NDIS_PROTOCOL_CHARACTERISTICS -- for instance, with a call to NdisZeroMemory. This assures that unused members for optional entry points are set to NULL. If the structure is not zeroed, any unused members must be set to NULL before calling NdisRegisterProtocol.

  2. Specify the NDIS version with which the protocol is compatible in the NDIS_PROTOCOL_CHARACTERISTICS structure.

  3. Store the addresses of the mandatory ProtocolXxx functions, as well as any optional ProtocolXxx functions the driver exports, in the NDIS_PROTOCOL_CHARACTERISTICS structure.

For more information about registering ProtocolXxx functions, see the following topics:

Specifying the NDIS Version Number for a Protocol Driver

Registering the ProtocolXxx Functions of a Connectionless Protocol Driver

Registering the ProtocolXxx Functions of a Connection-Oriented Protocol Driver

 

 

Send comments about this topic to Microsoft