Microsoft Windows CE 3.0  

NdisIMSwitchToMiniport

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.

This function allows an intermediate driver function to call NdisM XXXfunctions that are normally called only from Miniport XXXfunctions, 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 MiniportInitializefunction.
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 NdisM XXXfunctions until it makes a reciprocal call to NdisIMRevertBack.

Remarks

An intermediate driver must make indications to higher-level protocols as if from an NIC driver's Miniport XXXfunctions. 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 Protocol XXXfunction of an NDIS intermediate driver can safely call NdisM XXXfunctions commonly called from the MiniportHandleInterruptor MiniportTimerfunctions of underlying NIC drivers. In particular, such a Protocol XXXfunction can call NdisM XXXfunctions, such as NdisMIndicateReceivePacketor NdisMIndicateStatus, that indicate to higher-level protocols bound to the intermediate driver's virtual NIC.

After a successful call to this function, an intermediate driver should call NdisIMRevertBackas quickly as possible. Until it calls NdisIMRevertBack, the execution of such a Protocol XXXfunction prevents other Miniport XXXfunctions in the same driver from running.

If this function returns FALSE, the intermediate driver should call the NdisIMQueueMiniportCallbackfunction. The MiniportCallbackfunction passed to NdisIMQueueMiniportCallbackshould 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 MiniportCallbackfunction replaces the miniport-only code bracketed by calls to this function and NdisIMRevertBack, as well as setting up sufficient state to communicate with the nonminiport code paths of the intermediate driver.

If an NDIS intermediate driver has internal functions called by both its Protocol XXXand Miniport XXXfunctions, such an internal driver function cannot call this function, NdisIMRevertBack, or NdisIMQueueMiniportCallback. A call to any of these NdisIM XXXfunctions from a Miniport XXXcode path is a fatal error.

A driver that calls this function runs at IRQL <= DISPATCH_LEVEL.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 2.0 and later Ndis.h    
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

NdisIMRevertBack, NdisMEthIndicateReceive, NdisMIndicateReceivePacket, NdisMIndicateStatus



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.