Partager via


NdisCloseAdapterEx (Compact 7)

3/12/2014

A protocol driver calls this 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
    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:

Value Meaning

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 it calls NdisCloseAdapterEx.

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

Requirements

Header

ndis.h

See Also

Reference

NDIS Functions for Protocol Drivers
NdisOpenAdapterEx
NdisUnbindAdapter
ProtocolBindAdapterEx
ProtocolCloseAdapterCompleteEx
ProtocolUnbindAdapterEx