次の方法で共有


ProtocolOpenAdapterComplete (Windows Embedded CE 6.0)

1/6/2010

This function is a required driver function that completes processing of a binding operation for which NdisOpenAdapter returned NDIS_STATUS_PENDING.

Syntax

VOID ProtocolOpenAdapterComplete(
  NDIS_HANDLE ProtocolBindingContext,
  NDIS_STATUS Status,
  NDIS_STATUS OpenErrorStatus
);

Parameters

  • ProtocolBindingContext
    [in] 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
    [in] Specifies the final status of the network adapter driver open operation. 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 network adapter might return a ring error that NDIS forwards to ProtocolOpenAdapterComplete. This parameter can be NULL.

Return Value

The following table shows return values for this function.

Value Description

NDIS_STATUS_SUCCESS

The binding was established or an error status determined by the underlying driver.

NDIS_STATUS_ADAPTER_NOT_READY

Request received while the open operation is pending.

Remarks

If NdisOpenAdapter returns NDIS_STATUS_PENDING to ProtocolBindAdapter, NDIS calls the affected driver's ProtocolOpenAdapterComplete function when the asynchronous binding operation is complete.

If the input Status is NDIS_STATUS_SUCCESS, ProtocolOpenAdapterComplete carries out whatever binding operations the 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.

In any other cases, ProtocolOpenAdapterComplete cleans up any per-binding already set up by ProtocolBindAdapter. After releasing any state set up by ProtocolBindAdapter except for the BindContext handle, it calls NdisCompleteBindAdapter with the handle and an appropriate error for Status before it returns control.

Requirements

Header ndis.h
Library Ndislib.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

NDIS Lower-Edge Functions
NdisCompleteBindAdapter
NdisFreeMemory
NdisOpenAdapter
ProtocolBindAdapter