home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / midles.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  7.4 KB  |  273 lines

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