VOID
ProtocolOpenAdapterComplete(
IN NDIS_HANDLE ProtocolBindingContext,
IN NDIS_STATUS Status,
IN NDIS_STATUS OpenErrorStatus
);
ProtocolOpenAdapterComplete is a required driver function that completes processing of a binding operation for which NdisOpenAdapter returned NDIS_STATUS_PENDING.
The underlying NIC driver returns NDIS_STATUS_ADAPTER_NOT_READY for any
requests it receives while the open operation is pending. After
ProtocolOpenAdapterComplete returns control, the underlying driver cannot
return this status.
When NdisOpenAdapter returns NDIS_STATUS_PENDING to the DriverEntry or ProtocolBindAdapter function of an NDIS protocol driver, NDIS calls that driver’s ProtocolOpenAdapterComplete function when the asynchronous binding operation is complete.
If the input Status is NDIS_STATUS_SUCCESS, ProtocolOpenAdapterComplete carries out whatever driver-determined per-binding operations its DriverEntry or ProtocolBindAdapter function would have done in a synchronous binding operation.
If the driver has a ProtocolBindAdapter function, ProtocolOpenAdapterComplete calls NdisCompleteBindAdapter with NDIS_STATUS_SUCCESS for the Status and OpenStatus arguments and with the BindContext handle stored at ProtocolBindingContext by the ProtocolBindAdapter function. Then, ProtocolOpenAdapterComplete returns control.
Otherwise, ProtocolOpenAdapterComplete cleans up any per-binding state already set up by DriverEntry or ProtocolBindAdapter. After releasing any state set up by ProtocolBindAdapter except for the BindContext handle, it calls NdisCompleteBindAdapter with an appropriate error for Status and the handle before it returns control.
By default, ProtocolOpenAdapterComplete runs at IRQL PASSIVE_LEVEL in the context of a system thread.
DriverEntry of NDIS Protocol Drivers, NdisCompleteBindAdapter, NdisFreeMemory, NdisOpenAdapter, ProtocolBindAdapter