Share via


NdisMSleep (Compact 2013)

3/26/2014

This function delays execution of the caller for a specified interval, in microseconds.

Syntax

VOID NdisMSleep(
  ULONG MicrosecondsToSleep
);

Parameters

  • MicrosecondsToSleep
    [in] Specifies 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. This allows for 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 network adapter 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

Header

ndis.h

Library

ndis.dll

See Also

Reference

NDIS Delay Interface
MiniportHaltEx
MiniportInitializeEx
NetTimerCallback
NdisSetTimerObject
NdisStallExecution
NdisWaitEvent
NdisStallExecution