Поделиться через


NdisSetTimerEx function

Note   NDIS 5. x has been deprecated and is superseded by NDIS 6. x. For new NDIS driver development, see Network Drivers Starting with Windows Vista. For information about porting NDIS 5. x drivers to NDIS 6. x, see Porting NDIS 5.x Drivers to NDIS 6.0.

NdisSetTimerEx sets a timer object to fire after a specified interval, thereby passing a context to and running an associated timer function after the timer fires.

Syntax

VOID NdisSetTimerEx(
  _In_ PNDIS_TIMER Timer,
  _In_ UINT        MillisecondsToDelay,
  _In_ PVOID       FunctionContext
);

Parameters

  • Timer [in]
    Pointer to caller-supplied resident storage for a timer object previously initialized with NdisInitializeTimer.

  • MillisecondsToDelay [in]
    Specifies the interval, in milliseconds, to elapse before NdisSetTimerEx calls the associated timer function.

  • FunctionContext [in]
    Pointer to a caller-supplied context to be passed to the associated timer function when it is called.

Return value

None

Remarks

NdisSetTimerEx causes the driver-supplied timer function to run once after the given MillisecondsToDelay expires. This timer function becomes associated with the timer object after NdisInitializeTimer is called. Note that the context at FunctionContext is used when this timer function is called rather than using the default context that was specified during the NdisInitializeTimer call. Execution of this timer function is episodic, rather than periodic. NdisSetTimer or NdisSetTimerEx is called each time the associated timer function should be run.

The following describes the syntax of the driver-supplied timer function:

VOID 
  (*PNDIS_TIMER_FUNCTION)(
    IN PVOID SystemSpecific1,
    IN PVOID FunctionContext,
    IN PVOID SystemSpecific2,
    IN PVOID SystemSpecific3
    );

If an entity calls NdisSetTimer, NdisSetTimerEx or the NdisCancelTimer function with the same Timer pointer that was originally passed to another NdisSetTimerEx call before the originally specified MillisecondsToDelay has expired, the current call cancels the preceding call to NdisSetTimerEx. Any call to NdisSetTimerEx resets the given timer to expire at the interval specified in the most recent call and causes the associated timer function to run when the most recently specified interval has expired.

Timer resolution on the host varies. Consequently, calling NdisSetTimerEx with small time-interval values does not necessarily cause the execution of the timer function to occur exactly when the specified interval expires. The minimum practicable interval to specify on Windows 2000 and later platforms is ten milliseconds.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisSetTimerObjectinstead. Supported for NDIS 5.1 drivers in Windows Vista and Windows XP.

Header

Ndis.h (include Ndis.h)

Library

Ndis.lib

IRQL

<= DISPATCH_LEVEL

See also

NdisCancelTimer

NdisInitializeTimer

NdisSetTimer

 

 

Send comments about this topic to Microsoft