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.

179 lines
5.4 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. fusionfacilities.h
  5. Abstract:
  6. Include file that is included MULTIPLE TIMES to get varying effects
  7. of defining global variables vs. references to those global variables
  8. vs. symbols that you can use when writing output to scope it to
  9. a facility.
  10. Author:
  11. Michael J. Grier (MGrier) 7/28/2000
  12. Revision History:
  13. --*/
  14. //
  15. // NO INCLUSION PROTECTION!!! BY DESIGN!!!
  16. //
  17. // NO PRAGMA ONCE PLEASE!!
  18. //
  19. #if !defined(FUSION_FACILITY_MASK_NAME)
  20. #define FUSION_FACILITY_MASK_NAME(_x) g_FUSION_ ## _x ## _MASK
  21. #endif
  22. #if defined(FUSION_DEFINE_FACILITY_MASK_VARIABLE_DEFS)
  23. #if !defined(FUSION_FACILITY_VARIABLE_DEFS_DEFINED)
  24. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  25. #define FUSION_FACILITY(_facname) DWORD FUSION_FACILITY_MASK_NAME(_facname);
  26. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  27. #define FUSION_FACILITY_VARIABLE_DEFS_DEFINED 1
  28. #else
  29. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  30. #define FUSION_FACILITY(_facname) /* nothing */
  31. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  32. #endif
  33. #elif defined(FUSION_DEFINE_FACILITY_MASK_VARIABLE_ARRAY)
  34. #if !defined(FUSION_FACILITY_MASK_VARIABLE_ARRAY_DEFINED)
  35. #define FUSION_FACILITY_BEFORE_FACILITIES() static const DWORD *s_rgFusionFacilityMasks[] = {
  36. #define FUSION_FACILITY(_facname) &FUSION_FACILITY_MASK_NAME(_facname),
  37. #define FUSION_FACILITY_AFTER_FACILITIES() };
  38. #define FUSION_FACILITY_MASK_VARIABLE_ARRAY_DEFINED 1
  39. #else
  40. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  41. #define FUSION_FACILITY(_facname) /* nothing */
  42. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  43. #endif
  44. #elif defined(FUSION_DEFINE_FACILITY_STRUCTURE)
  45. #if !defined(FUSION_FACILITY_STRUCTURE_DEFINED)
  46. #define FUSION_FACILITY_BEFORE_FACILITIES() class CFusionFacilityList { public:
  47. #define FUSION_FACILITY(_facname) char _facname;
  48. #define FUSION_FACILITY_AFTER_FACILITIES() };
  49. #define FUSION_FACILITY_STRUCTURE_DEFINED 1
  50. #else
  51. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  52. #define FUSION_FACILITY(_facname) /* nothing */
  53. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  54. #endif
  55. #elif defined(FUSION_DEFINE_FACILITY_MASK_VARIABLE_REFS)
  56. #if !defined(FUSION_FACILITY_VARIABLE_REFS_DEFINED)
  57. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  58. #define FUSION_FACILITY(_facname) EXTERN_C DWORD FUSION_FACILITY_MASK_NAME(_facname);
  59. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  60. #define FUSION_FACILITY_VARIABLE_REFS_DEFINED 1
  61. #else
  62. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  63. #define FUSION_FACILITY(_facname) /* nothing */
  64. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  65. #endif
  66. #elif defined(FUSION_DEFINE_FACILITY_CONSTANTS)
  67. #if !defined(FUSION_FACILITY_CONSTANTS_DEFINED)
  68. #define FUSION_DEFINE_FACILITY_STRUCTURE
  69. #include "fusionfacilities.h"
  70. #undef FUSION_DEFINE_FACILITY_STRUCTURE
  71. #undef FUSION_FACILITY_BEFORE_FACILITIES
  72. #undef FUSION_FACILITY
  73. #undef FUSION_FACILITY_AFTER_FACILITIES
  74. #define FUSION_DEFINE_FACILITY_MASK_VARIABLE_REFS
  75. #include "fusionfacilities.h"
  76. #undef FUSION_DEFINE_FACILITY_MASK_VARIABLE_REFS
  77. #undef FUSION_FACILITY_BEFORE_FACILITIES
  78. #undef FUSION_FACILITY
  79. #undef FUSION_FACILITY_AFTER_FACILITIES
  80. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  81. #define FUSION_FACILITY(_facname) const ULONG FUSION_ ## _facname ## _ID = ((ULONG) FIELD_OFFSET(CFusionFacilityList, _facname));
  82. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  83. #define FUSION_FACILITY_CONSTANTS_DEFINED 1
  84. #else
  85. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  86. #define FUSION_FACILITY(_facname) /* nothing */
  87. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  88. #endif
  89. #elif defined(FUSION_DEFINE_FACILITY_DLLMAIN_DEFS)
  90. #if !defined(FUSION_FACILITY_DLLMAIN_DEFS_DEFINED)
  91. #define FUSION_DEFINE_FACILITY_CONSTANTS
  92. #include "fusionfacilities.h"
  93. #undef FUSION_DEFINE_FACILITY_CONSTANTS
  94. #undef FUSION_FACILITY_BEFORE_FACILITIES
  95. #undef FUSION_FACILITY
  96. #undef FUSION_FACILITY_AFTER_FACILITIES
  97. #define FUSION_DEFINE_FACILITY_MASK_VARIABLE_DEFS
  98. #include "fusionfacilities.h"
  99. #undef FUSION_DEFINE_FACILITY_MASK_VARIABLE_DEFS
  100. #undef FUSION_FACILITY_BEFORE_FACILITIES
  101. #undef FUSION_FACILITY
  102. #undef FUSION_FACILITY_AFTER_FACILITIES
  103. #define FUSION_DEFINE_FACILITY_MASK_VARIABLE_ARRAY
  104. #include "fusionfacilities.h"
  105. #undef FUSION_DEFINE_FACILITY_MASK_VARIABLE_ARRAY
  106. #undef FUSION_FACILITY_BEFORE_FACILITIES
  107. #undef FUSION_FACILITY
  108. #undef FUSION_FACILITY_AFTER_FACILITIES
  109. #define FUSION_FACILITY_DLLMAIN_DEFS_DEFINED 1
  110. #endif
  111. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  112. #define FUSION_FACILITY(_facname) /* nothing */
  113. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  114. #else
  115. #define FUSION_DEFINE_FACILITY_CONSTANTS
  116. #include "fusionfacilities.h"
  117. #undef FUSION_DEFINE_FACILITY_CONSTANTS
  118. #undef FUSION_FACILITY_BEFORE_FACILITIES
  119. #undef FUSION_FACILITY
  120. #undef FUSION_FACILITY_AFTER_FACILITIES
  121. #define FUSION_FACILITY_BEFORE_FACILITIES() /* nothing */
  122. #define FUSION_FACILITY(_facname) /* nothing */
  123. #define FUSION_FACILITY_AFTER_FACILITIES() /* nothing */
  124. #endif
  125. //
  126. // Add fusion facility definitions here:
  127. //
  128. FUSION_FACILITY_BEFORE_FACILITIES()
  129. FUSION_FACILITY(HASH_TABLE)
  130. FUSION_FACILITY(DEQUE)
  131. FUSION_FACILITY(STRING_BUFFER)
  132. FUSION_FACILITY(BINDING)
  133. FUSION_FACILITY(POLICY)
  134. FUSION_FACILITY_AFTER_FACILITIES()
  135. #undef FUSION_FACILITY_BEFORE_FACILITIES
  136. #undef FUSION_FACILITY
  137. #undef FUSION_FACILITY_AFTER_FACILITIES