Leaked source code of windows server 2003
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.

280 lines
8.6 KiB

  1. /*-----------------------------------------------------------------------------
  2. Microsoft FUSION
  3. Microsoft Confidential
  4. Copyright (c) Microsoft Corporation. All Rights Reserved.
  5. @doc external
  6. @module fusionguiddatatoxxx.h
  7. Macros to convert "guid data", of the
  8. form (3f32766f, 2d94, 444d, bf,32,2f,32,9c,71,d4,08), to all of the various
  9. needed forms:
  10. 3f32766f-2d94-444d-bf32-2f329c71d408 FUSIONP_GUID_DATA_TO_DASHED
  11. '3f32766f-2d94-444d-bf32-2f329c71d408' FUSIONP_GUID_DATA_TO_DASHED_CHAR
  12. "3f32766f-2d94-444d-bf32-2f329c71d408" FUSIONP_GUID_DATA_TO_DASHED_STRING
  13. {3f32766f-2d94-444d-bf32-2f329c71d408} FUSIONP_GUID_DATA_TO_BRACED_DASHED
  14. '{3f32766f-2d94-444d-bf32-2f329c71d408}' FUSIONP_GUID_DATA_TO_BRACED_DASHED_CHAR
  15. "{3f32766f-2d94-444d-bf32-2f329c71d408}" FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING
  16. {0x3f32766f,0x2d94,0x444d,{0xbf,0x32,0x2f,0x32,0x9c,0x71,0xd4,0x08}} FUSIONP_GUID_DATA_TO_STRUCT_INITIALIZER
  17. @owner JayKrell
  18. -----------------------------------------------------------------------------*/
  19. #if !defined(FUSIONP_GUID_DATA_TO_XXX_H_INCLUDED_)
  20. #define FUSIONP_GUID_DATA_TO_XXX_H_INCLUDED_
  21. /*#pragma once ends up in .rgi, which is bad, so do not do it*/
  22. #include "fusionpreprocessorpaste.h"
  23. #include "fusionpreprocessorstringize.h"
  24. #include "fusionpreprocessorcharize.h"
  25. /*-----------------------------------------------------------------------------
  26. I need to investigate more, but present usage is:
  27. FUSIONP_GUID_DATA_TO_DASHED_STRING : __declpec(uuid())
  28. FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING : also works with__declpec(uuid())
  29. FUSIONP_GUID_DATA_TO_BRACED_DASHED : in .rgs files (unquoted)
  30. FUSIONP_GUID_DATA_TO_STRUCT_INITIALIZER : would be used in .ctc files
  31. FUSIONP_GUID_DATA_TO_BRACED_DASHED_CHAR : used in .rgs files (quoted)
  32. -----------------------------------------------------------------------------*/
  33. /*-----------------------------------------------------------------------------
  34. Name: FUSIONP_GUID_DATA_TO_STRUCT_INITIALIZER
  35. @macro
  36. This macro does like:
  37. FUSIONP_GUID_DATA_TO_STRUCT_INITIALIZER(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  38. -> { 0x80f3e6ba, 0xd9b2, 0x4c41, { 0xae, 0x90, 0x63, 0x93, 0xda, 0xce, 0xac, 0x2a } }
  39. The parameters are hex constants without 0x on them.
  40. They must be exactly 8, 4, and 2 digits wide.
  41. They must include leading zeros.
  42. @owner JayKrell
  43. -----------------------------------------------------------------------------*/
  44. #define \
  45. FUSIONP_GUID_DATA_TO_STRUCT_INITIALIZER\
  46. ( \
  47. dwData1, \
  48. wData2, \
  49. wData3, \
  50. bData4_0, \
  51. bData4_1, \
  52. bData4_2, \
  53. bData4_3, \
  54. bData4_4, \
  55. bData4_5, \
  56. bData4_6, \
  57. bData4_7 \
  58. ) \
  59. { \
  60. FusionpPreprocessorPaste2(0x, dwData1), \
  61. FusionpPreprocessorPaste2(0x, wData2), \
  62. FusionpPreprocessorPaste2(0x, wData3), \
  63. { \
  64. FusionpPreprocessorPaste2(0x, bData4_0), \
  65. FusionpPreprocessorPaste2(0x, bData4_1), \
  66. FusionpPreprocessorPaste2(0x, bData4_2), \
  67. FusionpPreprocessorPaste2(0x, bData4_3), \
  68. FusionpPreprocessorPaste2(0x, bData4_4), \
  69. FusionpPreprocessorPaste2(0x, bData4_5), \
  70. FusionpPreprocessorPaste2(0x, bData4_6), \
  71. FusionpPreprocessorPaste2(0x, bData4_7) \
  72. } \
  73. }
  74. /*-----------------------------------------------------------------------------
  75. Name: FUSIONP_GUID_DATA_TO_DASHED
  76. @macro
  77. This macro does like:
  78. FUSIONP_GUID_DATA_TO_DASHED(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  79. -> 80f3e6ba-d9b2-4c41-ae90-6393daceac2a
  80. The parameters are hex constants without 0x on them.
  81. They must be exactly 8, 4, and 2 digits wide.
  82. They must include leading zeros.
  83. @owner JayKrell
  84. -----------------------------------------------------------------------------*/
  85. #define \
  86. FUSIONP_GUID_DATA_TO_DASHED\
  87. ( \
  88. dwData1, \
  89. wData2, \
  90. wData3, \
  91. bData4_0, \
  92. bData4_1, \
  93. bData4_2, \
  94. bData4_3, \
  95. bData4_4, \
  96. bData4_5, \
  97. bData4_6, \
  98. bData4_7 \
  99. ) \
  100. FusionpPreprocessorPaste15(dwData1,-,wData2,-,wData3,-,bData4_0,bData4_1,-,bData4_2,bData4_3,bData4_4,bData4_5,bData4_6,bData4_7)
  101. // without braces
  102. /*-----------------------------------------------------------------------------
  103. Name: FUSIONP_GUID_DATA_TO_DASHED_STRING
  104. @macro
  105. FUSIONP_GUID_DATA_TO_DASHED_STRING(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  106. -> "80f3e6ba-d9b2-4c41-ae90-6393daceac2a"
  107. The parameters are hex constants without 0x on them.
  108. They must be exactly 8, 4, and 2 digits wide.
  109. They must include leading zeros.
  110. @owner JayKrell
  111. -----------------------------------------------------------------------------*/
  112. #define \
  113. FUSIONP_GUID_DATA_TO_DASHED_STRING\
  114. ( \
  115. dw1, \
  116. w2, \
  117. w3, \
  118. b0, \
  119. b1, \
  120. b2, \
  121. b3, \
  122. b4, \
  123. b5, \
  124. b6, \
  125. b7 \
  126. ) \
  127. FusionpPreprocessorStringize(FUSIONP_GUID_DATA_TO_DASHED(dw1,w2,w3,b0,b1,b2,b3,b4,b5,b6,b7))
  128. /*-----------------------------------------------------------------------------
  129. Name: FUSIONP_GUID_DATA_TO_DASHED_CHAR
  130. @macro
  131. FUSIONP_GUID_DATA_TO_DASHED_CHAR(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  132. -> '80f3e6ba-d9b2-4c41-ae90-6393daceac2a'
  133. The parameters are hex constants without 0x on them.
  134. They must be exactly 8, 4, and 2 digits wide.
  135. They must include leading zeros.
  136. @owner JayKrell
  137. -----------------------------------------------------------------------------*/
  138. #define \
  139. FUSIONP_GUID_DATA_TO_DASHED_CHAR\
  140. ( \
  141. dw1, \
  142. w2, \
  143. w3, \
  144. b0, \
  145. b1, \
  146. b2, \
  147. b3, \
  148. b4, \
  149. b5, \
  150. b6, \
  151. b7 \
  152. ) \
  153. FusionpPreprocessorCharize(FUSIONP_GUID_DATA_TO_DASHED(dw1,w2,w3,b0,b1,b2,b3,b4,b5,b6,b7))
  154. // with braces
  155. /*-----------------------------------------------------------------------------
  156. Name: FUSIONP_GUID_DATA_TO_BRACED_DASHED
  157. @macro
  158. FUSIONP_GUID_DATA_TO_BRACED_DASHED(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  159. -> {80f3e6ba-d9b2-4c41-ae90-6393daceac2a}
  160. The parameters are hex constants without 0x on them.
  161. They must be exactly 8, 4, and 2 digits wide.
  162. They must include leading zeros.
  163. @owner JayKrell
  164. -----------------------------------------------------------------------------*/
  165. #define \
  166. FUSIONP_GUID_DATA_TO_BRACED_DASHED\
  167. ( \
  168. dw1, \
  169. w2, \
  170. w3, \
  171. b0, \
  172. b1, \
  173. b2, \
  174. b3, \
  175. b4, \
  176. b5, \
  177. b6, \
  178. b7 \
  179. ) \
  180. FusionpPreprocessorPaste3({,FUSIONP_GUID_DATA_TO_DASHED(dw1,w2,w3,b0,b1,b2,b3,b4,b5,b6,b7),})
  181. /*-----------------------------------------------------------------------------
  182. Name: FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING
  183. @macro
  184. FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  185. -> "{80f3e6ba-d9b2-4c41-ae90-6393daceac2a}"
  186. The parameters are hex constants without 0x on them.
  187. They must be exactly 8, 4, and 2 digits wide.
  188. They must include leading zeros.
  189. @owner JayKrell
  190. -----------------------------------------------------------------------------*/
  191. #define \
  192. FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING\
  193. ( \
  194. dw1, \
  195. w2, \
  196. w3, \
  197. b0, \
  198. b1, \
  199. b2, \
  200. b3, \
  201. b4, \
  202. b5, \
  203. b6, \
  204. b7 \
  205. ) \
  206. FusionpPreprocessorStringize(FUSIONP_GUID_DATA_TO_BRACED_DASHED(dw1,w2,w3,b0,b1,b2,b3,b4,b5,b6,b7))
  207. /*-----------------------------------------------------------------------------
  208. Name: FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING_W
  209. @macro
  210. FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING_W(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  211. -> L"{80f3e6ba-d9b2-4c41-ae90-6393daceac2a}"
  212. The parameters are hex constants without 0x on them.
  213. They must be exactly 8, 4, and 2 digits wide.
  214. They must include leading zeros.
  215. @owner JayKrell
  216. -----------------------------------------------------------------------------*/
  217. #define FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING_W(dw1, w2, w3, b0, b1, b2, b3, b4, b5, b6, b7) \
  218. FusionpPreprocessorPaste(L, FUSIONP_GUID_DATA_TO_BRACED_DASHED_STRING(dw1, w2, w3, b0, b1, b2, b3, b4, b5, b6, b7))
  219. /*-----------------------------------------------------------------------------
  220. Name: FUSIONP_GUID_DATA_TO_BRACED_DASHED_CHAR
  221. @macro
  222. FUSIONP_GUID_DATA_TO_BRACED_DASHED_CHAR(80f3e6ba, d9b2, 4c41, ae,90,63,93,da,ce,ac,2a)
  223. -> '{80f3e6ba-d9b2-4c41-ae90-6393daceac2a}'
  224. The parameters are hex constants without 0x on them.
  225. They must be exactly 8, 4, and 2 digits wide.
  226. They must include leading zeros.
  227. @owner JayKrell
  228. -----------------------------------------------------------------------------*/
  229. #define \
  230. FUSIONP_GUID_DATA_TO_BRACED_DASHED_CHAR\
  231. ( \
  232. dw1, \
  233. w2, \
  234. w3, \
  235. b0, \
  236. b1, \
  237. b2, \
  238. b3, \
  239. b4, \
  240. b5, \
  241. b6, \
  242. b7 \
  243. ) \
  244. FusionpPreprocessorCharize(FUSIONP_GUID_DATA_TO_BRACED_DASHED(dw1,w2,w3,b0,b1,b2,b3,b4,b5,b6,b7))
  245. #endif /* FUSIONP_GUID_DATA_TO_XXX_H_INCLUDED_ */