Microsoft Windows CE 3.0  

NdisMSetTimer

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 sets a timer to fire after a specified interval, thus running an associated MiniportTimerfunction when the timer fires.

VOID NdisMSetTimer(
IN PNDIS_MINIPORT_TIMER
Timer
,
IN UINT
MillisecondsToDelay
);

Parameters

Timer
Pointer to caller-supplied resident storage for a timer object previously initialized with the NdisMInitializeTimerfunction.
MillisecondsToDelay
Specifies the interval, in milliseconds, to time out before calling the MiniportTimerfunction.

Remarks

This function causes the driver-supplied MiniportTimerfunction, which was associated with the timer object when MiniportInitializecalled NdisMInitializeTimer, to run once after the given MillisecondsToDelayexpires. Execution of the MiniportTimerfunction associated with the Timerpassed to this function is episodic, rather than periodic. A miniport must call this function each time the associated timer function should be run.

By contrast, the NdisMSetPeriodicTimerfunction causes the associated MiniportTimerfunction to be run repeatedly whenever the specified MillisecondsPeriodexpires. At the initial call to NdisMSetPeriodicTimer, the timer object is queued until the MillisecondsPeriodexpires; then the MiniportTimerfunction is run, and the timer object is automatically requeued for the next interval.

Generally, a miniport should allocate and initialize two timer objects if it calls both NdisMSetPeriodicTimerand this function. Such a driver is likely to have two MiniportTimerfunctions with different functionality, each associated with a particular timer object when it is initialized with NdisMInitializeTimer. For example, a MiniportTimerfunction that runs periodically might poll device state at regular intervals, whereas another MiniportTimerfunction might retry a particular run-time operation only if it times out on the NIC.

If a miniport calls this function, NdisMCancelTimer, or NdisMSetPeriodicTimerwith the same Timerpointer originally passed to this function before the originally specified MillisecondsToDelayexpires, the current call cancels its preceding call to this function. Any call to an NDIS timer function resets the specified timer to expire at the interval specified in the most recent call and causes the associated MiniportTimerfunction to run when the most recently specified interval has expired.

Timer resolution on the host varies. Consequently, calling this function with very small time-out values does not necessarily cause the execution of MiniportTimerexactly when the specified interval expires.

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

NdisMCancelTimer, NdisMInitializeTimer, NdisMSetPeriodicTimer



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.