NdisMCancelTimer

This function cancels a preceding call to the NdisMSetPeriodicTimer function or cancels the preceding call to the NdisMSetTimer function if the interval specified to NdisMSetTimer has not yet expired.

At a Glance

Header file: Ndis.h
Windows CE versions: 2.0 and later

Syntax

VOID NdisMCancelTimer( IN PNDIS_MINIPORT_TIMER Timer,
OUT PBOOLEAN
TimerCanceled );

Parameters

Timer
Pointer to a timer object, already initialized with the NdisMInitializeTimer function and set with the NdisMSetPeriodicTimer or the NdisMSetTimer function.
TimerCancelled
Pointer to a caller-supplied variable, which this function sets to TRUE if the timer was queued and then canceled, or to FALSE if the timer either was not set or has already fired.

Remarks

All NDIS timer functions operate on an opaque timer object, for which an NIC driver must supply resident storage. The MiniportInitialize function must call NdisMInitializeTimer with a caller-supplied pointer to this storage, thus associating a driver-supplied MiniportTimer function with the timer object. MiniportInitialize must call NdisMInitializeTimer before the driver passes the Timer pointer to any other NDIS timer function.

Drivers of NICs that do not generate interrupts have a polling MiniportTimer function to monitor the NIC state for incoming receives and for send completions.

Calls to the NdisMSetXXXTimer functions insert the timer object in the system timer queue. Calls to this function dequeue the timer object if it is currently queued. Only one instantiation of a particular timer object can be queued at any moment.

A call to this function while the timer object designated by Timer is queued removes the timer object from the queue, thus canceling the execution of the associated MiniportTimer function.

A subsequent call to NdisMSetTimer or NdisMSetPeriodicTimer requeues the timer object so that the MiniportTimer function runs again when the specified interval expires.

A call to this function can occur just after a timer has fired but before the associated MiniportTimer function is run. Usually, MiniportTimer sets a state variable immediately on entry to indicate that it is running. When another miniport function calls this function, it can check such a TimerCancelled variable on return from this call to determine whether its call to this function also canceled execution of MiniportTimer.

A call to this function while MiniportTimer is running has no effect on the execution of MiniportTimer. It continues to run until it returns control.

A driver that calls this function runs at IRQL <= DISPATCH_LEVEL.

SeeAlso

NdisMInitializeTimer, NdisMSetPeriodicTimer, NdisMSetTimer