Source code of Windows XP (NT5)
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.

155 lines
3.1 KiB

  1. #ifndef _GLOBALS_H_
  2. #define _GLOBALS_H_
  3. #include "clusapi.h"
  4. #include "clusutil.h"
  5. #define NAME_LEN 80
  6. #define WM_GOTEVENT WM_USER + 1
  7. #define WM_EXITEVENTTHREAD WM_USER + 2
  8. #define WM_REFRESH WM_USER + 3
  9. // Event Defintions
  10. typedef struct {
  11. DWORD dwCatagory ;
  12. time_t time ;
  13. DWORD dwFilter ;
  14. DWORD dwSubFilter ;
  15. WCHAR szSourceName[NAME_LEN] ;
  16. WCHAR szObjectName[NAME_LEN] ;
  17. } EVTFILTER_TYPE, *PEVTFILTER_TYPE ;
  18. // Event Catagories
  19. #define EVENT_CATAGORY_CLUSTER 1
  20. #define EVENT_CATAGORY_CLUSTER_CONSISTENCY 2
  21. // Event filter definitions
  22. #define EVENT_FILTER 1
  23. #define EVENT_SUBFILTER 2
  24. // Define Distinct Types of Events.
  25. // Events Generated By the clustering system.
  26. struct EVENTDEFINITION {
  27. DWORD_PTR dwCatagory ;
  28. PDWORDTOSTRINGMAP pFilter ;
  29. PDWORDTOSUBSTRINGMAP pSubFilter ;
  30. WCHAR szCatagory [NAME_LEN] ;
  31. WCHAR szFilterPrompt [NAME_LEN] ;
  32. WCHAR szSubFilterPrompt [NAME_LEN] ;
  33. WCHAR szSourceNamePrompt [NAME_LEN] ;
  34. WCHAR szObjectNamePrompt [NAME_LEN] ;
  35. } ;
  36. typedef EVENTDEFINITION *PEVENTDEFINITION ;
  37. struct EVENTTHREADPARAM
  38. {
  39. HWND hWnd ;
  40. CDocument *pDoc ;
  41. WCHAR szSourceName [NAME_LEN] ;
  42. HANDLE hEvent ;
  43. } ;
  44. extern CPtrList ptrlstEventDef ;
  45. // Clustering Related
  46. extern EVENTDEFINITION aClusEventDefinition ;
  47. // For Cluster Consistency Checks.
  48. #define EVENT_FILTER_CONSISTENCY 1
  49. // -1 in any of the following stands for any value
  50. #define SCHEDULE_SUNDAY 1
  51. #define SCHEDULE_MONDAY 2
  52. #define SCHEDULE_TUESDAY 4
  53. #define SCHEDULE_WEDNESDAY 8
  54. #define SCHEDULE_THURSDAY 16
  55. #define SCHEDULE_FRIDAY 32
  56. #define SCHEDULE_SATURDAY 64
  57. // Action Type definitions.
  58. #define SCHEDULE_ACTION_COMMAND 1
  59. struct SCHEDULE_TIMEINFO
  60. {
  61. int iYear ;
  62. int iMonth ;
  63. int iDay ;
  64. int iHour ;
  65. int iMin ;
  66. int iSec ;
  67. int iWeekDay ;
  68. CTime ctime ;
  69. } ;
  70. struct SCHEDULE_EVENTINFO
  71. {
  72. DWORD_PTR dwCatagory ;
  73. DWORD_PTR dwFilter ;
  74. DWORD_PTR dwSubFilter ; // online or Offline or Fail or Pause
  75. WCHAR szSourceName [NAME_LEN] ;
  76. WCHAR szObjectName [NAME_LEN] ;
  77. } ;
  78. struct SCHEDULE_ACTIONINFO
  79. {
  80. DWORD_PTR dwActionType ;
  81. CString stParam ;
  82. } ;
  83. struct SCHEDULE_INFO
  84. {
  85. CTime minTime ;
  86. CPtrList lstTimeInfo ; // List of SCHEDULE_TIMEINFO
  87. CPtrList lstEventInfo ; // List of SCHEDULE_EVENTINFO
  88. CPtrList lstActionInfo ; // List of SCHEDULE_ACTIONINFO
  89. } ;
  90. extern DWORDTOSTRINGMAP aAction [] ;
  91. //extern CTime minTime ;
  92. extern HWND hScheduleWnd ;
  93. extern UINT_PTR nIDTimer ;
  94. extern CPtrList ptrlstSInfo ;
  95. // For the modeless dialog to display the event list
  96. LPCWSTR GetType (DWORD_PTR dwCatagory, DWORD_PTR dwCode) ;
  97. LPCWSTR GetSubType (DWORD_PTR dwCatagory, DWORD dwCode, DWORD dwSubCode) ;
  98. extern PEVENTDEFINITION GetEventDefinition (DWORD_PTR dwType) ;
  99. // Functions defined in schedule.cpp
  100. extern AddSchedule () ;
  101. extern ModifySchedule (SCHEDULE_INFO *pSOldInfo) ;
  102. extern ScheduleInit () ;
  103. extern void ScheduleDeInit() ;
  104. extern void ResetTimer () ;
  105. extern void FreeEventList (CPtrList &ptrlst) ;
  106. extern void FreeActionList (CPtrList &ptrlst) ;
  107. extern void FreeTimeList (CPtrList &ptrlst) ;
  108. void ComputeAbsoluteTime (SCHEDULE_INFO *pSInfo) ;
  109. #endif // _GLOBALS_H_