NdisMSleep function

The NdisMSleep function delays execution of the caller for a given interval in microseconds.

Syntax


VOID NdisMSleep(
  _In_ ULONG MicrosecondsToSleep
);

Parameters

MicrosecondsToSleep [in]

The number of microseconds to delay.

Return value

None

Remarks

For the given time in the MicrosecondsToSleep parameter, the caller's thread of execution is put into a wait state, thereby allowing other threads to get work done on the current processor. When the given interval expires, the caller of NdisMSleep resumes execution.

An NDIS driver should always call NdisMSleep in preference to the NdisStallExecution function unless the driver is running at IRQL >= DISPATCH_LEVEL. NdisMSleep can accept a larger delay interval than NdisStallExecution, which should never be called with an interval greater than 50 microseconds.

Miniport drivers can call NdisMSleep from their MiniportInitializeEx and, possibly, MiniportHaltEx functions when either function must wait for state changes to occur in the NIC before that function continues its operations.

Both NdisMSleep and NdisStallExecution allow a miniport driver to specify a delay consistently and independently of the clock speed of the host CPU. Neither function involves a timer object such as those that are used by the NdisSetTimerObject function. The resolution of the host system clock varies, so very short delays can take slightly longer than the delay time that the caller of NdisMSleep or NdisStallExecution specified.

Requirements

Target platform

Universal

Version

Supported for NDIS 6.0 and NDIS 5.1 drivers (see NdisMSleep (NDIS 5.1)) in Windows Vista. Supported for NDIS 5.1 drivers (see NdisMSleep (NDIS 5.1)).

Header

Ndis.h (include Ndis.h)

IRQL

< DISPATCH_LEVEL

DDI compliance rules

Irql_Miniport_Driver_Function

See also

MiniportHaltEx
MiniportInitializeEx
NetTimerCallback
NdisSetTimerObject
NdisStallExecution
NdisWaitEvent

 

 

Send comments about this topic to Microsoft

Show:
© 2015 Microsoft