次の方法で共有


UNLOAD_PROTOCOL_HANDLER callback function

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.

The ProtocolUnload function is optional. ProtocolUnload performs cleanup operations before a protocol is unloaded.

Syntax

UNLOAD_PROTOCOL_HANDLER ProtocolUnload;

VOID ProtocolUnload(void)
{ ... }

Parameters

This callback function has no parameters.

Return value

None

Remarks

In response to a user request to uninstall a protocol, NDIS calls a protocol's ProtocolUnload function if the protocol has registered an entry point for this function in the NDIS_PROTOCOL_CHARACTERISTICS structure that it passed to NdisRegisterProtocol. NDIS calls ProtocolUnload after calling the protocol's ProtocolUnbindAdapter function once for each bound adapter.

ProtocolUnload performs driver-determined cleanup operations. For example, ProtocolUnload could request clients to close handles that they have opened to device objects exported by the protocol. Until all such handles are closed, the I/O manager will not call the DriverUnload function that the protocol registered in the driver object passed to its DriverEntry function. After all the handles are closed, ProtocolUnload could call IoDeleteDevice one or more times to delete device objects created by the protocol.

ProtocolUnload does not have to close a protocol's open bindings. When a protocol's DriverUnload function calls NdisDeregisterProtocol, NDIS calls the protocol's ProtocolUnbindAdapter function once for each binding that the protocol has open. The ProtocolUnbindAdapter function calls NdisCloseAdapter to close the binding.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use ProtocolUninstallinstead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL

See also

DriverEntry of NDIS Protocol Drivers

IoDeleteDevice

ProtocolUnbindAdapter

 

 

Send comments about this topic to Microsoft