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.

160 lines
4.9 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1993 **/
  4. /**********************************************************************/
  5. /*
  6. ftpdata.h
  7. Extensible object definitions for the WINS Server's counter
  8. objects & counters.
  9. FILE HISTORY:
  10. Pradeepb 20-July-1993 Created.
  11. */
  12. #ifndef _WINSDATA_H_
  13. #define _WINSDATA_H_
  14. //
  15. // This structure is used to ensure the first counter is properly
  16. // aligned. Unfortunately, since PERF_COUNTER_BLOCK consists
  17. // of just a single DWORD, any LARGE_INTEGERs that immediately
  18. // follow will not be aligned properly.
  19. //
  20. // In our case, the counters that follow are of type DWORD, so we do not
  21. // need to pad. The total number of bytes in the buffer returned to perflib
  22. // *has* to be a multiple of 8 otherwise perflib is going to log an
  23. // event in the application log indicating that the dll needs to be fixed.
  24. // Perflib requires buffer data returned to be 8 byte aligned because it
  25. // concatenates the data from multiple dlls. *Ideally, perflib should be
  26. // doing the padding before concatenating*. Since WINS
  27. // has an odd number of counters (there are 15 counters) and
  28. // PerfCounterBlock is DWORD, we should not pad the WINS_DATA_COUNTER_BLOCK.
  29. // if we do, the length will become 732 and so it will not be a multiple of
  30. // 8
  31. //
  32. // This structure requires "natural" packing & alignment (probably
  33. // quad-word, especially on Alpha). Ergo, keep it out of the
  34. // #pragma pack(4) scope below.
  35. //
  36. typedef struct _WINSDATA_COUNTER_BLOCK
  37. {
  38. PERF_COUNTER_BLOCK PerfCounterBlock;
  39. // DWORD DummyEntryForAlignmentPurposesOnly;
  40. } WINSDATA_COUNTER_BLOCK;
  41. //
  42. // The routines that load these structures assume that all fields
  43. // are DWORD packed & aligned.
  44. //
  45. #pragma pack(4)
  46. //
  47. // Offsets within a PERF_COUNTER_BLOCK.
  48. //
  49. #define WINSDATA_UNIQUE_REGISTRATIONS_OFFSET sizeof(WINSDATA_COUNTER_BLOCK)
  50. #define WINSDATA_GROUP_REGISTRATIONS_OFFSET \
  51. (WINSDATA_UNIQUE_REGISTRATIONS_OFFSET + sizeof(DWORD))
  52. #define WINSDATA_TOTAL_REGISTRATIONS_OFFSET \
  53. (WINSDATA_GROUP_REGISTRATIONS_OFFSET + sizeof(DWORD))
  54. #define WINSDATA_UNIQUE_REFRESHES_OFFSET \
  55. (WINSDATA_TOTAL_REGISTRATIONS_OFFSET + sizeof(DWORD))
  56. #define WINSDATA_GROUP_REFRESHES_OFFSET \
  57. (WINSDATA_UNIQUE_REFRESHES_OFFSET + sizeof(DWORD))
  58. #define WINSDATA_TOTAL_REFRESHES_OFFSET \
  59. (WINSDATA_GROUP_REFRESHES_OFFSET + sizeof(DWORD))
  60. #define WINSDATA_RELEASES_OFFSET \
  61. (WINSDATA_TOTAL_REFRESHES_OFFSET + sizeof(DWORD))
  62. #define WINSDATA_QUERIES_OFFSET \
  63. (WINSDATA_RELEASES_OFFSET + sizeof(DWORD))
  64. #define WINSDATA_UNIQUE_CONFLICTS_OFFSET \
  65. (WINSDATA_QUERIES_OFFSET + sizeof(DWORD))
  66. #define WINSDATA_GROUP_CONFLICTS_OFFSET \
  67. (WINSDATA_UNIQUE_CONFLICTS_OFFSET + sizeof(DWORD))
  68. #define WINSDATA_TOTAL_CONFLICTS_OFFSET \
  69. (WINSDATA_GROUP_CONFLICTS_OFFSET + sizeof(DWORD))
  70. #define WINSDATA_SUCC_RELEASES_OFFSET \
  71. (WINSDATA_TOTAL_CONFLICTS_OFFSET + sizeof(DWORD))
  72. #define WINSDATA_FAIL_RELEASES_OFFSET \
  73. (WINSDATA_SUCC_RELEASES_OFFSET + sizeof(DWORD))
  74. #define WINSDATA_SUCC_QUERIES_OFFSET \
  75. (WINSDATA_FAIL_RELEASES_OFFSET + sizeof(DWORD))
  76. #define WINSDATA_FAIL_QUERIES_OFFSET \
  77. (WINSDATA_SUCC_QUERIES_OFFSET + sizeof(DWORD))
  78. #define WINSDATA_SIZE_OF_PERFORMANCE_DATA \
  79. (WINSDATA_FAIL_QUERIES_OFFSET + sizeof(DWORD))
  80. //
  81. // The counter structure returned.
  82. //
  83. //
  84. // If the number of counters is odd, do not use DWORD alignment in
  85. // WINSDATA_COUNTER_BLOCK, otherwise, use it. See comment near the
  86. // definition of the above structure to get more info.
  87. //
  88. typedef struct _WINSDATA_DATA_DEFINITION
  89. {
  90. PERF_OBJECT_TYPE ObjectType;
  91. PERF_COUNTER_DEFINITION UniqueReg;
  92. PERF_COUNTER_DEFINITION GroupReg;
  93. PERF_COUNTER_DEFINITION TotalReg;
  94. PERF_COUNTER_DEFINITION UniqueRef;
  95. PERF_COUNTER_DEFINITION GroupRef;
  96. PERF_COUNTER_DEFINITION TotalRef;
  97. PERF_COUNTER_DEFINITION Releases;
  98. PERF_COUNTER_DEFINITION Queries;
  99. PERF_COUNTER_DEFINITION UniqueCnf;
  100. PERF_COUNTER_DEFINITION GroupCnf;
  101. PERF_COUNTER_DEFINITION TotalCnf;
  102. PERF_COUNTER_DEFINITION SuccReleases;
  103. PERF_COUNTER_DEFINITION FailReleases;
  104. PERF_COUNTER_DEFINITION SuccQueries;
  105. PERF_COUNTER_DEFINITION FailQueries;
  106. } WINSDATA_DATA_DEFINITION;
  107. extern WINSDATA_DATA_DEFINITION WinsDataDataDefinition;
  108. #define NUMBER_OF_WINSDATA_COUNTERS ((sizeof(WINSDATA_DATA_DEFINITION) - \
  109. sizeof(PERF_OBJECT_TYPE)) / \
  110. sizeof(PERF_COUNTER_DEFINITION))
  111. #define WINSDATA_PERFORMANCE_KEY \
  112. TEXT("System\\CurrentControlSet\\Services\\Wins\\Performance")
  113. //
  114. // Restore default packing & alignment.
  115. //
  116. #pragma pack()
  117. #endif // _WINSDATA_H_