This documentation is archived and is not being maintained.

NdisDeregisterProtocol 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.

NdisDeregisterProtocol releases the resources allocated when the driver called NdisRegisterProtocol.

Syntax


VOID NdisDeregisterProtocol(
  _Out_ PNDIS_STATUS Status,
  _In_  NDIS_HANDLE  NdisProtocolHandle
);

Parameters

Status [out]

Pointer to a caller-supplied variable that is set to NDIS_STATUS_SUCCESS on return from this function.

NdisProtocolHandle [in]

Specifies the handle returned by NdisRegisterProtocol when the driver initialized.

Return value

None

Remarks

Registered protocol drivers call NdisDeregisterProtocol in any of the following circumstances:

  • The driver already called NdisRegisterProtocol successfully but it cannot bind to any underlying NDIS driver in the machine.

  • The driver is being unloaded. That is, the Unload routine set up in its driver object during initialization has been called or the ProtocolUnbindAdapter function has been called to release the driver's last remaining binding.

    For more information about the Unload routine and other standard kernel-mode driver routines, see Kernel-Mode Driver Components.

  • The system is being shut down. Because the driver, which is a highest-level protocol, called IoRegisterShutdownNotification when it initialized, its Shutdown routine has been called.

    See IoRegisterShutdownNotification for more information.

If a protocol has any open bindings, its call to NdisDeregisterProtocol causes NDIS to call the protocol's ProtocolUnbindAdapter function once for each open binding. ProtocolUnbindAdapter calls NdisCloseAdapter to close the binding.

When outstanding opens, if any, have been closed, NdisDeregisterProtocol releases all filters its caller has set up and frees the memory NDIS allocated to track bindings and filters for the protocol driver.

Requirements

Target platform

Universal

Version

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

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

See also

NdisCloseAdapter
NdisIMDeInitializeDeviceInstance
NdisOpenAdapter
NdisRegisterProtocol
ProtocolCloseAdapterComplete
ProtocolStatus
ProtocolUnbindAdapter

 

 

Send comments about this topic to Microsoft

Show: