次の方法で共有


Updating the DriverEntry Routine for an NDIS 6.0 Protocol Driver

Like NDIS 5.x, NDIS 6.0 protocol drivers register with NDIS in the DriverEntry routine. In NDIS 6.0, the NdisRegisterProtocol function is eliminated. To register the protocol driver with NDIS 6.0, call the NdisRegisterProtocolDriver function.

Like NdisRegisterProtocol, the input parameters to NdisRegisterProtocolDriver include the NDIS_PROTOCOL_DRIVER_CHARACTERISTICS structure (formerly NDIS_PROTOCOL_CHARACTERISTICS) and a pointer to an NDIS_HANDLE at NdisProtocolHandle . NDIS provides the handle to identify the driver. In addition, NdisRegisterProtocolDriver includes the ProtocolDriverContext parameter that specifies a handle to a driver-allocated context area where the driver maintains state and configuration information. NDIS later passes the value at ProtocolDriverContext to the ProtocolBindAdapterEx function.

If the call to NdisRegisterProtocolDriver succeeds, the protocol driver must later call the NdisDeregisterProtocolDriver function. Call NdisDeregisterProtocolDriver in the context of the protocol driver's Unload routine.

If an error occurs after a successful call to NdisRegisterProtocolDriver, the driver must call the NdisDeregisterProtocolDriver function before DriverEntry returns.

For more information about NDIS 6.0 driver initialization, see Initializing a Protocol Driver.