Midles.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:8k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  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. #if _MSC_VER > 1000
  12. #pragma once
  13. #endif
  14. #include <rpcndr.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /*
  19.  *  Pickling support
  20.  */
  21. typedef enum
  22. {
  23.     MES_ENCODE,
  24.     MES_DECODE,
  25.     MES_ENCODE_NDR64  
  26. } MIDL_ES_CODE;
  27. typedef enum
  28. {
  29.     MES_INCREMENTAL_HANDLE,
  30.     MES_FIXED_BUFFER_HANDLE,
  31.     MES_DYNAMIC_BUFFER_HANDLE
  32. } MIDL_ES_HANDLE_STYLE;
  33. typedef void (__RPC_USER *  MIDL_ES_ALLOC )
  34.                 ( IN OUT  void  *   state,
  35.                   OUT     char  **  pbuffer,
  36.                   IN OUT  unsigned int * psize );
  37. typedef void (__RPC_USER *  MIDL_ES_WRITE)
  38.                 ( IN OUT  void    * state,
  39.                   IN      char    * buffer,
  40.                   IN      unsigned int  size );
  41. typedef void (__RPC_USER *  MIDL_ES_READ)
  42.                 ( IN OUT  void  *   state,
  43.                   OUT     char  **  pbuffer,
  44.                   IN OUT  unsigned int * psize );
  45. typedef handle_t    MIDL_ES_HANDLE;
  46. typedef struct _MIDL_TYPE_PICKLING_INFO
  47. {
  48.     unsigned long   Version;
  49.     unsigned long   Flags;    
  50.     UINT_PTR        Reserved[3];
  51. } MIDL_TYPE_PICKLING_INFO,  * PMIDL_TYPE_PICKLING_INFO;
  52. RPC_STATUS  RPC_ENTRY
  53. MesEncodeIncrementalHandleCreate(
  54.     void          * UserState,
  55.     MIDL_ES_ALLOC   AllocFn,
  56.     MIDL_ES_WRITE   WriteFn,
  57.     handle_t      * pHandle );
  58. RPC_STATUS  RPC_ENTRY
  59. MesDecodeIncrementalHandleCreate(
  60.     void         *  UserState,
  61.     MIDL_ES_READ    ReadFn,
  62.     handle_t     *  pHandle );
  63. RPC_STATUS  RPC_ENTRY
  64. MesIncrementalHandleReset(
  65.     handle_t        Handle,
  66.     void     *      UserState,
  67.     MIDL_ES_ALLOC   AllocFn,
  68.     MIDL_ES_WRITE   WriteFn,
  69.     MIDL_ES_READ    ReadFn,
  70.     MIDL_ES_CODE    Operation );
  71. RPC_STATUS  RPC_ENTRY
  72. MesEncodeFixedBufferHandleCreate(
  73.     char            *   pBuffer,
  74.     unsigned long       BufferSize,
  75.     unsigned long   *   pEncodedSize,
  76.     handle_t        *   pHandle );
  77. RPC_STATUS  RPC_ENTRY
  78. MesEncodeDynBufferHandleCreate(
  79.     char            * * pBuffer,
  80.     unsigned long   *   pEncodedSize,
  81.     handle_t        *   pHandle );
  82. RPC_STATUS  RPC_ENTRY
  83. MesDecodeBufferHandleCreate(
  84.     char            *   pBuffer,
  85.     unsigned long       BufferSize,
  86.     handle_t        *   pHandle );
  87. RPC_STATUS  RPC_ENTRY
  88. MesBufferHandleReset(
  89.     handle_t            Handle,
  90.     unsigned long       HandleStyle,
  91.     MIDL_ES_CODE        Operation,
  92.     char            * * pBuffer,
  93.     unsigned long       BufferSize,
  94.     unsigned long   *   pEncodedSize );
  95. RPC_STATUS  RPC_ENTRY
  96. MesHandleFree( handle_t  Handle );
  97. RPC_STATUS  RPC_ENTRY
  98. MesInqProcEncodingId(
  99.     handle_t                    Handle,
  100.     PRPC_SYNTAX_IDENTIFIER      pInterfaceId,
  101.     unsigned long  *   pProcNum );
  102. size_t  RPC_ENTRY
  103. NdrMesSimpleTypeAlignSize ( handle_t );
  104. void  RPC_ENTRY
  105. NdrMesSimpleTypeDecode(
  106.     handle_t            Handle,
  107.     void            *   pObject,
  108.     short               Size );
  109. void  RPC_ENTRY
  110. NdrMesSimpleTypeEncode(
  111.     handle_t                Handle,
  112.     const MIDL_STUB_DESC *  pStubDesc,
  113.     const void           *  pObject,
  114.     short                   Size );
  115. size_t  RPC_ENTRY
  116. NdrMesTypeAlignSize(
  117.     handle_t                Handle,
  118.     const MIDL_STUB_DESC *  pStubDesc,
  119.     PFORMAT_STRING          pFormatString,
  120.     const void           *  pObject );
  121. void  RPC_ENTRY
  122. NdrMesTypeEncode(
  123.     handle_t                Handle,
  124.     const MIDL_STUB_DESC *  pStubDesc,
  125.     PFORMAT_STRING          pFormatString,
  126.     const void           *  pObject );
  127. void  RPC_ENTRY
  128. NdrMesTypeDecode(
  129.     handle_t                Handle,
  130.     const MIDL_STUB_DESC *  pStubDesc,
  131.     PFORMAT_STRING          pFormatString,
  132.     void                 *  pObject );
  133. size_t  RPC_ENTRY
  134. NdrMesTypeAlignSize2(
  135.     handle_t                        Handle,
  136.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,
  137.     const MIDL_STUB_DESC *          pStubDesc,
  138.     PFORMAT_STRING                  pFormatString,
  139.     const void           *          pObject );
  140. void  RPC_ENTRY
  141. NdrMesTypeEncode2(
  142.     handle_t                        Handle,
  143.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,    
  144.     const MIDL_STUB_DESC *          pStubDesc,
  145.     PFORMAT_STRING                  pFormatString,
  146.     const void           *          pObject );
  147. void  RPC_ENTRY
  148. NdrMesTypeDecode2(
  149.     handle_t                        Handle,
  150.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,    
  151.     const MIDL_STUB_DESC *          pStubDesc,
  152.     PFORMAT_STRING                  pFormatString,
  153.     void                 *          pObject );
  154. void RPC_ENTRY
  155. NdrMesTypeFree2(
  156.     handle_t                        Handle,
  157.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,
  158.     const MIDL_STUB_DESC          * pStubDesc,
  159.     PFORMAT_STRING                  pFormatString,
  160.     void                 *          pObject );
  161. void  RPC_VAR_ENTRY
  162. NdrMesProcEncodeDecode(
  163.     handle_t                Handle,
  164.     const MIDL_STUB_DESC *  pStubDesc,
  165.     PFORMAT_STRING          pFormatString,
  166.     ... );
  167. CLIENT_CALL_RETURN  RPC_VAR_ENTRY
  168. NdrMesProcEncodeDecode2(
  169.     handle_t                Handle,
  170.     const MIDL_STUB_DESC *  pStubDesc,
  171.     PFORMAT_STRING          pFormatString,
  172.     ...
  173.     );
  174. // ndr64 entries.
  175. size_t  RPC_ENTRY
  176. NdrMesTypeAlignSize3(
  177.     handle_t                        Handle,
  178.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,
  179.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  180.     const unsigned long **          ArrTypeOffset,
  181.     unsigned long                   nTypeIndex,
  182.     const void          *           pObject );
  183. void  RPC_ENTRY
  184. NdrMesTypeEncode3(
  185.     handle_t                        Handle,
  186.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,    
  187.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  188.     const unsigned long **          ArrTypeOffset,
  189.     unsigned long                   nTypeIndex,
  190.     const void          *           pObject );
  191. void  RPC_ENTRY
  192. NdrMesTypeDecode3(
  193.     handle_t                        Handle,
  194.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,    
  195.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  196.     const unsigned long **          ArrTypeOffset,
  197.     unsigned long                   nTypeIndex,
  198.     void                *           pObject );
  199. void  RPC_ENTRY
  200. NdrMesTypeFree3(
  201.     handle_t                        Handle,
  202.     const MIDL_TYPE_PICKLING_INFO * pPicklingInfo,    
  203.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  204.     const unsigned long **          ArrTypeOffset,
  205.     unsigned long                   nTypeIndex,
  206.     void                *           pObject );
  207. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  208. NdrMesProcEncodeDecode3(
  209.     handle_t                        Handle,
  210.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  211.     unsigned long                   nProcNum,
  212.     void                           *pReturnValue,    
  213.     ... );
  214. void  RPC_ENTRY
  215. NdrMesSimpleTypeDecodeAll(
  216.     handle_t                        Handle,
  217.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  218.     void                *           pObject,
  219.     short                           Size );
  220. void  RPC_ENTRY
  221. NdrMesSimpleTypeEncodeAll(
  222.     handle_t                        Handle,
  223.     const MIDL_STUBLESS_PROXY_INFO* pProxyInfo,
  224.     const void          *           pObject,
  225.     short                           Size );
  226. size_t  RPC_ENTRY
  227. NdrMesSimpleTypeAlignSizeAll ( handle_t Handle,
  228.                                const MIDL_STUBLESS_PROXY_INFO*  pProxyInfo );
  229. #ifdef __cplusplus
  230. }
  231. #endif
  232. #endif /* __MIDLES_H__ */