NdisMSetTimer
This function sets a timer to fire after a specified interval, thus running an associated MiniportTimer function 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 NdisMInitializeTimer function. - MillisecondsToDelay
Specifies the interval, in milliseconds, to time out before calling the MiniportTimer function.
Remarks
This function causes the driver-supplied MiniportTimer function, which was associated with the timer object when MiniportInitialize called NdisMInitializeTimer, to run once after the given MillisecondsToDelay expires. Execution of the MiniportTimer function associated with the Timer passed 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 NdisMSetPeriodicTimer function causes the associated MiniportTimer function to be run repeatedly whenever the specified MillisecondsPeriod expires. At the initial call to NdisMSetPeriodicTimer, the timer object is queued until the MillisecondsPeriod expires; then the MiniportTimer function 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 NdisMSetPeriodicTimer and this function. Such a driver is likely to have two MiniportTimer functions with different functionality, each associated with a particular timer object when it is initialized with NdisMInitializeTimer. For example, a MiniportTimer function that runs periodically might poll device state at regular intervals, whereas another MiniportTimer function might retry a particular run-time operation only if it times out on the network adapter.
If a miniport calls this function, NdisMCancelTimer, or NdisMSetPeriodicTimer with the same Timer pointer originally passed to this function before the originally specified MillisecondsToDelay expires, 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 MiniportTimer function 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 MiniportTimer exactly when the specified interval expires.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | Ndis.h | Ndislib.lib |
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
MiniportInitialize, NdisMCancelTimer, NdisMInitializeTimer, NdisMSetPeriodicTimer
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.