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.

128 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. service.h
  5. Abstract:
  6. SIS Groveler service headers
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_SERVICE
  14. #define _INC_SERVICE
  15. #if SERVICE
  16. class Service
  17. {
  18. public:
  19. static int start();
  20. static void record_partition_indices();
  21. static void set_max_response_time(
  22. unsigned int max_response_time);
  23. static void checkpoint();
  24. static void report_start();
  25. static bool groveling_paused();
  26. static bool foreground_groveling();
  27. static void suspending_controller();
  28. static void suspending_exhorter();
  29. static bool partition_in_foreground(
  30. int partition_index);
  31. static void set_foreground_batch_in_progress(
  32. int partition_index,
  33. bool value);
  34. static void follow_command();
  35. private:
  36. static void WINAPI control_handler(
  37. DWORD opcode);
  38. static void WINAPI service_main(
  39. DWORD argc,
  40. LPTSTR *argv);
  41. Service() {}
  42. ~Service() {}
  43. enum {num_drive_letters = 26};
  44. static SERVICE_STATUS status;
  45. static SERVICE_STATUS_HANDLE status_handle;
  46. static int num_partitions;
  47. static int partition_indices[num_drive_letters];
  48. static unsigned int max_response_time;
  49. static volatile bool pause_commanded;
  50. static volatile bool grovel_paused;
  51. static volatile bool *full_volume_scan_commanded;
  52. static volatile bool *demarcate_foreground_batch;
  53. static volatile bool *foreground_batch_in_progress;
  54. static volatile bool *foreground_commanded;
  55. static volatile bool *foreground_acknowledged;
  56. static volatile int foreground_count;
  57. static volatile bool controller_suspended;
  58. static volatile bool exhorter_suspended;
  59. };
  60. #define SERVICE_RECORD_PARTITION_INDICES() Service::record_partition_indices();
  61. #define SERVICE_SET_MAX_RESPONSE_TIME(time) Service::set_max_response_time(time);
  62. #define SERVICE_CHECKPOINT() Service::checkpoint();
  63. #define SERVICE_REPORT_START() Service::report_start();
  64. #define SERVICE_GROVELING_PAUSED() Service::groveling_paused()
  65. #define SERVICE_FOREGROUND_GROVELING() Service::foreground_groveling()
  66. #define SERVICE_SUSPENDING_CONTROLLER() Service::suspending_controller()
  67. #define SERVICE_SUSPENDING_EXHORTER() Service::suspending_exhorter()
  68. #define SERVICE_PARTITION_IN_FOREGROUND(part_index) Service::partition_in_foreground(part_index)
  69. #define SERVICE_SET_FOREGROUND_BATCH_IN_PROGRESS(part_index, value) Service::set_foreground_batch_in_progress(part_index, value)
  70. #define SERVICE_FOLLOW_COMMAND() Service::follow_command()
  71. #else // SERVICE
  72. #define SERVICE_RECORD_PARTITION_INDICES()
  73. #define SERVICE_SET_MAX_RESPONSE_TIME(time)
  74. #define SERVICE_CHECKPOINT()
  75. #define SERVICE_REPORT_START()
  76. #define SERVICE_GROVELING_PAUSED() false
  77. #define SERVICE_FOREGROUND_GROVELING() false
  78. #define SERVICE_SUSPENDING_CONTROLLER()
  79. #define SERVICE_SUSPENDING_EXHORTER()
  80. #define SERVICE_PARTITION_IN_FOREGROUND(part_index) false
  81. #define SERVICE_SET_FOREGROUND_BATCH_IN_PROGRESS(part_index, value)
  82. #define SERVICE_FOLLOW_COMMAND()
  83. #endif // SERVICE
  84. #endif /* _INC_SERVICE */