NdisMSleep function (ndis.h)

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

Syntax

void NdisMSleep(
  [in] ULONG MicrosecondsToSleep
);

Parameters

[in] MicrosecondsToSleep

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. Do not call NdisMSleep with a timeout of more than 30,000,000 microseconds (that is, 30 seconds or half a minute).

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

Requirement Value
Minimum supported client 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)).
Target Platform Universal
Header ndis.h (include Ndis.h)
Library Ndis.lib
IRQL < DISPATCH_LEVEL
DDI compliance rules Irql_Miniport_Driver_Function(ndis)

See also

MiniportHaltEx

MiniportInitializeEx

NdisSetTimerObject

NdisStallExecution

NdisWaitEvent

NetTimerCallback