Microsoft Windows CE 3.0  

ProtocolUnbindAdapter

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

ProtocolUnbindAdapteris a required function to support Plug and Play.

VOID
ProtocolUnbindAdapter(
OUT PNDIS_STATUS
Status, 
IN NDIS_HANDLE
ProtocolBindingContext, 
IN NDIS_HANDLE
UnbindContext
);

Parameters

Status
Specifies the status of the unbinding operation as the value returned by NdisCloseAdapter, which can be either of the following:
NDIS_STATUS_SUCCESS
The binding was closed and all resources pertaining to that binding have been released.
NDIS_STATUS_PENDING
The request is being handled asynchronously, and the ProtocolCloseAdapterCompletefunction will complete the operation.
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.
UnbindContext
Specifies a handle, supplied by NDIS, that the protocol passes subsequently to NdisCompleteUnbindAdapter.

Comments

As the reciprocal of ProtocolBindAdapter, ProtocolUnbindAdapterreleases all resources the driver allocated for per-binding network I/O operations with one possible exception: the driver-allocated context area designated by the ProtocolBindingContexthandle.

ProtocolUnbindAdaptermust call NdisCloseAdapter, which can, in turn, call the driver's ProtocolCloseAdapterCompletefunction with the ProtocolBindingContexthandle, so ProtocolUnbindAdaptercannot free the memory at ProtocolBindingContextunless NdisCloseAdapterreturns NDIS_STATUS_SUCCESS.

Consequently, ProtocolUnbindAdaptershould store the input UnbindContexthandle in the area at ProtocolBindingContextbefore it calls NdisCloseAdapter. If this call is completed asynchronously, the ProtocolCloseAdapterCompletefunction will free all driver-allocated per-binding resources and call NdisCompleteUnbindAdapterwith the UnbindContexthandle.

If NdisCloseAdapterreturns NDIS_STATUS_SUCCESS, ProtocolUnbindAdapterfrees all per-binding resources, including the driver-allocated memory at ProtocolBindingContext, and calls NdisCompleteUnbindAdapteritself.

The ProtocolUnbindAdapterfunction of an NDIS intermediate driver makes a reciprocal call to NdisIMDeinitializeDeviceInstance. Such a driver's MiniportHaltfunction must release all driver-allocated resources associated with the intermediate driver's network adapter before its virtual network adapter is removed from the system.

As soon as ProtocolUnbindAdaptercalls NdisCloseAdapter, the NdisBindingHandleoriginally returned by NdisOpenAdaptershould be considered invalid. ProtocolUnbindAdaptercannot make any subsequent calls to Ndis XXXfunctions with this handle, and the protocol cannot receive any indications from the underlying driver. However, if the underlying network adapter is being removed to be reconfigured, NDIS will call the driver's ProtocolBindAdapterfunction to re-establish the binding when the network adapter is available again.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h   Ndislib.lib
Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

NdisCloseAdapter, NdisIMDeinitializeDeviceInstance, MiniportHalt, NdisOpenAdapter, NdisCloseAdapter, ProtocolBindAdapter, ProtocolCloseAdapterComplete