Share via


NdisMSleep (NDIS 5.1) function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

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

Syntax

VOID NdisMSleep(
  _In_ ULONG MicrosecondsToSleep
);

Parameters

  • MicrosecondsToSleep [in]
    Specifies the number of microseconds to delay.

Return value

None

Remarks

For the given MicrosecondsToSleep, 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 NdisStallExecution 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.

NIC drivers can call NdisMSleep from their MiniportInitialize and, possibly, MiniportHalt 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 NIC driver to specify a delay consistently and independently of the clock speed of the host CPU. Neither function involves a timer object used by NdisSetTimer or NdisSetPeriodicTimer. The resolution of the host system clock varies, so very short delays can take slightly longer than the caller of NdisMSleep or NdisStallExecution specified.

Requirements

Target platform

Universal

Version

See NdisMSleep.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

< DISPATCH_LEVEL

See also

MiniportHalt

MiniportInitialize

MiniportTimer

NdisMSetTimer

NdisMSetPeriodicTimer

NdisStallExecution

NdisWaitEvent

 

 

Send comments about this topic to Microsoft