Compartilhar via


NdisMSetPeriodicTimer (Compact 2013)

3/26/2014

This function sets a timer to fire periodically, thus running an associated caller-supplied MiniportTimer function repeatedly at fixed intervals.

Syntax

VOID NdisMSetPeriodicTimer(
  PNDIS_MINIPORT_TIMER Timer,
  UINT MillisecondsPeriod
);

Parameters

  • Timer
    [in] Pointer to caller-supplied resident storage for a timer object previously initialized with the NdisMInitializeTimer function.
  • MillisecondsPeriod
    [in] Specifies the interval, in milliseconds, to time out before calling the MiniportTimer function unless the timer is canceled or this interval is reset.

Return Value

None.

Remarks

This function causes the driver-supplied MiniportTimer function, which was associated with the timer object when MiniportInitialize called NdisMInitializeTimer, to be run repeatedly whenever the specified MillisecondsPeriod expires. At the initial call to this function, the timer object is queued until the MillisecondsPeriod expires; then the MiniportTimer function is run, and the timer object is automatically re-queued for the next interval.

By contrast, NdisMSetTimer causes the driver-supplied function associated with a particular timer object to run only once after the given MillisecondsToDelay expires. That is, execution of this function associated with the Timer passed to NdisMSetTimer is episodic, rather than periodic.

As a general rule, a miniport should allocate and initialize two separate timer objects if it calls both this function and NdisMSetTimer. 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 NIC.

If a miniport calls this function, NdisMCancelTimer, or NdisMSetTimer with the same Timer pointer originally passed to this function, the current call cancels its preceding call to this function, possibly resetting the MillisecondsPeriod specified originally. 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 periods does not necessarily cause the execution of the MiniportTimer function exactly when the specified interval expires.

Requirements

Header

ndis.h

Library

ndis.dll

See Also

Reference

NDIS 5.x Legacy Functions
MiniportTimer
NdisMInitializeTimer
MiniportInitialize
NdisMSetTimer
NdisMCancelTimer