home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / MIDLES.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  5.9 KB  |  221 lines

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