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.

291 lines
6.7 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright <c> 1993 Microsoft Corporation
  3. Module Name :
  4. endianp.h
  5. Abtract :
  6. Contains private sizing routine definitions.
  7. Author :
  8. David Kays dkays December 1993
  9. Revision History :
  10. --------------------------------------------------------------------*/
  11. #ifndef _ENDIANP_
  12. #define _ENDIANP_
  13. //
  14. // These are no-exported APIs.
  15. //
  16. void
  17. NdrSimpleTypeConvert(
  18. PMIDL_STUB_MESSAGE pStubMsg,
  19. unsigned char FormatChar
  20. );
  21. void
  22. NdrPointerConvert(
  23. PMIDL_STUB_MESSAGE pStubMsg,
  24. PFORMAT_STRING pFormat,
  25. unsigned char fConvertPointersOnly
  26. );
  27. /* Structures */
  28. void
  29. NdrSimpleStructConvert(
  30. PMIDL_STUB_MESSAGE pStubMsg,
  31. PFORMAT_STRING pFormat,
  32. unsigned char fConvertPointersOnly
  33. );
  34. void
  35. NdrConformantStructConvert(
  36. PMIDL_STUB_MESSAGE pStubMsg,
  37. PFORMAT_STRING pFormat,
  38. unsigned char fConvertPointersOnly
  39. );
  40. void
  41. NdrHardStructConvert(
  42. PMIDL_STUB_MESSAGE pStubMsg,
  43. PFORMAT_STRING pFormat,
  44. unsigned char fConvertPointersOnly
  45. );
  46. void
  47. NdrComplexStructConvert(
  48. PMIDL_STUB_MESSAGE pStubMsg,
  49. PFORMAT_STRING pFormat,
  50. unsigned char fConvertPointersOnly
  51. );
  52. /* Arrays */
  53. void
  54. NdrFixedArrayConvert(
  55. PMIDL_STUB_MESSAGE pStubMsg,
  56. PFORMAT_STRING pFormat,
  57. unsigned char fConvertPointersOnly
  58. );
  59. void
  60. NdrConformantArrayConvert(
  61. PMIDL_STUB_MESSAGE pStubMsg,
  62. PFORMAT_STRING pFormat,
  63. unsigned char fConvertPointersOnly
  64. );
  65. void
  66. NdrConformantVaryingArrayConvert(
  67. PMIDL_STUB_MESSAGE pStubMsg,
  68. PFORMAT_STRING pFormat,
  69. unsigned char fConvertPointersOnly
  70. );
  71. void
  72. NdrVaryingArrayConvert(
  73. PMIDL_STUB_MESSAGE pStubMsg,
  74. PFORMAT_STRING pFormat,
  75. unsigned char fConvertPointersOnly
  76. );
  77. void
  78. NdrComplexArrayConvert(
  79. PMIDL_STUB_MESSAGE pStubMsg,
  80. PFORMAT_STRING pFormat,
  81. unsigned char fConvertPointersOnly
  82. );
  83. /* Strings */
  84. void
  85. NdrNonConformantStringConvert(
  86. PMIDL_STUB_MESSAGE pStubMsg,
  87. PFORMAT_STRING pFormat,
  88. unsigned char fConvertPointersOnly
  89. );
  90. void
  91. NdrConformantStringConvert(
  92. PMIDL_STUB_MESSAGE pStubMsg,
  93. PFORMAT_STRING pFormat,
  94. unsigned char fConvertPointersOnly
  95. );
  96. /* Unions */
  97. void
  98. NdrEncapsulatedUnionConvert(
  99. PMIDL_STUB_MESSAGE pStubMsg,
  100. PFORMAT_STRING pFormat,
  101. unsigned char fConvertPointersOnly
  102. );
  103. void
  104. NdrNonEncapsulatedUnionConvert(
  105. PMIDL_STUB_MESSAGE pStubMsg,
  106. PFORMAT_STRING pFormat,
  107. unsigned char fConvertPointersOnly
  108. );
  109. /* Byte count pointer */
  110. void
  111. NdrByteCountPointerConvert(
  112. PMIDL_STUB_MESSAGE pStubMsg,
  113. PFORMAT_STRING pFormat,
  114. unsigned char fConvertPointersOnly
  115. );
  116. /* Transmit as and represent as convert */
  117. void
  118. NdrXmitOrRepAsConvert(
  119. PMIDL_STUB_MESSAGE pStubMsg,
  120. PFORMAT_STRING pFormat,
  121. unsigned char fConvertPointersOnly
  122. );
  123. /* User_marshall convert */
  124. void
  125. NdrUserMarshalConvert(
  126. PMIDL_STUB_MESSAGE pStubMsg,
  127. PFORMAT_STRING pFormat,
  128. unsigned char fConvertPointersOnly
  129. );
  130. void
  131. NdrInterfacePointerConvert(
  132. PMIDL_STUB_MESSAGE pStubMsg,
  133. PFORMAT_STRING pFormat,
  134. unsigned char fConvertPointersOnly
  135. );
  136. void
  137. NdrContextHandleConvert(
  138. PMIDL_STUB_MESSAGE pStubMsg,
  139. PFORMAT_STRING pFormat,
  140. unsigned char fConvertPointersOnly
  141. );
  142. //
  143. // Other helper routines.
  144. //
  145. void
  146. NdrpPointerConvert(
  147. PMIDL_STUB_MESSAGE pStubMsg,
  148. uchar * pBufferMark,
  149. PFORMAT_STRING pFormat
  150. );
  151. void
  152. NdrpStructConvert(
  153. PMIDL_STUB_MESSAGE pStubMsg,
  154. PFORMAT_STRING pFormat,
  155. PFORMAT_STRING pFormatPointers,
  156. uchar fConvertPointersOnly
  157. );
  158. void
  159. NdrpConformantArrayConvert(
  160. PMIDL_STUB_MESSAGE pStubMsg,
  161. PFORMAT_STRING pFormat,
  162. uchar fConvertPointersOnly
  163. );
  164. void
  165. NdrpConformantVaryingArrayConvert(
  166. PMIDL_STUB_MESSAGE pStubMsg,
  167. PFORMAT_STRING pFormat,
  168. uchar fConvertPointersOnly
  169. );
  170. void
  171. NdrpComplexArrayConvert(
  172. PMIDL_STUB_MESSAGE pStubMsg,
  173. PFORMAT_STRING pFormat,
  174. uchar fConvertPointersOnly
  175. );
  176. void
  177. NdrpArrayConvert(
  178. PMIDL_STUB_MESSAGE pStubMsg,
  179. PFORMAT_STRING pFormat,
  180. long Elements,
  181. uchar fConvertPointersOnly
  182. );
  183. void
  184. NdrpUnionConvert(
  185. PMIDL_STUB_MESSAGE pStubMsg,
  186. PFORMAT_STRING pFormat,
  187. uchar SwitchType,
  188. uchar fConvertPointersOnly
  189. );
  190. void
  191. NdrpEmbeddedPointerConvert(
  192. PMIDL_STUB_MESSAGE pStubMsg,
  193. PFORMAT_STRING pFormat
  194. );
  195. PFORMAT_STRING
  196. NdrpEmbeddedRepeatPointerConvert(
  197. PMIDL_STUB_MESSAGE pStubMsg,
  198. PFORMAT_STRING pFormat
  199. );
  200. typedef void (* PCONVERT_ROUTINE)(
  201. PMIDL_STUB_MESSAGE,
  202. PFORMAT_STRING,
  203. uchar
  204. );
  205. typedef void (* PPRIVATE_CONVERT_ROUTINE)(
  206. PMIDL_STUB_MESSAGE,
  207. PFORMAT_STRING,
  208. uchar
  209. );
  210. // function table defined in endian.c
  211. extern const PCONVERT_ROUTINE * pfnConvertRoutines;
  212. //
  213. // Conversion stuff.
  214. //
  215. extern const unsigned char EbcdicToAscii[];
  216. #define NDR_FLOAT_INT_MASK (unsigned long)0X0000FFF0L
  217. #define NDR_BIG_IEEE_REP (unsigned long)0X00000000L
  218. #define NDR_LITTLE_IEEE_REP (unsigned long)0X00000010L
  219. #define NDR_LOCAL_ENDIAN_IEEE_REP NDR_LITTLE_IEEE_REP
  220. //
  221. // Masks defined for short byte swapping:
  222. //
  223. #define MASK_A_ (unsigned short)0XFF00
  224. #define MASK__B (unsigned short)0X00FF
  225. //
  226. // Masks defined for long byte swapping:
  227. //
  228. #define MASK_AB__ (unsigned long)0XFFFF0000L
  229. #define MASK___CD (unsigned long)0X0000FFFFL
  230. #define MASK_A_C_ (unsigned long)0XFF00FF00L
  231. #define MASK__B_D (unsigned long)0X00FF00FFL
  232. #endif