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.

121 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. share.h
  5. Abstract:
  6. SIS Groveler shared data class header
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_SHARE
  14. #define _INC_SHARE
  15. #pragma pack (8)
  16. enum SharedDataField
  17. {
  18. SDF_grovel_time,
  19. SDF_volscan_time,
  20. SDF_extract_time,
  21. SDF_working_time,
  22. SDF_files_hashed,
  23. SDF_files_compared,
  24. SDF_files_merged,
  25. SDF_files_scanned,
  26. SDF_queue_length,
  27. SDF_hash_read_time,
  28. SDF_hash_read_ops,
  29. SDF_compare_read_time,
  30. SDF_compare_read_ops,
  31. SDF_hash_read_estimate,
  32. SDF_compare_read_estimate,
  33. num_shared_data_fields
  34. };
  35. struct SharedDataRecord
  36. {
  37. _TCHAR *driveName;
  38. __int64 fields[num_shared_data_fields];
  39. };
  40. const int max_shared_data_records = 128;
  41. #pragma pack ()
  42. class SharedData
  43. {
  44. public:
  45. SharedData(
  46. int num_records = -1,
  47. _TCHAR **drive_names = 0);
  48. ~SharedData();
  49. int count_of_records() const;
  50. // _TCHAR drive_letter(
  51. // int record_index) const;
  52. __int64 get_value(
  53. int record_index,
  54. SharedDataField field);
  55. void set_value(
  56. int record_index,
  57. SharedDataField field,
  58. __int64 value);
  59. void increment_value(
  60. int record_index,
  61. SharedDataField field,
  62. __int64 value);
  63. bool send_values();
  64. bool receive_values();
  65. bool extract_values(
  66. int *num_records,
  67. SharedDataRecord *records);
  68. private:
  69. int local_num_records;
  70. int *shared_num_records;
  71. SharedDataRecord local_records[max_shared_data_records];
  72. SharedDataRecord *shared_records;
  73. NamedMutex *mutex;
  74. PSID security_identifier;
  75. PACL access_control_list;
  76. SECURITY_ATTRIBUTES security_attributes;
  77. SECURITY_DESCRIPTOR security_descriptor;
  78. bool map_ok;
  79. HANDLE map_handle;
  80. void *map_address;
  81. };
  82. #endif /* _INC_SHARE */