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.

218 lines
5.6 KiB

  1. /*++
  2. Copyright (c) 1991-1995 Microsoft Corporation
  3. Module Name:
  4. midles.h
  5. Abstract:
  6. This module contains definitions needed for encoding/decoding
  7. support (serializing/deserializing a.k.a. pickling).
  8. --*/
  9. #ifndef __MIDLES_H__
  10. #define __MIDLES_H__
  11. #include <rpcndr.h>
  12. //
  13. // Set the packing level for RPC structures for Dos and Windows.
  14. //
  15. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  16. #pragma pack(2)
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /*
  22. * Pickling support
  23. */
  24. typedef enum
  25. {
  26. MES_ENCODE,
  27. MES_DECODE,
  28. } MIDL_ES_CODE;
  29. typedef enum
  30. {
  31. MES_INCREMENTAL_HANDLE,
  32. MES_FIXED_BUFFER_HANDLE,
  33. MES_DYNAMIC_BUFFER_HANDLE
  34. } MIDL_ES_HANDLE_STYLE;
  35. typedef void (__RPC_USER * MIDL_ES_ALLOC )
  36. ( IN OUT void __RPC_FAR * state,
  37. OUT char __RPC_FAR * __RPC_FAR * pbuffer,
  38. IN OUT unsigned int __RPC_FAR * psize );
  39. typedef void (__RPC_USER * MIDL_ES_WRITE)
  40. ( IN OUT void __RPC_FAR * state,
  41. IN char __RPC_FAR * buffer,
  42. IN unsigned int size );
  43. typedef void (__RPC_USER * MIDL_ES_READ)
  44. ( IN OUT void __RPC_FAR * state,
  45. OUT char __RPC_FAR * __RPC_FAR * pbuffer,
  46. IN OUT unsigned int __RPC_FAR * psize );
  47. typedef struct _MIDL_ES_MESSAGE
  48. {
  49. MIDL_STUB_MESSAGE StubMsg;
  50. MIDL_ES_CODE Operation;
  51. void __RPC_FAR * UserState;
  52. unsigned long MesVersion:8;
  53. unsigned long HandleStyle:8;
  54. unsigned long HandleFlags:8;
  55. unsigned long Reserve:8;
  56. MIDL_ES_ALLOC Alloc;
  57. MIDL_ES_WRITE Write;
  58. MIDL_ES_READ Read;
  59. unsigned char __RPC_FAR * Buffer;
  60. unsigned long BufferSize;
  61. unsigned char __RPC_FAR * __RPC_FAR * pDynBuffer;
  62. unsigned long __RPC_FAR * pEncodedSize;
  63. RPC_SYNTAX_IDENTIFIER InterfaceId;
  64. unsigned long ProcNumber;
  65. unsigned long AlienDataRep;
  66. unsigned long IncrDataSize;
  67. unsigned long ByteCount;
  68. } MIDL_ES_MESSAGE, __RPC_FAR * PMIDL_ES_MESSAGE;
  69. typedef PMIDL_ES_MESSAGE MIDL_ES_HANDLE;
  70. RPC_STATUS RPC_ENTRY
  71. MesEncodeIncrementalHandleCreate(
  72. void __RPC_FAR * UserState,
  73. MIDL_ES_ALLOC AllocFn,
  74. MIDL_ES_WRITE WriteFn,
  75. handle_t __RPC_FAR * pHandle );
  76. RPC_STATUS RPC_ENTRY
  77. MesDecodeIncrementalHandleCreate(
  78. void __RPC_FAR * UserState,
  79. MIDL_ES_READ ReadFn,
  80. handle_t __RPC_FAR * pHandle );
  81. RPC_STATUS RPC_ENTRY
  82. MesIncrementalHandleReset(
  83. handle_t Handle,
  84. void __RPC_FAR * UserState,
  85. MIDL_ES_ALLOC AllocFn,
  86. MIDL_ES_WRITE WriteFn,
  87. MIDL_ES_READ ReadFn,
  88. MIDL_ES_CODE Operation );
  89. RPC_STATUS RPC_ENTRY
  90. MesEncodeFixedBufferHandleCreate(
  91. char __RPC_FAR * pBuffer,
  92. unsigned long BufferSize,
  93. unsigned long __RPC_FAR * pEncodedSize,
  94. handle_t __RPC_FAR * pHandle );
  95. RPC_STATUS RPC_ENTRY
  96. MesEncodeDynBufferHandleCreate(
  97. char __RPC_FAR * __RPC_FAR * pBuffer,
  98. unsigned long __RPC_FAR * pEncodedSize,
  99. handle_t __RPC_FAR * pHandle );
  100. RPC_STATUS RPC_ENTRY
  101. MesDecodeBufferHandleCreate(
  102. char __RPC_FAR * pBuffer,
  103. unsigned long BufferSize,
  104. handle_t __RPC_FAR * pHandle );
  105. RPC_STATUS RPC_ENTRY
  106. MesBufferHandleReset(
  107. handle_t Handle,
  108. unsigned long HandleStyle,
  109. MIDL_ES_CODE Operation,
  110. char __RPC_FAR * __RPC_FAR * pBuffer,
  111. unsigned long BufferSize,
  112. unsigned long __RPC_FAR * pEncodedSize );
  113. RPC_STATUS RPC_ENTRY
  114. MesHandleFree( handle_t Handle );
  115. RPC_STATUS RPC_ENTRY
  116. MesInqProcEncodingId(
  117. handle_t Handle,
  118. PRPC_SYNTAX_IDENTIFIER pInterfaceId,
  119. unsigned long __RPC_FAR * pProcNum );
  120. #if defined(_MIPS_) || defined(_ALPHA_) || defined(_PPC_)
  121. #define __RPC_UNALIGNED __unaligned
  122. #else
  123. #define __RPC_UNALIGNED
  124. #endif
  125. void RPC_ENTRY I_NdrMesMessageInit( PMIDL_STUB_MESSAGE );
  126. size_t RPC_ENTRY
  127. NdrMesSimpleTypeAlignSize ( handle_t );
  128. void RPC_ENTRY
  129. NdrMesSimpleTypeDecode(
  130. handle_t Handle,
  131. void __RPC_FAR * pObject,
  132. short Size );
  133. void RPC_ENTRY
  134. NdrMesSimpleTypeEncode(
  135. handle_t Handle,
  136. PMIDL_STUB_DESC pStubDesc,
  137. void __RPC_FAR * pObject,
  138. short Size );
  139. size_t RPC_ENTRY
  140. NdrMesTypeAlignSize(
  141. handle_t Handle,
  142. PMIDL_STUB_DESC pStubDesc,
  143. PFORMAT_STRING pFormatString,
  144. void __RPC_FAR * pObject );
  145. void RPC_ENTRY
  146. NdrMesTypeEncode(
  147. handle_t Handle,
  148. PMIDL_STUB_DESC pStubDesc,
  149. PFORMAT_STRING pFormatString,
  150. void __RPC_FAR * pObject );
  151. void RPC_ENTRY
  152. NdrMesTypeDecode(
  153. handle_t Handle,
  154. PMIDL_STUB_DESC pStubDesc,
  155. PFORMAT_STRING pFormatString,
  156. void __RPC_FAR * pObject );
  157. void RPC_VAR_ENTRY
  158. NdrMesProcEncodeDecode(
  159. handle_t Handle,
  160. PMIDL_STUB_DESC pStubDesc,
  161. PFORMAT_STRING pFormatString,
  162. ... );
  163. #ifdef __cplusplus
  164. }
  165. #endif
  166. // Reset the packing level for DOS and Windows.
  167. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__)
  168. #pragma pack()
  169. #endif
  170. #endif /* __MIDLES_H__ */