NdisClCloseAddressFamily function (ndis.h)

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

[in] NdisAfHandle

Specifies the NDIS-supplied handle returned by NdisClOpenAddressFamilyEx.

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 NdisCmNotifyCloseAddressFamily request. In this case, the call manager may not close the address family until after the client has returned from handling the NdisCmNotifyCloseAddressFamily request. If the client blocks the current thread, the client will never complete the handling of the NdisCmNotifyCloseAddressFamily request, thus causing a deadlock.

Remarks

A client commonly calls NdisClCloseAddressFamily from its
ProtocolUnbindAdapterEx 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 NdisCmNotifyCloseAddressFamily request.

NDIS calls a client's ProtocolUnbindAdapterEx 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 ProtocolUnbindAdapterEx function must call NdisClCloseAddressFamily with any outstanding NdisAfHandle it is currently using that depends on the underlying miniport driver.

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

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

Before a call to NdisClCloseAddressFamily, the client may use the NdisAfHandle while the AF is open or while a ProtocolClNotifyCloseAf operation is pending. If the ProtocolClNotifyCloseAf function returns NDIS_STATUS_PENDING, use the handle in the NdisClNotifyCloseAddressFamilyComplete call after the close operation completes.

Requirements

Requirement Value
Minimum supported client Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisClCloseAddressFamily (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisClCloseAddressFamily (NDIS 5.1)) in Windows XP.
Target Platform Desktop
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL <= DISPATCH_LEVEL
DDI compliance rules Irql_Protocol_Driver_Function(ndis)

See also

NdisClCloseCall

NdisClDeregisterSap

NdisClOpenAddressFamilyEx

ProtocolClCloseAfComplete

ProtocolCmCloseAf

ProtocolCoAfRegisterNotify

ProtocolUnbindAdapterEx