다음을 통해 공유


NdisSetTimerObject (Compact 2013)

3/26/2014

This function sets a timer object to occur after a specified interval or periodically.

Syntax

BOOLEAN
  NdisSetTimerObject(
    IN NDIS_HANDLE  TimerObject,
    IN LARGE_INTEGER  DueTime,
    IN ULONG  MillisecondsPeriod OPTIONAL,
    IN PVOID  FunctionContext OPTIONAL
    );

Parameters

  • TimerObject
    A handle to a timer object that NDIS provides when a driver calls the NdisAllocateTimerObject function.
  • DueTime
    The absolute or relative time at which the timer is to expire. If the value of the DueTime parameter is negative, the expiration time is in relation to the current system time. Otherwise, the expiration time is absolute. The expiration time is expressed in system time units (100-nanosecond intervals). Absolute expiration times track any changes in the system time; relative expiration times are not affected by system time changes.
  • MillisecondsPeriod
    The periodic time interval, in milliseconds, that elapses between every time that the timer occurs and the next call to the NetTimerCallback function, unless the timer is canceled. The value of this parameter must be less than or equal to MAXLONG.
  • FunctionContext
    A pointer to a caller-supplied context area that NDIS passes to the associated NetTimerCallback function when a timer occurs. If this parameter is NULL, NDIS uses the default value that is specified in the NDIS_TIMER_CHARACTERISTICS structure.

Return Value

NdisSetTimerObject returns TRUE if the timer object was already in the system timer queue; otherwise, it returns FALSE.

Remarks

After a driver calls NdisSetTimerObject, the timer object is queued until the interval that is specified in the DueTime parameter expires. After the interval expires, the timer object is dequeued and the caller-supplied NetTimerCallback function is run once at IRQL = DISPATCH_LEVEL as soon as a processor becomes available.

If a nonzero value is specified in the MillisecondsPeriod parameter, the timer object is queued again until the interval that is specified in MillisecondsPeriodl expires. After this interval expires, the timer object is requeued and the caller-supplied NetTimerCallback function is run once at IRQL = DISPATCH_LEVEL as soon as a processor becomes available.

To cancel a timer, call the NdisCancelTimerObject function.

Requirements

Header

ndis.h

See Also

Reference

NDIS Timer Functions
NDIS_TIMER_CHARACTERISTICS
NdisCancelTimerObject
NdisAllocateTimerObject
NetTimerCallback