MacCloseAdapter

NDIS_STATUS
    MacCloseAdapter(
        IN NDIS_HANDLE  MacBindingHandle
        );

MacCloseAdapter is called when a protocol driver releases a binding with NdisCloseAdapter.

Parameters

MacBindingHandle
Specifies the handle that the NIC driver associates with the binding.

Return Value

MacCloseAdapter can return the following status codes:

NDIS_STATUS_CLOSING
NDIS_STATUS_PENDING
NDIS_STATUS_SUCCESS

Comments

Because several protocol drivers can have open bindings to the same NIC, the NIC driver keeps a reference count of open handles. If any requests remain on a binding when a protocol driver calls NdisCloseAdapter, the function returns NDIS_STATUS_PENDING, regardless of the state of the network interface card.

MacCloseAdapter terminates a network interface card binding, cleaning up the state the driver maintains about that binding, such as decrementing the NIC driver’s count of open handles, and releasing the resources allocated when that binding was set up by MacOpenAdapter, unless MacCloseAdapter must handle the close as an asynchronous operation.

If MacCloseAdapter finishes the close operation, it returns a status code other than NDIS_STATUS_PENDING.

Otherwise, MacCloseAdapter handles the close as an asynchronous operation and returns NDIS_STATUS_PENDING. For example, the following circumstances should cause MacCloseAdapter to handle a close asynchronously:

For asynchronous closes, the NIC driver eventually calls NdisCompleteCloseAdapter, which calls the ProtocolCloseAdapterComplete function of the driver that initiated the close. Asynchronous completion allows the ProtocolCloseAdapterComplete function to perform any necessary postprocessing of the NIC close request.

After the NIC driver has closed a binding, a protocol driver cannot submit further requests on that binding. In fact, a protocol driver cannot call any NdisXxx function with a binding handle that it already passed to NdisCloseAdapter.

MacCloseAdapter runs at IRQL DISPATCH_LEVEL.

See Also

EthDeleteFilterOpenAdapter, FddiDeleteFilterOpenAdapter, MacOpenAdapter, NdisCloseAdapter, NdisCompleteCloseAdapter, NdisReset, ProtocolCloseAdapterComplete, ProtocolStatus, TrDeleteFilterOpenAdapter