NdisClCloseAddressFamily (NDIS 5.1) 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.

NdisClCloseAddressFamily releases the association between a client protocol and a call manager's or MCM driver's registered AF for a particular NIC to which the client is bound.

Syntax

NDIS_STATUS NdisClCloseAddressFamily(
  _In_ NDIS_HANDLE NdisAfHandle
);

Parameters

Return value

When NdisClCloseAddressFamily returns anything other than NDIS_STATUS_PENDING, the client should make an internal call to its ProtocolClCloseAfComplete function. Otherwise, NDIS calls the client's ProtocolClCloseAfComplete function when this operation is completed.

If NdisClCloseAddressFamily returns NDIS_STATUS_PENDING, a client that is waiting for its ProtocolClCloseAfComplete function to be called should not block the current thread since this could cause a deadlock. This is particularly important when a client calls NdisClCloseAddressFamily in the context of handling an OID_CO_AF_CLOSE request. In this case, the call manager may not close the address family until after the client has returned from handling the OID_CO_AF_CLOSE request. If the client blocks the current thread, the client will never complete the handling of the OID_CO_AF_CLOSE request, thus causing a deadlock.

Remarks

A client commonly calls NdisClCloseAddressFamily from its ProtocolUnbindAdapter function, after it closes all the client's open VCs on the binding with calls to NdisClCloseCall and/or NdisClDeregisterSap. A client can also call NdisClCloseAddressFamily in the context of processing an OID_CO_AF_CLOSE request.

NDIS calls a client's ProtocolUnbindAdapter function whenever an underlying NIC to which that client is bound is being removed from the machine or is being reconfigured. A PnP reconfiguration of the underlying miniport driver causes the call manager or MCM driver to reregister the address family it supports over that NIC. This, in turn, causes a subsequent call to the client's ProtocolCoAfRegisterNotify function. In either scenario, the client's ProtocolUnbindAdapter function must call NdisClCloseAddressFamily with any outstanding NdisAfHandle it is currently using that depends on the underlying NIC driver.

As a general guideline, a client should release all the resources it allocated for connection-oriented communications through the miniport driver before its ProtocolUnbindAdapter function calls NdisCloseAdapter.

The NdisAfHandle passed to NdisClCloseAddressFamily becomes invalid for the client as soon as this call occurs.

Requirements

Target platform

Universal

Version

See NdisClCloseAddressFamily.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

See also

NdisClCloseCall

NdisClDeregisterSap

NdisClOpenAddressFamily

ProtocolClCloseAfComplete

ProtocolCmCloseAf

ProtocolCoAfRegisterNotify

ProtocolUnbindAdapter

 

 

Send comments about this topic to Microsoft