Compartir a través de


NdisInitializeTimer 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.

NdisInitializeTimer initializes a timer object associated with a driver's timer function.

Syntax

VOID NdisInitializeTimer(
  _Inout_  PNDIS_TIMER          Timer,
  _In_     PNDIS_TIMER_FUNCTION TimerFunction,
  _In_opt_ PVOID                FunctionContext
);

Parameters

  • Timer [in, out]
    Pointer to caller-supplied, resident storage that receives a timer object.

  • TimerFunction [in]
    Specifies the entry point of a caller-supplied timer function that is called when the timer expires. The following describes the syntax of this timer function:

     VOID 
       (*PNDIS_TIMER_FUNCTION)(
         IN PVOID SystemSpecific1,
         IN PVOID FunctionContext,
         IN PVOID SystemSpecific2,
         IN PVOID SystemSpecific3
         );
    
  • FunctionContext [in, optional]
    Pointer to a caller-supplied context to be passed to the specified timer function when it is called.

Return value

None

Remarks

A protocol driver might request that NDIS provide timing services. To request timing services, this protocol driver calls NdisInitializeTimer to set up the driver's timer function. Typically, NdisInitializeTimer is called when a driver initializes. The protocol driver must call NdisInitializeTimer with a caller-supplied pointer to store a timer object, thereby associating a driver-supplied timer function with the timer object. The protocol driver must call NdisInitializeTimer before the driver passes the Timer pointer to any other Ndis..Timer function.

Calls to the NdisSetTimer function insert the timer object in the system timer queue. Calls to NdisCancelTimer dequeue the timer object if it is currently queued. Only one instance of a particular timer object can be queued at any given moment.

After a driver calls NdisSetTimer, the timer object at Timer is queued until the interval specified in the call expires. After the interval expires, the timer object is dequeued and the caller-supplied TimerFunction is run once at IRQL = DISPATCH_LEVEL as soon as a processor becomes available.

Requirements

Target platform

Universal

Version

Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisAllocateTimerObjectinstead. 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

NdisSetTimer

 

 

Send comments about this topic to Microsoft