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.

461 lines
9.1 KiB

  1. /**********************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1987-1999 **/
  4. /**********************************************************************/
  5. /*
  6. midlnode.hxx
  7. MIDL Constants for Type Graph
  8. This class introduces constants used throughout the type graph.
  9. */
  10. /*
  11. FILE HISTORY :
  12. VibhasC 28-Aug-1990 Created.
  13. DonnaLi 17-Oct-1990 Split midltype.hxx off rpctypes.hxx.
  14. DonnaLi 11-Dec-1990 Changed to midlnode.hxx.
  15. */
  16. #ifndef __MIDLNODE_HXX__
  17. #define __MIDLNODE_HXX__
  18. /****************************************************************************
  19. * definitions
  20. ****************************************************************************/
  21. #include "common.hxx"
  22. //
  23. // node decriptor mask
  24. //
  25. /**
  26. ** they are broken into groups, and there is an array of names in
  27. ** front\attrnode.cxx
  28. **/
  29. typedef enum _attr_t
  30. {
  31. ATTR_NONE
  32. ,ATTR_FIRST
  33. ,ATTR_LAST
  34. ,ATTR_LENGTH
  35. ,ATTR_MIN
  36. ,ATTR_MAX
  37. ,ATTR_SIZE
  38. ,ATTR_RANGE
  39. ,ATTR_CASE
  40. ,ATTR_FUNCDESCATTR
  41. ,ATTR_IDLDESCATTR
  42. ,ATTR_TYPEDESCATTR
  43. ,ATTR_VARDESCATTR
  44. ,ATTR_TYPE
  45. ,ATTR_MEMBER
  46. ,REDUNDANT_ATTR_END = ATTR_MEMBER
  47. // attributes which may not be duplicated
  48. ,ATTR_ID
  49. ,ATTR_HELPCONTEXT
  50. ,ATTR_HELPSTRINGCONTEXT
  51. ,ATTR_LCID
  52. ,ATTR_DLLNAME
  53. ,ATTR_HELPSTRING
  54. ,ATTR_HELPFILE
  55. ,ATTR_HELPSTRINGDLL
  56. ,ATTR_ENTRY
  57. ,ATTR_GUID
  58. ,ATTR_ASYNCUUID
  59. ,ATTR_VERSION
  60. ,ATTR_SWITCH_IS
  61. ,ATTR_IID_IS
  62. ,ATTR_DEFAULTVALUE
  63. /*
  64. * type attributes other than
  65. * <usage_attributes>
  66. * <inline/outofline_attributes>
  67. * <heap_attribute>
  68. */
  69. ,ATTR_TRANSMIT
  70. ,ATTR_WIRE_MARSHAL
  71. ,ATTR_REPRESENT_AS
  72. ,ATTR_CALL_AS
  73. // last attribute that may not be duplicated
  74. ,NO_DUPLICATES_END = ATTR_CALL_AS
  75. ,ATTR_CUSTOM
  76. ,ATTR_SWITCH_TYPE
  77. ,ATTR_HANDLE
  78. ,ATTR_USER_MARSHAL
  79. ,ATTR_MS_UNION
  80. ,ATTR_MS_CONF_STRUCT
  81. ,ATTR_V1_ENUM
  82. // <usage_attributes> from idl
  83. ,ATTR_FLCID
  84. ,ATTR_HIDDEN
  85. ,ATTR_PTR_KIND
  86. ,ATTR_STRING
  87. ,ATTR_BSTRING
  88. /*
  89. * interface attributes other than
  90. * <pointer_attributes>
  91. * <code/nocode_attributes>
  92. * <inline/outofline_attributes>
  93. */
  94. ,ATTR_ENDPOINT
  95. ,ATTR_LOCAL
  96. ,ATTR_OBJECT
  97. /*
  98. * field attributes other than
  99. * <usage_attributes>
  100. * <pointer_attributes>
  101. */
  102. ,ATTR_IGNORE
  103. ,ATTR_UNUSED1 //was ATTR_OPAQUE
  104. /*
  105. * operation attributes other than
  106. * <usage_attributes>
  107. * <pointer_attributes>
  108. * <code/nocode_attributes>
  109. * <comm_status_attribute>
  110. */
  111. ,ATTR_IDEMPOTENT
  112. ,ATTR_BROADCAST
  113. ,ATTR_MAYBE
  114. ,ATTR_ASYNC
  115. ,ATTR_INPUTSYNC
  116. ,ATTR_BYTE_COUNT
  117. ,ATTR_CALLBACK
  118. ,ATTR_MESSAGE
  119. /*
  120. * param attributes other than
  121. * <comm_status_attribute>
  122. * <heap_attribute>
  123. */
  124. ,ATTR_IN
  125. ,ATTR_OUT
  126. ,ATTR_PARTIAL_IGNORE
  127. // attribute on base types
  128. ,ATTR_DEFAULT
  129. // acf attributes
  130. ,ACF_ATTR_START
  131. ,ATTR_CONTEXT = ACF_ATTR_START
  132. ,ATTR_CODE
  133. ,ATTR_NOCODE
  134. ,ATTR_OPTIMIZE
  135. ,ATTR_COMMSTAT
  136. ,ATTR_FAULTSTAT
  137. ,ATTR_ALLOCATE
  138. ,ATTR_HEAP
  139. ,ATTR_IMPLICIT
  140. ,ATTR_EXPLICIT
  141. ,ATTR_AUTO
  142. ,ATTR_PTRSIZE
  143. ,ATTR_NOTIFY
  144. ,ATTR_NOTIFY_FLAG
  145. ,ATTR_ENABLE_ALLOCATE
  146. ,ATTR_ENCODE
  147. ,ATTR_DECODE
  148. ,ATTR_STRICT_CONTEXT_HANDLE
  149. ,ATTR_NOSERIALIZE
  150. ,ATTR_SERIALIZE
  151. ,ATTR_FORCEALLOCATE
  152. /*
  153. * international character support attributes
  154. */
  155. ,ATTR_DRTAG
  156. ,ATTR_RTAG
  157. ,ATTR_STAG
  158. ,ATTR_CSCHAR
  159. ,ATTR_CSTAGRTN
  160. ,ACF_ATTR_END
  161. // end of acf attributes
  162. /** Temp padding has been introduced to bunch all the new attributes together */
  163. ,ATTR_CPORT_ATTRIBUTES_START = ACF_ATTR_END
  164. ,ATTR_EXTERN = ATTR_CPORT_ATTRIBUTES_START
  165. ,ATTR_STATIC
  166. ,ATTR_AUTOMATIC
  167. ,ATTR_REGISTER
  168. ,ATTR_FAR
  169. ,ATTR_NEAR
  170. ,ATTR_MSCUNALIGNED
  171. ,ATTR_HUGE
  172. ,ATTR_PASCAL
  173. ,ATTR_FORTRAN
  174. ,ATTR_CDECL
  175. ,ATTR_STDCALL
  176. ,ATTR_LOADDS
  177. ,ATTR_SAVEREGS
  178. ,ATTR_FASTCALL
  179. ,ATTR_SEGMENT
  180. ,ATTR_INTERRUPT
  181. ,ATTR_SELF
  182. ,ATTR_EXPORT
  183. ,ATTR_CONST
  184. ,ATTR_VOLATILE
  185. ,ATTR_BASE
  186. ,ATTR_UNSIGNED
  187. ,ATTR_SIGNED
  188. ,ATTR_PROC_CONST
  189. ,ATTR_C_INLINE // c compiler _inline
  190. ,ATTR_RPC_FAR
  191. ,ATTR_TAGREF
  192. ,ATTR_DLLIMPORT
  193. ,ATTR_DLLEXPORT
  194. ,ATTR_W64
  195. ,ATTR_PTR32
  196. ,ATTR_PTR64
  197. ,ATTR_DECLSPEC_ALIGN
  198. ,ATTR_DECLSPEC_UNKNOWN
  199. ,ATTR_CPORT_ATTRIBUTES_END = ATTR_PTR64
  200. ,ATTR_END = ATTR_CPORT_ATTRIBUTES_END
  201. } ATTR_T;
  202. #define MODIFIER_BITS ( ATTR_CPORT_ATTRIBUTES_END - ATTR_CPORT_ATTRIBUTES_START )
  203. #define MAX_ATTR_SUMMARY_ELEMENTS 3
  204. #define ATTR_VECTOR_SIZE (MAX_ATTR_SUMMARY_ELEMENTS)
  205. typedef unsigned long ATTR_SUMMARY[ATTR_VECTOR_SIZE];
  206. typedef ATTR_SUMMARY ATTR_VECTOR;
  207. // array of pointers to attributes
  208. class node_base_attr;
  209. typedef node_base_attr * ATTR_POINTER_VECTOR[ ACF_ATTR_END ];
  210. #define SetModifierBit(A) ( (A)<ATTR_CPORT_ATTRIBUTES_START ? 0 : \
  211. ((unsigned __int64) 1) \
  212. << ((A) - ATTR_CPORT_ATTRIBUTES_START) )
  213. #define SET_ATTR(Array, A) ( (Array)[(A) / 32UL] |= (1UL << ((A) % 32UL)) )
  214. #define RESET_ATTR(Array, A) ( (Array)[(A) / 32UL] &= ~(1UL << ((A) % 32UL)) )
  215. #define IS_ATTR(Array, A) ( (Array)[(A) / 32UL] & (1UL << ((A) % 32UL)) )
  216. BOOL COMPARE_ATTR( ATTR_VECTOR &, ATTR_VECTOR & );
  217. void OR_ATTR( ATTR_VECTOR &, ATTR_VECTOR & );
  218. void XOR_ATTR( ATTR_VECTOR &, ATTR_VECTOR & );
  219. inline void
  220. AND_ATTR( ATTR_VECTOR & A1, ATTR_VECTOR & A2 )
  221. {
  222. A1[0] &= A2[0];
  223. A1[1] &= A2[1];
  224. #if MAX_ATTR_SUMMARY_ELEMENTS > 2
  225. A1[2] &= A2[2];
  226. #if MAX_ATTR_SUMMARY_ELEMENTS > 3
  227. A1[3] &= A2[3];
  228. #endif
  229. #endif
  230. }
  231. inline void
  232. COPY_ATTR( ATTR_VECTOR & A1, ATTR_VECTOR & A2 )
  233. {
  234. A1[0] = A2[0];
  235. A1[1] = A2[1];
  236. #if MAX_ATTR_SUMMARY_ELEMENTS > 2
  237. A1[2] = A2[2];
  238. #if MAX_ATTR_SUMMARY_ELEMENTS > 3
  239. A1[3] = A2[3];
  240. #endif
  241. #endif
  242. }
  243. inline void
  244. MASKED_COPY_ATTR( ATTR_VECTOR & A1, ATTR_VECTOR & A2, ATTR_VECTOR & M )
  245. {
  246. A1[0] = A2[0] & M[0];
  247. A1[1] = A2[1] & M[1];
  248. #if MAX_ATTR_SUMMARY_ELEMENTS > 2
  249. A1[2] = A2[2] & M[2];
  250. #if MAX_ATTR_SUMMARY_ELEMENTS > 3
  251. A1[3] = A2[3] & M[3];
  252. #endif
  253. #endif
  254. }
  255. inline BOOL IS_CLEAR_ATTR( ATTR_VECTOR & A)
  256. {
  257. return (BOOL) (
  258. ( A[0] | A[1]
  259. #if MAX_ATTR_SUMMARY_ELEMENTS > 2
  260. | A[2]
  261. #if MAX_ATTR_SUMMARY_ELEMENTS > 3
  262. | A[3]
  263. #endif
  264. #endif
  265. ) == 0);
  266. }
  267. void CLEAR_ATTR( ATTR_VECTOR &);
  268. void SET_ALL_ATTR( ATTR_VECTOR &);
  269. ATTR_T CLEAR_FIRST_SET_ATTR ( ATTR_VECTOR & );
  270. typedef enum _tattr_t
  271. {
  272. TATTR_BEGIN,
  273. TATTR_PUBLIC = TATTR_BEGIN,
  274. TATTR_APPOBJECT,
  275. TATTR_CONTROL,
  276. TATTR_DUAL,
  277. TATTR_LICENSED,
  278. TATTR_NONEXTENSIBLE,
  279. TATTR_OLEAUTOMATION,
  280. TATTR_NONCREATABLE,
  281. TATTR_AGGREGATABLE,
  282. TATTR_PROXY,
  283. TATTR_END = TATTR_OLEAUTOMATION
  284. } TATTR_T;
  285. typedef enum _mattr_t
  286. {
  287. MATTR_BEGIN,
  288. MATTR_READONLY = MATTR_BEGIN,
  289. MATTR_SOURCE,
  290. MATTR_BINDABLE,
  291. MATTR_DISPLAYBIND,
  292. MATTR_DEFAULTBIND,
  293. MATTR_REQUESTEDIT,
  294. MATTR_PROPGET,
  295. MATTR_PROPPUT,
  296. MATTR_PROPPUTREF,
  297. MATTR_RESTRICTED,
  298. MATTR_OPTIONAL,
  299. MATTR_RETVAL,
  300. MATTR_VARARG,
  301. MATTR_PREDECLID,
  302. MATTR_UIDEFAULT,
  303. MATTR_NONBROWSABLE,
  304. MATTR_DEFAULTCOLLELEM,
  305. MATTR_DEFAULTVTABLE,
  306. MATTR_IMMEDIATEBIND,
  307. MATTR_USESGETLASTERROR,
  308. MATTR_REPLACEABLE,
  309. MATTR_END = MATTR_PREDECLID
  310. } MATTR_T;
  311. ///////////////////////////////////////////////////////////////////////////////
  312. enum _edge_t
  313. {
  314. EDGE_DEF
  315. ,EDGE_USE
  316. };
  317. typedef _edge_t EDGE_T;
  318. //
  319. // Note: type lib generator has a table that depends on the order of node_t enums.
  320. // Please modify rgMapBaseTypeToVARTYPE in tlgen.cxx when you add a base node.
  321. //
  322. enum node_t
  323. {
  324. NODE_ILLEGAL = 0
  325. ,BASE_NODE_START = 1
  326. ,NODE_FLOAT = BASE_NODE_START
  327. ,NODE_DOUBLE
  328. ,NODE_FLOAT80
  329. ,NODE_FLOAT128
  330. ,NODE_HYPER
  331. ,NODE_INT64
  332. ,NODE_INT128
  333. ,NODE_INT3264
  334. ,NODE_INT32
  335. ,NODE_LONG
  336. ,NODE_LONGLONG
  337. ,NODE_SHORT
  338. ,NODE_INT
  339. ,NODE_SMALL
  340. ,NODE_CHAR
  341. ,NODE_BOOLEAN
  342. ,NODE_BYTE
  343. ,NODE_VOID
  344. ,NODE_HANDLE_T
  345. ,NODE_FORWARD
  346. ,NODE_WCHAR_T
  347. ,BASE_NODE_END
  348. ,INTERNAL_NODE_START = BASE_NODE_END
  349. // constructed types
  350. ,NODE_STRUCT = INTERNAL_NODE_START
  351. ,NODE_UNION
  352. ,NODE_ENUM
  353. ,NODE_LABEL
  354. ,NODE_PIPE
  355. // midl compiler internal representation node types
  356. ,NODE_PROC
  357. ,NODE_PARAM
  358. ,NODE_FIELD
  359. ,NODE_DEF
  360. ,NODE_ID
  361. ,NODE_FILE
  362. ,NODE_INTERFACE
  363. ,NODE_ECHO_STRING
  364. ,NODE_E_STATUS_T
  365. ,NODE_INTERFACE_REFERENCE
  366. ,NODE_PIPE_INTERFACE
  367. ,NODE_HREF
  368. ,NODE_LIBRARY
  369. ,NODE_MODULE
  370. ,NODE_DISPINTERFACE
  371. ,NODE_ASYNC_HANDLE
  372. ,NODE_DECL_GUID
  373. ,NODE_COCLASS
  374. ,NAMED_NODE_END = NODE_COCLASS
  375. ,NODE_POINTER
  376. ,NODE_ARRAY
  377. ,NODE_SAFEARRAY
  378. ,NODE_SOURCE
  379. ,NODE_ERROR
  380. ,NODE_MIDL_PRAGMA
  381. ,INTERNAL_NODE_END
  382. // attribute node types
  383. };
  384. typedef node_t NODE_T;
  385. //
  386. // useful macros
  387. //
  388. #define IS_BASE_TYPE_NODE( t ) ((t >= BASE_NODE_START) && (t < BASE_NODE_END))
  389. #define IS_NAMED_NODE( t ) (t <= NAMED_NODE_END)
  390. #endif // __MIDLNODE_HXX__