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.

321 lines
8.5 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1989-1999 Microsoft Corporation
  3. Module Name:
  4. optprop.hxx
  5. Abstract:
  6. Definitions of properties.
  7. Notes:
  8. History:
  9. Sep-10-1993 VibhasC Created.
  10. ----------------------------------------------------------------------------*/
  11. /****************************************************************************
  12. * include files
  13. ***************************************************************************/
  14. #ifndef __OPTPROP_HXX__
  15. #define __OPTPROP_HXX__
  16. #include "nulldefs.h"
  17. extern "C"
  18. {
  19. #include <stdio.h>
  20. }
  21. #include "cgcommon.hxx"
  22. /////////////////////////////////////////////////////////////////////////////
  23. // ZP_VS_NDR related property descriptors.
  24. /////////////////////////////////////////////////////////////////////////////
  25. //
  26. // These properties help determine the kind of marshalling or unmarshalling
  27. // code that needs to be produced. Usually determines if a memcopy can be used
  28. // or not for marshalling.
  29. //
  30. typedef unsigned long ZP_VS_NDR;
  31. //
  32. // the zp vs ndr property is unknown, probably un-inited.
  33. //
  34. #define ZP_VS_NDR_UNKNOWN 0
  35. //
  36. // the zp is perfect relative to the ndr. In case of conformant structures
  37. // this property means that the structure is perfect including the conformant
  38. // part of the array.
  39. //
  40. #define ZP_VS_NDR_OK 1
  41. //
  42. // the zp of the structure is perfect, except for the conformant part of the
  43. // structure.
  44. //
  45. #define ZP_VS_NDR_OK_WO_CONF 2
  46. //
  47. // The layout of this structure is completely hopeless as compared to the ndr
  48. // This is possible if the structure is packed differently in memory and its
  49. // memory layout is completely out of whack w.r.t the ndr. This implies that
  50. // the marshalling will have to be done member by member.
  51. //
  52. #define ZP_VS_NDR_HOPELESS 4
  53. /////////////////////////////////////////////////////////////////////////////
  54. // embedded pointer chase property descriptors.
  55. /////////////////////////////////////////////////////////////////////////////
  56. typedef unsigned long PTR_CHASE;
  57. //
  58. // The un-initialized kind of pointer chase.
  59. //
  60. #define PTR_CHASE_UNKNOWN 0
  61. //
  62. // This property specifies that the structure has an embedded pointer which
  63. // points to a simple type or a simple structure etc. This helps figure out
  64. // if we generate an out of line routine or a simple inlining is possible.
  65. //
  66. #define PTR_CHASE_SIMPLE 1
  67. //
  68. // The case when the structure has a pointer whose pointee is too complicated
  69. // to handle in line and can be better handled out of line.
  70. //
  71. #define PTR_CHASE_TOO_COMPLEX 2
  72. /////////////////////////////////////////////////////////////////////////////
  73. // usage property descriptor and marshalling weight descriptions.
  74. /////////////////////////////////////////////////////////////////////////////
  75. typedef unsigned long USE_COUNT;
  76. //
  77. // The usage threshold specifies how many times a structure needs to
  78. // be used before it is declared to be suitable for an out of line routine.
  79. //
  80. //
  81. // NOTE: The usage threshold must be at least 1 less than the largest positive
  82. // number representable by any usage count field.
  83. //
  84. #define USAGE_THRESHOLD 10
  85. #define MARSHALL_WEIGHT_THRESHOLD 10
  86. #define MARSHALL_WEIGHT_LOWER_THRESHOLD 0
  87. ////////////////////////////////////////////////////////////////////////////
  88. // conformance property.
  89. ////////////////////////////////////////////////////////////////////////////
  90. typedef unsigned long CONFORMANCE_PROPERTY;
  91. //
  92. // The conformance property is applicable mainly to structures, but is useful
  93. // to the users of the structure to determine actions to take. Conformance
  94. // information consists of these constituents: Based on this the name of the
  95. // conformance property is derived, as also the value of the property.
  96. //
  97. /*
  98. <Level><Dimensions><expressional><packing><Complexity><Structure>
  99. |<---------- 4 bits -------------------->|<- 1 bits ->|<- 3bits->
  100. where :
  101. .Level indicates if conformance exists at this level or lower level (1bit)
  102. .Dimension can be 1 or N (1 bit )
  103. .Structure can be (4 bits)
  104. simple:
  105. basetype( BT )
  106. flatstruct( FS )
  107. array of simple types above( SA )
  108. complex:
  109. pointer (PT)
  110. complex struct ( CS struct with ptrs/variance/transmit_as etc)
  111. complex array (CA array of pointers/complex structure etc)
  112. .expressional (1 bit )
  113. simple expression (SE variable name,constant,or single ptr deref)
  114. complex expression (CE)
  115. .packing (1 bit )
  116. ok ( OK the structure is completely ok w.r.t ndr)
  117. nok( NO the structure is wierdly packed w.r.t ndr)
  118. For a total of 6 bits.
  119. */
  120. //
  121. // indicate the conformance level. The structure containing the conformant
  122. // array has C_THIS_LEVEL, all others have C_LOWER_LEVEL
  123. //
  124. #define C_THIS 0x00 /* conformance spec exist in this level */
  125. #define C_LOWER 0x80 /* conformance spec exists at lower level */
  126. #define C_1_DIM 0x00 /* 1 dimensional conformance */
  127. #define C_N_DIM 0x40 /* N dimensional conformance */
  128. // identify the conformance structure as simple or complex.
  129. #define C_SIMPLE 0x00 /* simple conformance */
  130. #define C_COMPLEX 0x20 /* complex conformance */
  131. // simple conformance structure details.
  132. #define C_BT 0x1 /* base type */
  133. #define C_FS 0x2 /* flat structs */
  134. #define C_SA 0x3 /* array of simple types */
  135. // complex conformance structure details.
  136. #define C_PT 0x1 /* pointer */
  137. #define C_CS 0x2 /* complex structure */
  138. #define C_CA 0x3 /* array of complex types */
  139. // identify the expressional part of the conformance
  140. #define C_SE 0x0 /* simple expression */
  141. #define C_CE 0x1 /* complex expression */
  142. // identify the packing
  143. #define C_OK 0x0 /* packing ok */
  144. #define C_NO 0x1 /* bad packing */
  145. //
  146. // macros to set conformance information
  147. //
  148. /*******
  149. #define MAKE_CONFORMANCE_PROPERTY( Level, Dim, Complexity, Details, Expr, Packing ) \
  150. *******/
  151. ////////////////////////////////////////////////////////////////////////////
  152. // variance property.
  153. ////////////////////////////////////////////////////////////////////////////
  154. typedef unsigned long VARIANCE_PROPERTY;
  155. ////////////////////////////////////////////////////////////////////////////
  156. // out-of-line property.
  157. ////////////////////////////////////////////////////////////////////////////
  158. //
  159. // This property dictates whether to generate the out of line routines for
  160. // a type.
  161. // The MUST_OUT_OF_LINE property is set when the type cannot be in-lined,
  162. // either because in-lining this will bloat the code size or because the
  163. // user specified an [out_of_line] on this and the usage is too frequent to
  164. // in-line.
  165. // The MUST_IN_LINE property is set when a type must be in-lined. This is
  166. // always the case with base types. This property is also set when the user
  167. // specified an [in_line] attribute on the type and the type can be in-lined.
  168. //
  169. typedef unsigned long OOL_PROPERTY;
  170. #define MUST_OUT_OF_LINE 0x1
  171. #define MUST_IN_LINE 0x2
  172. /////////////////////////////////////////////////////////////////////////////
  173. // inherited directional properties.
  174. /////////////////////////////////////////////////////////////////////////////
  175. typedef unsigned long USE_DIR;
  176. //
  177. // Init the directional property with this.
  178. //
  179. #define DIR_UNKNOWN 0x0
  180. //
  181. // This definition represents the current direction being [in].
  182. //
  183. #define DIR_IN 0x1
  184. //
  185. // This definition represents the current direction being [out].
  186. //
  187. #define DIR_OUT 0x2
  188. //
  189. // This definition represents the current direction being [in] [out]
  190. //
  191. #define DIR_IN_OUT ( ANA_CUR_DIRECTION_IN | ANA_CUR_DIR_OUT )
  192. /////////////////////////////////////////////////////////////////////////////
  193. // synthesised information about the buffer re-use property.
  194. /////////////////////////////////////////////////////////////////////////////
  195. //
  196. // This property specifies the re-usability of the rpc buffer on the server
  197. // side.
  198. //
  199. typedef unsigned long BUFFER_REUSE_PROPERTY;
  200. //
  201. // This definition specifies that the entity in question is suitable for
  202. // a buffer re-use on the server side.
  203. //
  204. #define BUFFER_REUSE_POSSIBLE 0x0
  205. //
  206. // This definition specifies that the entity in question is NOT suitable for
  207. // a buffer re-use and therefore the entity must be allocated either on
  208. // the stack or on the heap.
  209. //
  210. #define BUFFER_REUSE_IMPOSSIBLE 0x2
  211. ////////////////////////////////////////////////////////////////////////////
  212. // Miscellaneous properties.
  213. ////////////////////////////////////////////////////////////////////////////
  214. typedef unsigned long MISC_PROPERTY;
  215. #define REF_PARAM_CHECK 0x1
  216. //
  217. // define a default of the miscellaneous properties.
  218. //
  219. #define DEFAULT_MISC_PROPERTIES ( \
  220. REF_PARAM_CHECK \
  221. )
  222. #endif // __OPTPROP_HXX__