Windows NT 4.0 source code leak
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.

89 lines
2.4 KiB

4 years ago
  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. CTETimer VxdTimer ;
  29. LIST_ENTRY Linkage;
  30. PVOID Context;
  31. PVOID Context2;
  32. COMPLETIONROUTINE CompletionRoutine;
  33. PVOID ClientContext;
  34. COMPLETIONCLIENT ClientCompletion;
  35. PVOID pCacheEntry; // entry in Remote or local cache
  36. ULONG DeltaTime;
  37. // this is set by the completionroutine to tell the timing system to
  38. // restart the timer again, as opposed to disposing of the timer
  39. USHORT Flags;
  40. USHORT Retries; // number of times to restart the timer
  41. UCHAR RefCount; // to tell if the timer is expiring or not
  42. }tTIMERQENTRY;
  43. // Flag bits for tTIMERQENTRY
  44. #define TIMER_RESTART 0x0001
  45. // to differentiate the broadcast timeouts from the timouts to the Name Service
  46. #define TIMER_MNODEBCAST 0x0002
  47. #define TIMER_DOING_EXPIRY 0x0004
  48. #define TIMER_NOT_STARTED 0x0008
  49. #define TIMER_RETIMED 0x0010 // timeout has changed, restart timer without any processing
  50. // The timer Q itself
  51. typedef struct
  52. {
  53. DEFINE_LOCK_STRUCTURE( SpinLock )
  54. LIST_ENTRY ActiveHead;
  55. LIST_ENTRY FreeHead;
  56. } tTIMERQ;
  57. //
  58. // Function Prototype - this function is only called locally to this file
  59. //
  60. //
  61. // TimerExpiry routine - Called by kernel upon timer expiration. Note that
  62. // DeferredContext is the only argument used and must be named/used the
  63. // same between NT and WFW.
  64. //
  65. VOID
  66. TimerExpiry(
  67. #ifndef VXD
  68. IN PKDPC Dpc,
  69. IN PVOID DeferredContext,
  70. IN PVOID SystemArg1,
  71. IN PVOID SystemArg2
  72. #else
  73. IN CTEEvent * pCTEEvent,
  74. IN PVOID DeferredContext
  75. #endif
  76. ) ;
  77. #endif