OPEN_ADAPTER_COMPLETE_HANDLER callback function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

The ProtocolOpenAdapterComplete function is required. This function completes the processing of a binding operation for which NdisOpenAdapter returned NDIS_STATUS_PENDING.

Syntax

OPEN_ADAPTER_COMPLETE_HANDLER ProtocolOpenAdapterComplete;

VOID ProtocolOpenAdapterComplete(
  _In_ NDIS_HANDLE ProtocolBindingContext,
  _In_ NDIS_STATUS Status,
  _In_ NDIS_STATUS OpenErrorStatus
)
{ ... }

Parameters

  • ProtocolBindingContext [in]
    Specifies the handle to a protocol-allocated context area in which the protocol driver maintains per-binding run-time state. The driver supplied this handle when it called NdisOpenAdapter.

  • Status [in]
    Specifies the final status of the NIC driver open operation, either NDIS_STATUS_SUCCESS if the binding was established or an error status determined by the underlying driver.

    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.

  • OpenErrorStatus [in]
    Specifies additional information about the reason for a failure if the value at Status is not NDIS_STATUS_SUCCESS and if the underlying driver supplied this information. For example, the driver of a Token Ring NIC might return a ring error that NDIS forwards to ProtocolOpenAdapterComplete. This parameter can be NULL.

Return value

None

Remarks

When NdisOpenAdapter returns NDIS_STATUS_PENDING to the 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 ProtocolBindAdapter function would have done in a synchronous binding operation. Next, 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 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.

Requirements

Target platform

Desktop

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use ProtocolOpenAdapterCompleteExinstead. Supported for NDIS 5.1 drivers in Windows Vista and Microsoft Windows XP

Header

Ndis.h (include Ndis.h)

IRQL

PASSIVE_LEVEL

See also

DriverEntry of NDIS Protocol Drivers

NdisCompleteBindAdapter

NdisFreeMemory

NdisOpenAdapter

ProtocolBindAdapter

 

 

Send comments about this topic to Microsoft