NdisCloseAdapterEx function

A protocol driver calls the NdisCloseAdapterEx function to release the binding and the resources that were allocated when the driver called the NdisOpenAdapterEx function.

Syntax


NDIS_STATUS NdisCloseAdapterEx(
  _In_ NDIS_HANDLE NdisBindingHandle
);

Parameters

NdisBindingHandle [in]

The handle that NDIS provided at the NdisBindingHandle parameter of NdisOpenAdapterEx. This handle identifies the binding that NDIS should close.

Return value

NdisCloseAdapterEx returns one of the following status values:

Return codeDescription
NDIS_STATUS_SUCCESS

NdisCloseAdapterEx successfully closed the binding to the underlying miniport adapter.

NDIS_STATUS_PENDING

NdisCloseAdapterEx did not complete the close operation and the operation will be completed asynchronously. NDIS calls the protocol driver's ProtocolCloseAdapterCompleteEx function when the operation is complete.

 

Remarks

A protocol driver typically calls NdisCloseAdapterEx from its ProtocolUnbindAdapterEx function. The driver can also call NdisCloseAdapterEx from its ProtocolBindAdapterEx function. For example, if the driver failed to set an OID value after it called NdisOpenAdapterEx, it can call NdisCloseAdapterEx from its ProtocolBindAdapterEx function.

If a protocol driver must close a miniport adapter outside the context of ProtocolUnbindAdapterEx or ProtocolBindAdapterEx, it must call the NdisUnbindAdapter function.

Protocol drivers should wait for all send requests and OID requests that they originated to complete before calling NdisCloseAdapterEx.

As soon as the driver calls NdisCloseAdapterEx, the handle obtained from the NdisOpenAdapterEx function at the NdisBindingHandle parameter becomes invalid.

Requirements

Target platform

Desktop

Version

Supported in NDIS 6.0 and later.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

PASSIVE_LEVEL

DDI compliance rules

Irql_Protocol_Driver_Function

See also

NdisOpenAdapterEx
NdisUnbindAdapter
ProtocolBindAdapterEx
ProtocolCloseAdapterCompleteEx
ProtocolUnbindAdapterEx

 

 

Send comments about this topic to Microsoft

Show: