Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.8 KiB

  1. //
  2. //
  3. // timer.h
  4. //
  5. // This file contains the typedefinitions for the timer code
  6. #ifndef __TIMERNBT_H
  7. #define __TIMERNBT_H
  8. // to convert a millisecond time to 100ns time
  9. //
  10. #define MILLISEC_TO_100NS 10000
  11. // the completion routine that the client must define
  12. typedef
  13. VOID
  14. (*COMPLETIONROUTINE)(
  15. IN PVOID, // context
  16. IN PVOID, // context2
  17. IN PVOID); // timerqentry
  18. typedef
  19. VOID
  20. (*COMPLETIONCLIENT)(
  21. IN PVOID,
  22. IN NTSTATUS);
  23. // Timer Queue Entry - this entry looks after a timer event. It tracks who
  24. // should be called when the timeout occurs, the time in the future of the
  25. // timout, and a context value.
  26. typedef struct
  27. {
  28. LIST_ENTRY Linkage;
  29. ULONG Verify;
  30. USHORT Retries; // number of times to restart the timer
  31. BOOLEAN fIsWakeupTimer;
  32. UCHAR RefCount; // to tell if the timer is expiring or not
  33. ULONG DeltaTime;
  34. PVOID *pDeviceContext;
  35. COMPLETIONROUTINE TimeoutRoutine;
  36. PVOID Context;
  37. PVOID Context2;
  38. PVOID ClientContext;
  39. COMPLETIONCLIENT ClientCompletion;
  40. PVOID pCacheEntry; // entry in Remote or local cache
  41. HANDLE WakeupTimerHandle;
  42. CTETimer VxdTimer ;
  43. USHORT Flags; // to tell the timing system to restart the timer again
  44. }tTIMERQENTRY;
  45. // Flag bits for tTIMERQENTRY
  46. #define TIMER_RESTART 0x0001
  47. // to differentiate the broadcast timeouts from the timouts to the Name Service
  48. #define TIMER_MNODEBCAST 0x0002
  49. #define TIMER_DOING_EXPIRY 0x0004
  50. #define TIMER_NOT_STARTED 0x0008
  51. #define TIMER_RETIMED 0x0010 // timeout has changed, restart timer without any processing
  52. // The timer Q itself
  53. typedef struct
  54. {
  55. LIST_ENTRY ActiveHead;
  56. NPAGED_LOOKASIDE_LIST LookasideList;
  57. BOOLEAN TimersInitialized;
  58. } tTIMERQ;
  59. //
  60. // Function Prototype - this function is only called locally to this file
  61. //
  62. //
  63. // TimerExpiry routine - Called by kernel upon timer expiration. Note that
  64. // DeferredContext is the only argument used and must be named/used the
  65. // same between NT and WFW.
  66. //
  67. VOID
  68. TimerExpiry(
  69. #ifndef VXD
  70. IN PKDPC Dpc,
  71. IN PVOID DeferredContext,
  72. IN PVOID SystemArg1,
  73. IN PVOID SystemArg2
  74. #else
  75. IN CTEEvent * pCTEEvent,
  76. IN PVOID DeferredContext
  77. #endif
  78. ) ;
  79. //
  80. // ExpireTimer routine - Called to stop the current timer and call
  81. // the Timeout routine
  82. //
  83. VOID
  84. ExpireTimer(
  85. IN tTIMERQENTRY *pTimerEntry,
  86. IN CTELockHandle *OldIrq1
  87. );
  88. #endif