home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / msinc.pak / MIDLES.H < prev    next >
C/C++ Source or Header  |  1997-07-23  |  6KB  |  228 lines

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