NdisIMSwitchToMiniport (Windows CE 5.0)

Send Feedback

This function allows an intermediate driver function to call NdisMXXX functions that are normally called only from MiniportXXX functions, as, for example, to make indications to higher-level protocols.

BOOLEAN NdisIMSwitchToMiniport(
IN NDIS_HANDLE MiniportAdapterHandle, OUT PNDIS_HANDLE SwitchHandle );

Parameters

  • MiniportAdapterHandle
    Handle input to the MiniportInitialize function.
  • SwitchHandle
    Pointer to a variable in which this function returns a handle if the call succeeds.

Return Values

Returns TRUE if the caller can safely call miniport-only NdisMXXX functions until it makes a reciprocal call to NdisIMRevertBack.

Remarks

An intermediate driver must make indications to higher-level protocols as if from a network adapter driver's MiniportXXX functions. Attempts to simply forward indications to bound protocols directly from an intermediate driver function that receives them cause deadlocks.

For example, after a successful call to this function, the ProtocolXXX function of an NDIS intermediate driver can safely call NdisMXXX functions commonly called from the MiniportHandleInterrupt or MiniportTimer functions of underlying network adapter drivers. In particular, such a ProtocolXXX function can call NdisMXXX functions, such as NdisMIndicateReceivePacket or NdisMIndicateStatus, that indicate to higher-level protocols bound to the intermediate driver's virtual network adapter.

After a successful call to this function, an intermediate driver should call NdisIMRevertBack as quickly as possible. Until it calls NdisIMRevertBack, the execution of such a ProtocolXXX function prevents other MiniportXXX functions in the same driver from running.

If this function returns FALSE, the intermediate driver should call the NdisIMQueueMiniportCallback function. The MiniportCallback function passed to NdisIMQueueMiniportCallback should do essentially the same work as the caller's miniport-only code would have done if its call to this function had succeeded. That is, such a MiniportCallback function replaces the miniport-only code bracketed by calls to this function and NdisIMRevertBack, as well as setting up sufficient state to communicate with the non-miniport code paths of the intermediate driver.

If an NDIS intermediate driver has internal functions called by both its ProtocolXXX and MiniportXXX functions, such an internal driver function cannot call this function, NdisIMRevertBack, or NdisIMQueueMiniportCallback. A call to any of these NdisIMXXX functions from a MiniportXXX code path is a fatal error.

Note   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.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
Link Library: Ndis.lib

See Also

DriverEntry | MiniportCancelSendPackets | MiniportCheckForHang | MiniportHalt | MiniportInitialize | MiniportQueryInformation | MiniportReset | MiniportReturnPacket | MiniportReturnPacket | MiniportSend | MiniportSendPackets | MiniportSetInformation | MiniportShutdown | MiniportTransferData | MiniportWanSend | NdisIMInitializeDeviceInstance | NdisMInitializeWrapper | NdisMRegisterAdapterShutdownHandler | NdisOpenAdapter | NdisRegisterProtocol | ProtocolBindAdapter | ProtocolUnbindAdapter

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.