ProtocolCloseAdapterComplete

VOID
    ProtocolCloseAdapterComplete(

        IN NDIS_HANDLE  ProtocolBindingContext,
        IN NDIS_STATUS  Status
       
);

ProtocolCloseAdapterComplete is a required driver function that completes processing for an unbinding operation for which NdisCloseAdapter returned NDIS_STATUS_PENDING.

Parameters

ProtocolBindingContext
Specifies the handle to a protocol-allocated context area in which the protocol driver maintains per-binding runtime state. The driver supplied this handle when it called NdisOpenAdapter.
Status
Indicates the final status of the close operation in the underlying driver.

Comments

NDIS delays calling ProtocolCloseAdapterComplete until every request pending on the binding has completed. When ProtocolCloseAdapterComplete is called, the NdisBindingHandle originally returned by NdisOpenAdapter is no longer valid. ProtocolCloseAdapterComplete cannot call any NdisXxx function that requires this handle as a parameter.

ProtocolCloseAdapterComplete releases all resources the driver allocated for per-binding network I/O operations before it returns control.

If the driver has a ProtocolUnbindAdapter function, ProtocolCloseAdapterComplete must call NdisCompleteUnbindAdapter with the BindHandle saved in the ProtocolBindingContext area by ProtocolUnbindAdapter. Consequently, ProtocolCloseAdapterComplete should not release the driver-allocated context area until it has called NdisCompleteUnbindAdapter.

By default, ProtocolCloseAdapterComplete runs at IRQL PASSIVE_LEVEL in the context of a system thread.

See Also

NdisCloseAdapter, NdisCompleteUnbindAdapter, NdisFreeBufferPool, NdisFreeMemory, NdisFreePacketPool, NdisOpenAdapter, ProtocolUnbindAdapter