home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / sdk / winh / rpcndr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-29  |  64.4 KB  |  2,267 lines

  1. /*++
  2.  
  3. Copyright (c) 1992-1995 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     rpcndr.h
  8.  
  9. Abstract:
  10.  
  11.     Definitions for stub data structures and prototypes of helper functions.
  12.  
  13. Environment:
  14.  
  15.     DOS, Win 3.X, and Win/NT.
  16.  
  17. --*/
  18.  
  19. #ifndef __RPCNDR_H__
  20. #define __RPCNDR_H__
  21.  
  22. //
  23. // Set the packing level for RPC structures for Dos, Windows and Mac.
  24. //
  25.  
  26. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__) || defined(__RPC_MAC__)
  27. #pragma pack(2)
  28. #endif
  29.  
  30. #if defined(__RPC_MAC__)
  31. #define _MAC_
  32. #endif
  33.  
  34. #include <rpcnsip.h>
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. /****************************************************************************
  41.  
  42.      Network Computing Architecture (NCA) definition:
  43.  
  44.      Network Data Representation: (NDR) Label format:
  45.      An unsigned long (32 bits) with the following layout:
  46.  
  47.      3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  48.      1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  49.     +---------------+---------------+---------------+-------+-------+
  50.     |   Reserved    |   Reserved    |Floating point | Int   | Char  |
  51.     |               |               |Representation | Rep.  | Rep.  |
  52.     +---------------+---------------+---------------+-------+-------+
  53.  
  54.      Where
  55.  
  56.          Reserved:
  57.  
  58.              Must be zero (0) for NCA 1.5 and NCA 2.0.
  59.  
  60.          Floating point Representation is:
  61.  
  62.              0 - IEEE
  63.              1 - VAX
  64.              2 - Cray
  65.              3 - IBM
  66.  
  67.          Int Rep. is Integer Representation:
  68.  
  69.              0 - Big Endian
  70.              1 - Little Endian
  71.  
  72.          Char Rep. is Character Representation:
  73.  
  74.              0 - ASCII
  75.              1 - EBCDIC
  76.  
  77.      The Microsoft Local Data Representation (for all platforms which are
  78.      of interest currently is edefined below:
  79.  
  80.  ****************************************************************************/
  81.  
  82. #define NDR_CHAR_REP_MASK               (unsigned long)0X0000000FL
  83. #define NDR_INT_REP_MASK                (unsigned long)0X000000F0L
  84. #define NDR_FLOAT_REP_MASK              (unsigned long)0X0000FF00L
  85.  
  86. #define NDR_LITTLE_ENDIAN               (unsigned long)0X00000010L
  87. #define NDR_BIG_ENDIAN                  (unsigned long)0X00000000L
  88.  
  89. #define NDR_IEEE_FLOAT                  (unsigned long)0X00000000L
  90. #define NDR_VAX_FLOAT                   (unsigned long)0X00000100L
  91.  
  92. #define NDR_ASCII_CHAR                  (unsigned long)0X00000000L
  93. #define NDR_EBCDIC_CHAR                 (unsigned long)0X00000001L
  94.  
  95. #if defined(__RPC_MAC__)
  96. #define NDR_LOCAL_DATA_REPRESENTATION   (unsigned long)0X00000000L
  97. #define NDR_LOCAL_ENDIAN                NDR_BIG_ENDIAN
  98. #else
  99. #define NDR_LOCAL_DATA_REPRESENTATION   (unsigned long)0X00000010L
  100. #define NDR_LOCAL_ENDIAN                NDR_LITTLE_ENDIAN
  101. #endif
  102.  
  103. /****************************************************************************
  104.  *  Other MIDL base types / predefined types:
  105.  ****************************************************************************/
  106.  
  107. #define small char
  108. typedef unsigned char byte;
  109. typedef unsigned char boolean;
  110.  
  111. #ifndef _HYPER_DEFINED
  112. #define _HYPER_DEFINED
  113.  
  114. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))
  115. #define  hyper           __int64
  116. #define MIDL_uhyper  unsigned __int64
  117. #else
  118. typedef double  hyper;
  119. typedef double MIDL_uhyper;
  120. #endif
  121.  
  122. #endif // _HYPER_DEFINED
  123.  
  124. #ifndef _WCHAR_T_DEFINED
  125. typedef unsigned short wchar_t;
  126. #define _WCHAR_T_DEFINED
  127. #endif
  128.  
  129. #ifndef _SIZE_T_DEFINED
  130. typedef unsigned int size_t;
  131. #define _SIZE_T_DEFINED
  132. #endif
  133.  
  134. #ifdef __RPC_DOS__
  135. #define __RPC_CALLEE       __far __pascal
  136. #endif
  137.  
  138. #ifdef __RPC_WIN16__
  139. #define __RPC_CALLEE       __far __pascal __export
  140. #endif
  141.  
  142. #ifdef __RPC_WIN32__
  143. #if   (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
  144. #define __RPC_CALLEE       __stdcall
  145. #else
  146. #define __RPC_CALLEE
  147. #endif
  148. #endif
  149.  
  150. #ifdef __RPC_MAC__
  151. #define __RPC_CALLEE __far
  152. #endif
  153.  
  154. #ifndef __MIDL_USER_DEFINED
  155. #define midl_user_allocate MIDL_user_allocate
  156. #define midl_user_free     MIDL_user_free
  157. #define __MIDL_USER_DEFINED
  158. #endif
  159.  
  160. void __RPC_FAR * __RPC_USER MIDL_user_allocate(size_t);
  161. void             __RPC_USER MIDL_user_free( void __RPC_FAR * ); 
  162.  
  163. #ifdef __RPC_WIN16__
  164. #define RPC_VAR_ENTRY __export __cdecl
  165. #else
  166. #define RPC_VAR_ENTRY __cdecl
  167. #endif
  168.  
  169.  
  170. /* winnt only */
  171. #if defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA)
  172. #define __MIDL_DECLSPEC_DLLIMPORT   __declspec(dllimport)
  173. #define __MIDL_DECLSPEC_DLLEXPORT   __declspec(dllexport)
  174. #else
  175. #define __MIDL_DECLSPEC_DLLIMPORT
  176. #define __MIDL_DECLSPEC_DLLEXPORT
  177. #endif
  178.  
  179. /****************************************************************************
  180.  * Context handle management related definitions:
  181.  *
  182.  * Client and Server Contexts. 
  183.  *
  184.  ****************************************************************************/
  185.  
  186. typedef void __RPC_FAR * NDR_CCONTEXT;
  187.  
  188. typedef struct
  189.     {
  190.     void __RPC_FAR * pad[2];
  191.     void __RPC_FAR * userContext;
  192.     } __RPC_FAR * NDR_SCONTEXT;
  193.  
  194. #define NDRSContextValue(hContext) (&(hContext)->userContext)
  195.  
  196. #define cbNDRContext 20         /* size of context on WIRE */
  197.  
  198. typedef void (__RPC_USER __RPC_FAR * NDR_RUNDOWN)(void __RPC_FAR * context);
  199.  
  200. typedef struct _SCONTEXT_QUEUE {
  201.     unsigned long   NumberOfObjects;
  202.     NDR_SCONTEXT  * ArrayOfObjects;
  203.     } SCONTEXT_QUEUE, __RPC_FAR * PSCONTEXT_QUEUE;
  204.  
  205. RPC_BINDING_HANDLE RPC_ENTRY
  206. NDRCContextBinding (
  207.     IN NDR_CCONTEXT CContext
  208.     );
  209.  
  210. void RPC_ENTRY
  211. NDRCContextMarshall (
  212.         IN  NDR_CCONTEXT CContext,
  213.         OUT void __RPC_FAR *pBuff
  214.         );
  215.  
  216. void RPC_ENTRY
  217. NDRCContextUnmarshall (
  218.         OUT NDR_CCONTEXT __RPC_FAR *pCContext,
  219.         IN  RPC_BINDING_HANDLE hBinding,
  220.         IN  void __RPC_FAR *pBuff,
  221.         IN  unsigned long DataRepresentation
  222.         );
  223.  
  224. void RPC_ENTRY
  225. NDRSContextMarshall (
  226.         IN  NDR_SCONTEXT CContext,
  227.         OUT void __RPC_FAR *pBuff,
  228.         IN  NDR_RUNDOWN userRunDownIn
  229.         );
  230.  
  231. NDR_SCONTEXT RPC_ENTRY
  232. NDRSContextUnmarshall (
  233.     IN  void __RPC_FAR *pBuff,
  234.     IN  unsigned long DataRepresentation
  235.     );
  236.  
  237. void RPC_ENTRY
  238. RpcSsDestroyClientContext (
  239.     IN void __RPC_FAR * __RPC_FAR * ContextHandle
  240.     );
  241.  
  242.  
  243. /****************************************************************************
  244.     NDR conversion related definitions.
  245.  ****************************************************************************/
  246.  
  247. #define byte_from_ndr(source, target) \
  248.     { \
  249.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  250.     }
  251.  
  252. #define byte_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  253.     { \
  254.     NDRcopy ( \
  255.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  256.         (Source)->Buffer, \
  257.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  258.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  259.     }
  260.  
  261. #define boolean_from_ndr(source, target) \
  262.     { \
  263.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  264.     }
  265.  
  266. #define boolean_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  267.     { \
  268.     NDRcopy ( \
  269.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  270.         (Source)->Buffer, \
  271.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  272.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  273.     }
  274.  
  275. #define small_from_ndr(source, target) \
  276.     { \
  277.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)&(source)->Buffer)++; \
  278.     }
  279.  
  280. #define small_from_ndr_temp(source, target, format) \
  281.     { \
  282.     *(target) = *(*(char __RPC_FAR * __RPC_FAR *)(source))++; \
  283.     }
  284.  
  285. #define small_array_from_ndr(Source, LowerIndex, UpperIndex, Target) \
  286.     { \
  287.     NDRcopy ( \
  288.         (((char __RPC_FAR *)(Target))+(LowerIndex)), \
  289.         (Source)->Buffer, \
  290.         (unsigned int)((UpperIndex)-(LowerIndex))); \
  291.     *(unsigned long __RPC_FAR *)&(Source)->Buffer += ((UpperIndex)-(LowerIndex)); \
  292.     }
  293.  
  294. /****************************************************************************
  295.     Platform specific mapping of c-runtime functions.
  296.  ****************************************************************************/
  297.  
  298. #ifdef __RPC_DOS__
  299. #define MIDL_ascii_strlen(string) \
  300.     _fstrlen(string)
  301. #define MIDL_ascii_strcpy(target,source) \
  302.     _fstrcpy(target,source)
  303. #define MIDL_memset(s,c,n) \
  304.     _fmemset(s,c,n)
  305. #endif
  306.  
  307. #ifdef __RPC_WIN16__
  308. #define MIDL_ascii_strlen(string) \
  309.     _fstrlen(string)
  310. #define MIDL_ascii_strcpy(target,source) \
  311.     _fstrcpy(target,source)
  312. #define MIDL_memset(s,c,n) \
  313.     _fmemset(s,c,n)
  314. #endif
  315.  
  316. #if defined(__RPC_WIN32__) || defined(__RPC_MAC__)
  317. #define MIDL_ascii_strlen(string) \
  318.     strlen(string)
  319. #define MIDL_ascii_strcpy(target,source) \
  320.     strcpy(target,source)
  321. #define MIDL_memset(s,c,n) \
  322.     memset(s,c,n)
  323. #endif
  324.  
  325. /****************************************************************************
  326.     Ndr Library helper function prototypes for MIDL 1.0 ndr functions.
  327.  ****************************************************************************/
  328.  
  329. void RPC_ENTRY
  330. NDRcopy (
  331.     IN void __RPC_FAR *pTarget,
  332.     IN void __RPC_FAR *pSource,
  333.     IN unsigned int size
  334.     );
  335.  
  336. size_t RPC_ENTRY
  337. MIDL_wchar_strlen (
  338.     IN wchar_t __RPC_FAR *   s
  339.     );
  340.  
  341. void RPC_ENTRY
  342. MIDL_wchar_strcpy (
  343.     OUT void __RPC_FAR *     t,
  344.     IN wchar_t __RPC_FAR *   s
  345.     );
  346.  
  347. void RPC_ENTRY
  348. char_from_ndr (
  349.     IN OUT PRPC_MESSAGE                           SourceMessage,
  350.     OUT unsigned char __RPC_FAR *                 Target
  351.     );
  352.  
  353. void RPC_ENTRY
  354. char_array_from_ndr (
  355.     IN OUT PRPC_MESSAGE                           SourceMessage,
  356.     IN unsigned long                              LowerIndex,
  357.     IN unsigned long                              UpperIndex,
  358.     OUT unsigned char __RPC_FAR *                 Target
  359.     );
  360.  
  361. void RPC_ENTRY
  362. short_from_ndr (
  363.     IN OUT PRPC_MESSAGE                           source,
  364.     OUT unsigned short __RPC_FAR *                target
  365.     );
  366.  
  367. void RPC_ENTRY
  368. short_array_from_ndr(
  369.     IN OUT PRPC_MESSAGE                           SourceMessage,
  370.     IN unsigned long                              LowerIndex,
  371.     IN unsigned long                              UpperIndex,
  372.     OUT unsigned short __RPC_FAR *                Target
  373.     );
  374.  
  375. void RPC_ENTRY
  376. short_from_ndr_temp (
  377.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  378.     OUT unsigned short __RPC_FAR *                target,
  379.     IN unsigned long                              format
  380.     );
  381.  
  382. void RPC_ENTRY
  383. long_from_ndr (
  384.     IN OUT PRPC_MESSAGE                           source,
  385.     OUT unsigned long __RPC_FAR *                 target
  386.     );
  387.  
  388. void RPC_ENTRY
  389. long_array_from_ndr(
  390.     IN OUT PRPC_MESSAGE                           SourceMessage,
  391.     IN unsigned long                              LowerIndex,
  392.     IN unsigned long                              UpperIndex,
  393.     OUT unsigned long __RPC_FAR *                 Target
  394.     );
  395.  
  396. void RPC_ENTRY
  397. long_from_ndr_temp (
  398.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  399.     OUT unsigned long __RPC_FAR *                 target,
  400.     IN unsigned long                              format
  401.     );
  402.  
  403. void RPC_ENTRY
  404. enum_from_ndr(
  405.     IN OUT PRPC_MESSAGE                           SourceMessage,
  406.     OUT unsigned int __RPC_FAR *                  Target
  407.     );
  408.  
  409. void RPC_ENTRY
  410. float_from_ndr (
  411.     IN OUT PRPC_MESSAGE                           SourceMessage,
  412.     OUT void __RPC_FAR *                          Target
  413.     );
  414.  
  415. void RPC_ENTRY
  416. float_array_from_ndr (
  417.     IN OUT PRPC_MESSAGE                           SourceMessage,
  418.     IN unsigned long                              LowerIndex,
  419.     IN unsigned long                              UpperIndex,
  420.     OUT void __RPC_FAR *                          Target
  421.     );
  422.  
  423. void RPC_ENTRY
  424. double_from_ndr (
  425.     IN OUT PRPC_MESSAGE                           SourceMessage,
  426.     OUT void __RPC_FAR *                          Target
  427.     );
  428.  
  429. void RPC_ENTRY
  430. double_array_from_ndr (
  431.     IN OUT PRPC_MESSAGE                           SourceMessage,
  432.     IN unsigned long                              LowerIndex,
  433.     IN unsigned long                              UpperIndex,
  434.     OUT void __RPC_FAR *                          Target
  435.     );
  436.  
  437. void RPC_ENTRY
  438. hyper_from_ndr (
  439.     IN OUT PRPC_MESSAGE                           source,
  440.     OUT    hyper __RPC_FAR *                      target
  441.     );
  442.  
  443. void RPC_ENTRY
  444. hyper_array_from_ndr(
  445.     IN OUT PRPC_MESSAGE                           SourceMessage,
  446.     IN unsigned long                              LowerIndex,
  447.     IN unsigned long                              UpperIndex,
  448.     OUT          hyper __RPC_FAR *                Target
  449.     );
  450.  
  451. void RPC_ENTRY
  452. hyper_from_ndr_temp (
  453.     IN OUT unsigned char __RPC_FAR * __RPC_FAR *  source,
  454.     OUT             hyper __RPC_FAR *             target,
  455.     IN   unsigned   long                          format
  456.     );
  457.  
  458. void RPC_ENTRY
  459. data_from_ndr (
  460.     PRPC_MESSAGE                                  source,
  461.     void __RPC_FAR *                              target,
  462.     char __RPC_FAR *                              format,
  463.     unsigned char                                 MscPak
  464.     );
  465.  
  466. void RPC_ENTRY
  467. data_into_ndr (
  468.     void __RPC_FAR *                              source,
  469.     PRPC_MESSAGE                                  target,
  470.     char __RPC_FAR *                              format,
  471.     unsigned char                                 MscPak
  472.     );
  473.  
  474. void RPC_ENTRY
  475. tree_into_ndr (
  476.     void __RPC_FAR *                              source,
  477.     PRPC_MESSAGE                                  target,
  478.     char __RPC_FAR *                              format,
  479.     unsigned char                                 MscPak
  480.     );
  481.  
  482. void RPC_ENTRY
  483. data_size_ndr (
  484.     void __RPC_FAR *                              source,
  485.     PRPC_MESSAGE                                  target,
  486.     char __RPC_FAR *                              format,
  487.     unsigned char                                 MscPak
  488.     );
  489.  
  490. void RPC_ENTRY
  491. tree_size_ndr (
  492.     void __RPC_FAR *                              source,
  493.     PRPC_MESSAGE                                  target,
  494.     char __RPC_FAR *                              format,
  495.     unsigned char                                 MscPak
  496.     );
  497.  
  498. void RPC_ENTRY
  499. tree_peek_ndr (
  500.     PRPC_MESSAGE                                  source,
  501.     unsigned char __RPC_FAR * __RPC_FAR *         buffer,
  502.     char __RPC_FAR *                              format,
  503.     unsigned char                                 MscPak
  504.     );
  505.  
  506. void __RPC_FAR * RPC_ENTRY
  507. midl_allocate (
  508.     size_t      size
  509.     );
  510.  
  511. /****************************************************************************
  512.     MIDL 2.0 ndr definitions.
  513.  ****************************************************************************/
  514.  
  515. typedef unsigned long error_status_t;
  516.  
  517. #define _midl_ma1( p, cast )    *(*( cast **)&p)++
  518. #define _midl_ma2( p, cast )    *(*( cast **)&p)++
  519. #define _midl_ma4( p, cast )    *(*( cast **)&p)++
  520. #define _midl_ma8( p, cast )    *(*( cast **)&p)++
  521.  
  522. #define _midl_unma1( p, cast )  *(( cast *)p)++
  523. #define _midl_unma2( p, cast )  *(( cast *)p)++
  524. #define _midl_unma3( p, cast )  *(( cast *)p)++
  525. #define _midl_unma4( p, cast )  *(( cast *)p)++
  526.  
  527. // Some alignment specific macros.
  528.  
  529.  
  530. #define _midl_fa2( p )          (p = (RPC_BUFPTR )((unsigned long)(p+1) & 0xfffffffe))
  531. #define _midl_fa4( p )          (p = (RPC_BUFPTR )((unsigned long)(p+3) & 0xfffffffc))
  532. #define _midl_fa8( p )          (p = (RPC_BUFPTR )((unsigned long)(p+7) & 0xfffffff8))
  533.  
  534. #define _midl_addp( p, n )      (p += n)
  535.  
  536. // Marshalling macros
  537.  
  538. #define _midl_marsh_lhs( p, cast )  *(*( cast **)&p)++
  539. #define _midl_marsh_up( mp, p )     *(*(unsigned long **)&mp)++ = (unsigned long)p
  540. #define _midl_advmp( mp )           *(*(unsigned long **)&mp)++
  541. #define _midl_unmarsh_up( p )       (*(*(unsigned long **)&p)++) 
  542.  
  543.  
  544. ////////////////////////////////////////////////////////////////////////////
  545. // Ndr macros.
  546. ////////////////////////////////////////////////////////////////////////////
  547.  
  548. #define NdrMarshConfStringHdr( p, s, l )    (_midl_ma4( p, unsigned long) = s, \
  549.                                             _midl_ma4( p, unsigned long) = 0, \
  550.                                             _midl_ma4( p, unsigned long) = l)
  551.  
  552. #define NdrUnMarshConfStringHdr(p, s, l)    ((s=_midl_unma4(p,unsigned long),\
  553.                                             (_midl_addp(p,4)),               \
  554.                                             (l=_midl_unma4(p,unsigned long))
  555.         
  556. #define NdrMarshCCtxtHdl(pc,p)  (NDRCContextMarshall( (NDR_CCONTEXT)pc, p ),p+20)
  557.  
  558. #define NdrUnMarshCCtxtHdl(pc,p,h,drep) \
  559.         (NDRCContextUnmarshall((NDR_CONTEXT)pc,h,p,drep), p+20)
  560.  
  561. #define NdrUnMarshSCtxtHdl(pc, p,drep)  (pc = NdrSContextUnMarshall(p,drep ))
  562.     
  563.  
  564. #define NdrMarshSCtxtHdl(pc,p,rd)   (NdrSContextMarshall((NDR_SCONTEXT)pc,p, (NDR_RUNDOWN)rd)
  565.  
  566. #define NdrFieldOffset(s,f)     (long)(& (((s __RPC_FAR *)0)->f))
  567. #define NdrFieldPad(s,f,p,t)    (NdrFieldOffset(s,f) - NdrFieldOffset(s,p) - sizeof(t))
  568.  
  569. #if defined(__RPC_MAC__)
  570. #define NdrFcShort(s)   (unsigned char)(s >> 8), (unsigned char)(s & 0xff)
  571. #define NdrFcLong(s)    (unsigned char)(s >> 24), (unsigned char)((s & 0x00ff0000) >> 16), \
  572.                         (unsigned char)((s & 0x0000ff00) >> 8), (unsigned char)(s & 0xff)
  573. #else
  574. #define NdrFcShort(s)   (unsigned char)(s & 0xff), (unsigned char)(s >> 8)
  575. #define NdrFcLong(s)    (unsigned char)(s & 0xff), (unsigned char)((s & 0x0000ff00) >> 8), \
  576.                         (unsigned char)((s & 0x00ff0000) >> 16), (unsigned char)(s >> 24)
  577. #endif //  Mac
  578.  
  579. /////////////////////////////////////////////////////////////////////////////
  580. // Some stub helper functions.
  581. /////////////////////////////////////////////////////////////////////////////
  582.  
  583. ////////////////////////////////////////////////////////////////////////////
  584. // Stub helper structures.
  585. ////////////////////////////////////////////////////////////////////////////
  586.  
  587. struct _MIDL_STUB_MESSAGE;
  588. struct _MIDL_STUB_DESC;
  589. struct _FULL_PTR_XLAT_TABLES;
  590.  
  591. typedef unsigned char __RPC_FAR * RPC_BUFPTR;
  592. typedef unsigned long             RPC_LENGTH;
  593.  
  594. // Expression evaluation callback routine prototype.
  595. typedef void (__RPC_USER __RPC_FAR * EXPR_EVAL)( struct _MIDL_STUB_MESSAGE __RPC_FAR * );
  596.  
  597. typedef const unsigned char __RPC_FAR * PFORMAT_STRING;
  598.  
  599. /*
  600.  * Multidimensional conformant/varying array struct.
  601.  */
  602. typedef struct 
  603.     {
  604.     long                            Dimension;
  605.  
  606.     /* These fields MUST be (unsigned long *) */
  607.     unsigned long __RPC_FAR *       BufferConformanceMark;
  608.     unsigned long __RPC_FAR *       BufferVarianceMark;
  609.  
  610.     /* Count arrays, used for top level arrays in -Os stubs */
  611.     unsigned long __RPC_FAR *       MaxCountArray;
  612.     unsigned long __RPC_FAR *       OffsetArray;
  613.     unsigned long __RPC_FAR *       ActualCountArray;
  614.     } ARRAY_INFO, __RPC_FAR *PARRAY_INFO;
  615.  
  616. /*
  617.  * MIDL Stub Message
  618.  */
  619. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__)
  620. #include <pshpack4.h>
  621. #endif 
  622.  
  623. typedef struct _MIDL_STUB_MESSAGE
  624.     {
  625.     /* RPC message structure. */
  626.     PRPC_MESSAGE                RpcMsg;
  627.  
  628.     /* Pointer into RPC message buffer. */
  629.     unsigned char __RPC_FAR *   Buffer;
  630.  
  631.     /*
  632.      * These are used internally by the Ndr routines to mark the beginning
  633.      * and end of an incoming RPC buffer.
  634.      */
  635.     unsigned char __RPC_FAR *   BufferStart;
  636.     unsigned char __RPC_FAR *   BufferEnd;
  637.  
  638.     /*
  639.      * Used internally by the Ndr routines as a place holder in the buffer.
  640.      * On the marshalling side it's used to mark the location where conformance
  641.      * size should be marshalled.
  642.      * On the unmarshalling side it's used to mark the location in the buffer
  643.      * used during pointer unmarshalling to base pointer offsets off of.
  644.      */
  645.     unsigned char __RPC_FAR *   BufferMark;
  646.  
  647.     /* Set by the buffer sizing routines. */
  648.     unsigned long               BufferLength;
  649.  
  650.     /* Set by the memory sizing routines. */
  651.     unsigned long               MemorySize;
  652.  
  653.     /* Pointer to user memory. */
  654.     unsigned char __RPC_FAR *   Memory;
  655.  
  656.     /* Is the Ndr routine begin called from a client side stub. */
  657.     int                         IsClient;
  658.  
  659.     /* Can the buffer be re-used for memory on unmarshalling. */
  660.     int                         ReuseBuffer;    
  661.  
  662.     /* Holds the current pointer to an allocate all nodes memory block. */
  663.     unsigned char __RPC_FAR *   AllocAllNodesMemory;
  664.  
  665.     /* Used for debugging asserts only, remove later. */
  666.     unsigned char __RPC_FAR *   AllocAllNodesMemoryEnd;
  667.  
  668.     /* 
  669.      * Stuff needed while handling complex structures 
  670.      */
  671.  
  672.     /* Ignore imbeded pointers while computing buffer or memory sizes. */
  673.     int                         IgnoreEmbeddedPointers;
  674.  
  675.     /* 
  676.      * This marks the location in the buffer where pointees of a complex
  677.      * struct reside.
  678.      */
  679.     unsigned char __RPC_FAR *   PointerBufferMark;
  680.  
  681.     /*
  682.      * Used to catch errors in SendReceive.
  683.      */
  684.     unsigned char               fBufferValid;
  685.  
  686.     /*
  687.      * Obsolete unused field (formerly MaxContextHandleNumber).
  688.      */
  689.     unsigned char               Unused;
  690.  
  691.     /* 
  692.      * Used internally by the Ndr routines.  Holds the max counts for 
  693.      * a conformant array.
  694.      */
  695.     unsigned long               MaxCount;
  696.  
  697.     /* 
  698.      * Used internally by the Ndr routines.  Holds the offsets for a varying
  699.      * array.
  700.      */
  701.     unsigned long               Offset;
  702.  
  703.     /* 
  704.      * Used internally by the Ndr routines.  Holds the actual counts for 
  705.      * a varying array.
  706.      */
  707.     unsigned long               ActualCount;
  708.  
  709.     /* Allocation and Free routine to be used by the Ndr routines. */
  710.     void __RPC_FAR *    (__RPC_FAR __RPC_API * pfnAllocate)(size_t);
  711.     void                (__RPC_FAR __RPC_API * pfnFree)(void __RPC_FAR *);
  712.  
  713.     /*
  714.      * Top of parameter stack.  Used for "single call" stubs during marshalling 
  715.      * to hold the beginning of the parameter list on the stack.  Needed to 
  716.      * extract parameters which hold attribute values for top level arrays and 
  717.      * pointers. 
  718.      */
  719.     unsigned char __RPC_FAR *       StackTop;
  720.  
  721.     /*
  722.      *  Fields used for the transmit_as and represent_as objects.
  723.      *  For represent_as the mapping is: presented=local, transmit=named.
  724.      */
  725.     unsigned char __RPC_FAR *       pPresentedType;
  726.     unsigned char __RPC_FAR *       pTransmitType;
  727.  
  728.     /* 
  729.      * When we first construct a binding on the client side, stick it
  730.      * in the rpcmessage and later call RpcGetBuffer, the handle field
  731.      * in the rpcmessage is changed. That's fine except that we need to
  732.      * have that original handle for use in unmarshalling context handles
  733.      * (the second argument in NDRCContextUnmarshall to be exact). So
  734.      * stash the contructed handle here and extract it when needed.
  735.      */
  736.     handle_t                        SavedHandle;
  737.  
  738.     /*
  739.      * Pointer back to the stub descriptor.  Use this to get all handle info.
  740.      */
  741.     const struct _MIDL_STUB_DESC __RPC_FAR *    StubDesc;
  742.  
  743.     /*
  744.      * Full pointer stuff.
  745.      */
  746.     struct _FULL_PTR_XLAT_TABLES __RPC_FAR *    FullPtrXlatTables;
  747.  
  748.     unsigned long                   FullPtrRefId;
  749.  
  750.     /*
  751.      * flags
  752.      */
  753.  
  754.     int                             fCheckBounds;
  755.  
  756.     int                             fInDontFree       :1;
  757.     int                             fDontCallFreeInst :1;
  758.     int                             fInOnlyParam      :1;
  759.     int                             fHasReturn        :1;
  760.  
  761.     unsigned long                   dwDestContext;
  762.     void __RPC_FAR *                pvDestContext;
  763.  
  764.     NDR_SCONTEXT *                  SavedContextHandles;
  765.  
  766.     long                            ParamNumber;
  767.  
  768.     struct IRpcChannelBuffer __RPC_FAR *    pRpcChannelBuffer;
  769.  
  770.     PARRAY_INFO                     pArrayInfo;
  771.  
  772.     /* 
  773.      * This is where the Beta2 stub message ends.
  774.      */
  775.  
  776.     unsigned long __RPC_FAR *       SizePtrCountArray;
  777.     unsigned long __RPC_FAR *       SizePtrOffsetArray;
  778.     unsigned long __RPC_FAR *       SizePtrLengthArray;
  779.  
  780.     /*
  781.      * Interpreter argument queue.  Used on server side only.
  782.      */
  783.     void __RPC_FAR *                pArgQueue;
  784.  
  785.     unsigned long                   dwStubPhase;
  786.  
  787.     /*
  788.      * Reserved for future use.
  789.      */
  790.     
  791.     unsigned long                   Reserved[5];
  792.  
  793.     } MIDL_STUB_MESSAGE, __RPC_FAR *PMIDL_STUB_MESSAGE;
  794.  
  795. #if !defined(__RPC_DOS__) && !defined(__RPC_WIN16__) && !defined(__RPC_MAC__)
  796. #include <poppack.h>
  797. #endif 
  798.  
  799. /*
  800.  * Generic handle bind/unbind routine pair.
  801.  */
  802. typedef void __RPC_FAR * 
  803.         (__RPC_FAR __RPC_API * GENERIC_BINDING_ROUTINE)
  804.         (void __RPC_FAR *);
  805. typedef void             
  806.         (__RPC_FAR __RPC_API * GENERIC_UNBIND_ROUTINE)
  807.         (void __RPC_FAR *, unsigned char __RPC_FAR *);
  808.  
  809. typedef struct _GENERIC_BINDING_ROUTINE_PAIR
  810.     {
  811.     GENERIC_BINDING_ROUTINE     pfnBind;
  812.     GENERIC_UNBIND_ROUTINE      pfnUnbind;
  813.     } GENERIC_BINDING_ROUTINE_PAIR, __RPC_FAR *PGENERIC_BINDING_ROUTINE_PAIR;
  814.  
  815. typedef struct __GENERIC_BINDING_INFO 
  816.     {
  817.     void __RPC_FAR *            pObj;
  818.     unsigned int                Size;
  819.     GENERIC_BINDING_ROUTINE     pfnBind;
  820.     GENERIC_UNBIND_ROUTINE      pfnUnbind;
  821.     } GENERIC_BINDING_INFO, __RPC_FAR *PGENERIC_BINDING_INFO;
  822.  
  823. // typedef EXPR_EVAL - see above
  824.  
  825. typedef void (__RPC_FAR __RPC_USER * XMIT_HELPER_ROUTINE)( PMIDL_STUB_MESSAGE );
  826.  
  827. typedef struct _XMIT_ROUTINE_QUINTUPLE
  828.     {
  829.     XMIT_HELPER_ROUTINE     pfnTranslateToXmit;
  830.     XMIT_HELPER_ROUTINE     pfnTranslateFromXmit;
  831.     XMIT_HELPER_ROUTINE     pfnFreeXmit;
  832.     XMIT_HELPER_ROUTINE     pfnFreeInst;
  833.     } XMIT_ROUTINE_QUINTUPLE, __RPC_FAR *PXMIT_ROUTINE_QUINTUPLE;
  834.  
  835. typedef struct _MALLOC_FREE_STRUCT
  836.     {
  837.     void __RPC_FAR *    (__RPC_FAR __RPC_USER * pfnAllocate)(size_t);
  838.     void                (__RPC_FAR __RPC_USER * pfnFree)(void __RPC_FAR *);
  839.     } MALLOC_FREE_STRUCT;
  840.  
  841. typedef struct _COMM_FAULT_OFFSETS
  842.     {
  843.     short       CommOffset;
  844.     short       FaultOffset;
  845.     } COMM_FAULT_OFFSETS;
  846.  
  847. /*
  848.  * MIDL Stub Descriptor
  849.  */
  850. typedef struct _MIDL_STUB_DESC
  851.     {
  852.  
  853.     void __RPC_FAR *    RpcInterfaceInformation;
  854.  
  855.     void __RPC_FAR *    (__RPC_FAR __RPC_API * pfnAllocate)(size_t);
  856.     void                (__RPC_FAR __RPC_API * pfnFree)(void __RPC_FAR *);
  857.  
  858.     union
  859.         {
  860.         handle_t __RPC_FAR *            pAutoHandle;
  861.         handle_t __RPC_FAR *            pPrimitiveHandle;
  862.         PGENERIC_BINDING_INFO           pGenericBindingInfo;
  863.         } IMPLICIT_HANDLE_INFO;
  864.  
  865.     const NDR_RUNDOWN __RPC_FAR *                   apfnNdrRundownRoutines;
  866.     const GENERIC_BINDING_ROUTINE_PAIR __RPC_FAR *  aGenericBindingRoutinePairs;
  867.  
  868.     const EXPR_EVAL __RPC_FAR *                     apfnExprEval;
  869.  
  870.     const XMIT_ROUTINE_QUINTUPLE __RPC_FAR *        aXmitQuintuple;
  871.  
  872.     const unsigned char __RPC_FAR *             pFormatTypes;
  873.  
  874.     int                                 fCheckBounds;
  875.  
  876.     /* Ndr library version. */
  877.     unsigned long                       Version;
  878.  
  879.     /*
  880.      * Reserved for future use.
  881.      */
  882.  
  883.     MALLOC_FREE_STRUCT __RPC_FAR *      pMallocFreeStruct;
  884.  
  885.     long                                MIDLVersion;
  886.  
  887.     const COMM_FAULT_OFFSETS __RPC_FAR *    CommFaultOffsets;
  888.  
  889.     } MIDL_STUB_DESC; 
  890.  
  891. typedef const MIDL_STUB_DESC __RPC_FAR * PMIDL_STUB_DESC;
  892.  
  893. typedef void __RPC_FAR * PMIDL_XMIT_TYPE;
  894.  
  895. /*
  896.  * MIDL Stub Format String.  This is a const in the stub.
  897.  */
  898. #if !defined( RC_INVOKED )
  899. #pragma warning( disable:4200 )
  900. #endif
  901. typedef struct _MIDL_FORMAT_STRING
  902.     {
  903.     short               Pad;
  904.     unsigned char       Format[];
  905.     } MIDL_FORMAT_STRING;
  906. #if !defined( RC_INVOKED )
  907. #pragma warning( default:4200 )
  908. #endif
  909.  
  910. /*
  911.  * Stub thunk used for some interpreted server stubs.
  912.  */
  913. typedef void (__RPC_FAR __RPC_API * STUB_THUNK)( PMIDL_STUB_MESSAGE );
  914.  
  915. typedef long (__RPC_FAR __RPC_API * SERVER_ROUTINE)();
  916.  
  917. /*
  918.  * Server Interpreter's information strucuture.
  919.  */ 
  920. typedef struct  _MIDL_SERVER_INFO_ 
  921.     {
  922.     PMIDL_STUB_DESC             pStubDesc;
  923.     const SERVER_ROUTINE *      DispatchTable;
  924.     PFORMAT_STRING              ProcString;
  925.     const unsigned short *      FmtStringOffset;
  926.     const STUB_THUNK *          ThunkTable;
  927.     } MIDL_SERVER_INFO, *PMIDL_SERVER_INFO;
  928.  
  929. /*
  930.  * Stubless object proxy information structure.
  931.  */
  932. typedef struct _MIDL_STUBLESS_PROXY_INFO 
  933.     {
  934.     PMIDL_STUB_DESC                     pStubDesc;
  935.     PFORMAT_STRING                      ProcFormatString;
  936.     const unsigned short __RPC_FAR *    FormatStringOffset;
  937.     } MIDL_STUBLESS_PROXY_INFO;
  938.  
  939. typedef MIDL_STUBLESS_PROXY_INFO __RPC_FAR * PMIDL_STUBLESS_PROXY_INFO;
  940.  
  941. /* 
  942.  * This is the return value from NdrClientCall.
  943.  */
  944. typedef union _CLIENT_CALL_RETURN 
  945.     {
  946.     void __RPC_FAR *        Pointer;
  947.     long                    Simple;
  948.     } CLIENT_CALL_RETURN;
  949.  
  950. /*
  951.  * Full pointer data structures.
  952.  */
  953.  
  954. typedef enum 
  955.         {
  956.         XLAT_SERVER = 1,
  957.         XLAT_CLIENT
  958.         } XLAT_SIDE;
  959.  
  960. /*
  961.  * Stores the translation for the conversion from a full pointer into it's
  962.  * corresponding ref id.
  963.  */
  964. typedef struct _FULL_PTR_TO_REFID_ELEMENT
  965.     {
  966.     struct _FULL_PTR_TO_REFID_ELEMENT __RPC_FAR *  Next;
  967.  
  968.     void __RPC_FAR *            Pointer;
  969.     unsigned long       RefId;
  970.     unsigned char       State;
  971.     } FULL_PTR_TO_REFID_ELEMENT, __RPC_FAR *PFULL_PTR_TO_REFID_ELEMENT;
  972.  
  973. /*
  974.  * Full pointer translation tables.
  975.  */
  976. typedef struct _FULL_PTR_XLAT_TABLES
  977.     {
  978.     /*
  979.      * Ref id to pointer translation information.
  980.      */
  981.     struct
  982.         {
  983.         void __RPC_FAR *__RPC_FAR *             XlatTable;
  984.         unsigned char __RPC_FAR *     StateTable;
  985.         unsigned long       NumberOfEntries;
  986.         } RefIdToPointer;
  987.  
  988.     /*
  989.      * Pointer to ref id translation information.
  990.      */
  991.     struct
  992.         {
  993.         PFULL_PTR_TO_REFID_ELEMENT __RPC_FAR *  XlatTable;
  994.         unsigned long                   NumberOfBuckets;
  995.         unsigned long                   HashMask;
  996.         } PointerToRefId;
  997.  
  998.     /*
  999.      * Next ref id to use.
  1000.      */
  1001.     unsigned long           NextRefId;
  1002.  
  1003.     /*
  1004.      * Keep track of the translation size we're handling : server or client.
  1005.      * This tells us when we have to do reverse translations when we insert
  1006.      * new translations.  On the server we must insert a pointer-to-refid 
  1007.      * translation whenever we insert a refid-to-pointer translation, and 
  1008.      * vica versa for the client.
  1009.      */
  1010.     XLAT_SIDE               XlatSide;
  1011.     } FULL_PTR_XLAT_TABLES, __RPC_FAR *PFULL_PTR_XLAT_TABLES;
  1012.  
  1013. /***************************************************************************
  1014.  ** New MIDL 2.0 Ndr routine templates
  1015.  ***************************************************************************/
  1016.  
  1017. /*
  1018.  * Marshall routines
  1019.  */
  1020.  
  1021. void RPC_ENTRY
  1022. NdrSimpleTypeMarshall( 
  1023.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1024.     unsigned char __RPC_FAR *                       pMemory, 
  1025.     unsigned char                       FormatChar   
  1026.     );
  1027.  
  1028. unsigned char __RPC_FAR * RPC_ENTRY
  1029. NdrPointerMarshall( 
  1030.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1031.     unsigned char __RPC_FAR *           pMemory, 
  1032.     PFORMAT_STRING                      pFormat   
  1033.     );
  1034.  
  1035. /* Structures */
  1036.  
  1037. unsigned char __RPC_FAR * RPC_ENTRY
  1038. NdrSimpleStructMarshall( 
  1039.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1040.     unsigned char __RPC_FAR *           pMemory, 
  1041.     PFORMAT_STRING                      pFormat   
  1042.     );
  1043.  
  1044. unsigned char __RPC_FAR * RPC_ENTRY
  1045. NdrConformantStructMarshall( 
  1046.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1047.     unsigned char __RPC_FAR *           pMemory, 
  1048.     PFORMAT_STRING                      pFormat   
  1049.     );
  1050.  
  1051. unsigned char __RPC_FAR * RPC_ENTRY
  1052. NdrConformantVaryingStructMarshall( 
  1053.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1054.     unsigned char __RPC_FAR *           pMemory, 
  1055.     PFORMAT_STRING                      pFormat   
  1056.     );
  1057.  
  1058. unsigned char __RPC_FAR * RPC_ENTRY
  1059. NdrHardStructMarshall( 
  1060.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1061.     unsigned char __RPC_FAR *           pMemory, 
  1062.     PFORMAT_STRING                      pFormat   
  1063.     );
  1064.  
  1065. unsigned char __RPC_FAR * RPC_ENTRY
  1066. NdrComplexStructMarshall( 
  1067.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1068.     unsigned char __RPC_FAR *           pMemory, 
  1069.     PFORMAT_STRING                      pFormat   
  1070.     );
  1071.  
  1072. /* Arrays */
  1073.  
  1074. unsigned char __RPC_FAR * RPC_ENTRY
  1075. NdrFixedArrayMarshall( 
  1076.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1077.     unsigned char __RPC_FAR *           pMemory, 
  1078.     PFORMAT_STRING                      pFormat   
  1079.     );
  1080.  
  1081. unsigned char __RPC_FAR * RPC_ENTRY
  1082. NdrConformantArrayMarshall( 
  1083.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1084.     unsigned char __RPC_FAR *           pMemory, 
  1085.     PFORMAT_STRING                      pFormat   
  1086.     );
  1087.  
  1088. unsigned char __RPC_FAR * RPC_ENTRY
  1089. NdrConformantVaryingArrayMarshall( 
  1090.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1091.     unsigned char __RPC_FAR *           pMemory, 
  1092.     PFORMAT_STRING                      pFormat   
  1093.     );
  1094.  
  1095. unsigned char __RPC_FAR * RPC_ENTRY
  1096. NdrVaryingArrayMarshall( 
  1097.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1098.     unsigned char __RPC_FAR *           pMemory, 
  1099.     PFORMAT_STRING                      pFormat   
  1100.     );
  1101.  
  1102. unsigned char __RPC_FAR * RPC_ENTRY
  1103. NdrComplexArrayMarshall( 
  1104.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1105.     unsigned char __RPC_FAR *           pMemory, 
  1106.     PFORMAT_STRING                      pFormat   
  1107.     );
  1108.  
  1109. /* Strings */
  1110.  
  1111. unsigned char __RPC_FAR * RPC_ENTRY
  1112. NdrNonConformantStringMarshall( 
  1113.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1114.     unsigned char __RPC_FAR *           pMemory, 
  1115.     PFORMAT_STRING                      pFormat   
  1116.     );
  1117.  
  1118. unsigned char __RPC_FAR * RPC_ENTRY
  1119. NdrConformantStringMarshall( 
  1120.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1121.     unsigned char __RPC_FAR *           pMemory, 
  1122.     PFORMAT_STRING                      pFormat   
  1123.     );
  1124.  
  1125. /* Unions */
  1126.  
  1127. unsigned char __RPC_FAR * RPC_ENTRY
  1128. NdrEncapsulatedUnionMarshall( 
  1129.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1130.     unsigned char __RPC_FAR *           pMemory, 
  1131.     PFORMAT_STRING                      pFormat   
  1132.     );
  1133.  
  1134. unsigned char __RPC_FAR * RPC_ENTRY
  1135. NdrNonEncapsulatedUnionMarshall( 
  1136.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1137.     unsigned char __RPC_FAR *           pMemory, 
  1138.     PFORMAT_STRING                      pFormat   
  1139.     );
  1140.  
  1141. /* Byte count pointer */
  1142.  
  1143. unsigned char __RPC_FAR * RPC_ENTRY
  1144. NdrByteCountPointerMarshall( 
  1145.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1146.     unsigned char __RPC_FAR *           pMemory, 
  1147.     PFORMAT_STRING                      pFormat   
  1148.     );
  1149.  
  1150. /* Transmit as and represent as*/
  1151.  
  1152. unsigned char __RPC_FAR * RPC_ENTRY
  1153. NdrXmitOrRepAsMarshall( 
  1154.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1155.     unsigned char __RPC_FAR *           pMemory, 
  1156.     PFORMAT_STRING                      pFormat   
  1157.     );
  1158.  
  1159. /* Cairo interface pointer */
  1160.  
  1161. unsigned char __RPC_FAR * RPC_ENTRY
  1162. NdrInterfacePointerMarshall( 
  1163.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1164.     unsigned char __RPC_FAR *           pMemory, 
  1165.     PFORMAT_STRING                      pFormat   
  1166.     );
  1167.  
  1168. /* Context handles */
  1169.  
  1170. void RPC_ENTRY
  1171. NdrClientContextMarshall( 
  1172.     PMIDL_STUB_MESSAGE    pStubMsg,
  1173.     NDR_CCONTEXT          ContextHandle,
  1174.     int                   fCheck 
  1175.     );
  1176.  
  1177. void RPC_ENTRY
  1178. NdrServerContextMarshall( 
  1179.     PMIDL_STUB_MESSAGE    pStubMsg,
  1180.     NDR_SCONTEXT          ContextHandle,
  1181.     NDR_RUNDOWN           RundownRoutine 
  1182.     );
  1183.  
  1184. /*
  1185.  * Unmarshall routines
  1186.  */
  1187.  
  1188. void RPC_ENTRY 
  1189. NdrSimpleTypeUnmarshall( 
  1190.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1191.     unsigned char __RPC_FAR *           pMemory, 
  1192.     unsigned char                       FormatChar
  1193.     );
  1194.  
  1195. unsigned char __RPC_FAR * RPC_ENTRY 
  1196. NdrPointerUnmarshall( 
  1197.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1198.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1199.     PFORMAT_STRING                          pFormat,
  1200.     unsigned char                           fMustAlloc
  1201.     );
  1202.  
  1203. /* Structures */
  1204.  
  1205. unsigned char __RPC_FAR * RPC_ENTRY
  1206. NdrSimpleStructUnmarshall( 
  1207.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1208.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1209.     PFORMAT_STRING                          pFormat,
  1210.     unsigned char                           fMustAlloc 
  1211.     );
  1212.  
  1213. unsigned char __RPC_FAR * RPC_ENTRY
  1214. NdrConformantStructUnmarshall( 
  1215.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1216.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1217.     PFORMAT_STRING                          pFormat,
  1218.     unsigned char                           fMustAlloc 
  1219.     );
  1220.  
  1221. unsigned char __RPC_FAR * RPC_ENTRY
  1222. NdrConformantVaryingStructUnmarshall( 
  1223.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1224.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1225.     PFORMAT_STRING                          pFormat,
  1226.     unsigned char                           fMustAlloc 
  1227.     );
  1228.  
  1229. unsigned char __RPC_FAR * RPC_ENTRY 
  1230. NdrHardStructUnmarshall( 
  1231.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1232.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1233.     PFORMAT_STRING                          pFormat,
  1234.     unsigned char                           fMustAlloc 
  1235.     );
  1236.  
  1237. unsigned char __RPC_FAR * RPC_ENTRY 
  1238. NdrComplexStructUnmarshall( 
  1239.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1240.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1241.     PFORMAT_STRING                          pFormat,
  1242.     unsigned char                           fMustAlloc 
  1243.     );
  1244.  
  1245. /* Arrays */
  1246.  
  1247. unsigned char __RPC_FAR * RPC_ENTRY
  1248. NdrFixedArrayUnmarshall( 
  1249.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1250.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1251.     PFORMAT_STRING                          pFormat,
  1252.     unsigned char                           fMustAlloc 
  1253.     );
  1254.  
  1255. unsigned char __RPC_FAR * RPC_ENTRY
  1256. NdrConformantArrayUnmarshall( 
  1257.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1258.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1259.     PFORMAT_STRING                          pFormat,
  1260.     unsigned char                           fMustAlloc 
  1261.     );
  1262.  
  1263. unsigned char __RPC_FAR * RPC_ENTRY
  1264. NdrConformantVaryingArrayUnmarshall( 
  1265.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1266.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1267.     PFORMAT_STRING                          pFormat,
  1268.     unsigned char                           fMustAlloc 
  1269.     );
  1270.  
  1271. unsigned char __RPC_FAR * RPC_ENTRY
  1272. NdrVaryingArrayUnmarshall( 
  1273.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1274.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1275.     PFORMAT_STRING                          pFormat,
  1276.     unsigned char                           fMustAlloc 
  1277.     );
  1278.  
  1279. unsigned char __RPC_FAR * RPC_ENTRY
  1280. NdrComplexArrayUnmarshall( 
  1281.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1282.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1283.     PFORMAT_STRING                          pFormat,   
  1284.     unsigned char                           fMustAlloc 
  1285.     );
  1286.  
  1287. /* Strings */
  1288.  
  1289. unsigned char __RPC_FAR * RPC_ENTRY
  1290. NdrNonConformantStringUnmarshall( 
  1291.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1292.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1293.     PFORMAT_STRING                          pFormat,
  1294.     unsigned char                           fMustAlloc 
  1295.     );
  1296.  
  1297. unsigned char __RPC_FAR * RPC_ENTRY
  1298. NdrConformantStringUnmarshall( 
  1299.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1300.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1301.     PFORMAT_STRING                          pFormat,   
  1302.     unsigned char                           fMustAlloc 
  1303.     );
  1304.  
  1305. /* Unions */
  1306.  
  1307. unsigned char __RPC_FAR * RPC_ENTRY
  1308. NdrEncapsulatedUnionUnmarshall( 
  1309.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1310.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1311.     PFORMAT_STRING                          pFormat,   
  1312.     unsigned char                           fMustAlloc 
  1313.     );
  1314.  
  1315. unsigned char __RPC_FAR * RPC_ENTRY
  1316. NdrNonEncapsulatedUnionUnmarshall( 
  1317.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1318.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1319.     PFORMAT_STRING                          pFormat,   
  1320.     unsigned char                           fMustAlloc 
  1321.     );
  1322.  
  1323. /* Byte count pointer */
  1324.  
  1325. unsigned char __RPC_FAR * RPC_ENTRY 
  1326. NdrByteCountPointerUnmarshall( 
  1327.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1328.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1329.     PFORMAT_STRING                          pFormat,   
  1330.     unsigned char                           fMustAlloc
  1331.     );
  1332.  
  1333. /* Transmit as and represent as*/
  1334.  
  1335. unsigned char __RPC_FAR * RPC_ENTRY 
  1336. NdrXmitOrRepAsUnmarshall( 
  1337.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1338.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1339.     PFORMAT_STRING                          pFormat,   
  1340.     unsigned char                           fMustAlloc
  1341.     );
  1342.  
  1343. /* Cairo interface pointer */
  1344.  
  1345. unsigned char __RPC_FAR * RPC_ENTRY 
  1346. NdrInterfacePointerUnmarshall( 
  1347.     PMIDL_STUB_MESSAGE                      pStubMsg, 
  1348.     unsigned char __RPC_FAR * __RPC_FAR *   ppMemory, 
  1349.     PFORMAT_STRING                          pFormat,   
  1350.     unsigned char                           fMustAlloc
  1351.     );
  1352.  
  1353. /* Context handles */
  1354.  
  1355. void RPC_ENTRY
  1356. NdrClientContextUnmarshall( 
  1357.     PMIDL_STUB_MESSAGE          pStubMsg,
  1358.     NDR_CCONTEXT __RPC_FAR *    pContextHandle,
  1359.     RPC_BINDING_HANDLE          BindHandle 
  1360.     );
  1361.  
  1362. NDR_SCONTEXT RPC_ENTRY
  1363. NdrServerContextUnmarshall( 
  1364.     PMIDL_STUB_MESSAGE          pStubMsg 
  1365.     );
  1366.  
  1367. /*
  1368.  * Buffer sizing routines
  1369.  */
  1370.  
  1371. void RPC_ENTRY
  1372. NdrPointerBufferSize(
  1373.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1374.     unsigned char __RPC_FAR *           pMemory, 
  1375.     PFORMAT_STRING                      pFormat   
  1376.     );
  1377.  
  1378. /* Structures */
  1379.  
  1380. void RPC_ENTRY
  1381. NdrSimpleStructBufferSize( 
  1382.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1383.     unsigned char __RPC_FAR *           pMemory, 
  1384.     PFORMAT_STRING                      pFormat   
  1385.     );
  1386.  
  1387. void RPC_ENTRY 
  1388. NdrConformantStructBufferSize( 
  1389.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1390.     unsigned char __RPC_FAR *           pMemory, 
  1391.     PFORMAT_STRING                      pFormat   
  1392.     );
  1393.  
  1394. void RPC_ENTRY 
  1395. NdrConformantVaryingStructBufferSize( 
  1396.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1397.     unsigned char __RPC_FAR *           pMemory, 
  1398.     PFORMAT_STRING                      pFormat   
  1399.     );
  1400.  
  1401. void RPC_ENTRY 
  1402. NdrHardStructBufferSize( 
  1403.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1404.     unsigned char __RPC_FAR *           pMemory, 
  1405.     PFORMAT_STRING                      pFormat   
  1406.     );
  1407.  
  1408. void RPC_ENTRY 
  1409. NdrComplexStructBufferSize( 
  1410.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1411.     unsigned char __RPC_FAR *           pMemory, 
  1412.     PFORMAT_STRING                      pFormat   
  1413.     );
  1414.  
  1415. /* Arrays */
  1416.  
  1417. void RPC_ENTRY 
  1418. NdrFixedArrayBufferSize( 
  1419.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1420.     unsigned char __RPC_FAR *           pMemory, 
  1421.     PFORMAT_STRING                      pFormat   
  1422.     );
  1423.  
  1424. void RPC_ENTRY 
  1425. NdrConformantArrayBufferSize( 
  1426.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1427.     unsigned char __RPC_FAR *           pMemory, 
  1428.     PFORMAT_STRING                      pFormat   
  1429.     );
  1430.  
  1431. void RPC_ENTRY 
  1432. NdrConformantVaryingArrayBufferSize( 
  1433.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1434.     unsigned char __RPC_FAR *           pMemory, 
  1435.     PFORMAT_STRING                      pFormat   
  1436.     );
  1437.  
  1438. void RPC_ENTRY 
  1439. NdrVaryingArrayBufferSize( 
  1440.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1441.     unsigned char __RPC_FAR *           pMemory, 
  1442.     PFORMAT_STRING                      pFormat   
  1443.     );
  1444.  
  1445. void RPC_ENTRY
  1446. NdrComplexArrayBufferSize( 
  1447.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1448.     unsigned char __RPC_FAR *           pMemory, 
  1449.     PFORMAT_STRING                      pFormat   
  1450.     );
  1451.  
  1452. /* Strings */
  1453.  
  1454. void RPC_ENTRY 
  1455. NdrConformantStringBufferSize( 
  1456.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1457.     unsigned char __RPC_FAR *           pMemory, 
  1458.     PFORMAT_STRING                      pFormat   
  1459.     );
  1460.  
  1461. void RPC_ENTRY 
  1462. NdrNonConformantStringBufferSize( 
  1463.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1464.     unsigned char __RPC_FAR *           pMemory, 
  1465.     PFORMAT_STRING                      pFormat   
  1466.     );
  1467.  
  1468. /* Unions */
  1469.  
  1470. void RPC_ENTRY 
  1471. NdrEncapsulatedUnionBufferSize( 
  1472.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1473.     unsigned char __RPC_FAR *           pMemory, 
  1474.     PFORMAT_STRING                      pFormat   
  1475.     );
  1476.  
  1477. void RPC_ENTRY 
  1478. NdrNonEncapsulatedUnionBufferSize( 
  1479.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1480.     unsigned char __RPC_FAR *           pMemory, 
  1481.     PFORMAT_STRING                      pFormat   
  1482.     );
  1483.  
  1484. /* Byte count pointer */
  1485.  
  1486. void RPC_ENTRY
  1487. NdrByteCountPointerBufferSize(
  1488.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1489.     unsigned char __RPC_FAR *           pMemory, 
  1490.     PFORMAT_STRING                      pFormat   
  1491.     );
  1492.  
  1493. /* Transmit as and represent as*/
  1494.  
  1495. void RPC_ENTRY
  1496. NdrXmitOrRepAsBufferSize(
  1497.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1498.     unsigned char __RPC_FAR *           pMemory, 
  1499.     PFORMAT_STRING                      pFormat   
  1500.     );
  1501.  
  1502. /* Cairo Interface pointer */
  1503.  
  1504. void RPC_ENTRY
  1505. NdrInterfacePointerBufferSize(
  1506.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1507.     unsigned char __RPC_FAR *           pMemory, 
  1508.     PFORMAT_STRING                      pFormat   
  1509.     );
  1510.  
  1511. // Context Handle size
  1512. //
  1513. void RPC_ENTRY
  1514. NdrContextHandleSize(
  1515.     PMIDL_STUB_MESSAGE          pStubMsg,
  1516.     unsigned char __RPC_FAR *           pMemory, 
  1517.     PFORMAT_STRING                      pFormat   
  1518.     );
  1519.  
  1520. /*
  1521.  * Memory sizing routines
  1522.  */
  1523.  
  1524. unsigned long RPC_ENTRY
  1525. NdrPointerMemorySize(
  1526.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1527.     PFORMAT_STRING                      pFormat
  1528.     );
  1529.  
  1530. /* Structures */
  1531.  
  1532. unsigned long RPC_ENTRY
  1533. NdrSimpleStructMemorySize( 
  1534.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1535.     PFORMAT_STRING                      pFormat
  1536.     );
  1537.  
  1538. unsigned long RPC_ENTRY 
  1539. NdrConformantStructMemorySize( 
  1540.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1541.     PFORMAT_STRING                      pFormat
  1542.     );
  1543.  
  1544. unsigned long RPC_ENTRY 
  1545. NdrConformantVaryingStructMemorySize( 
  1546.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1547.     PFORMAT_STRING                      pFormat
  1548.     );
  1549.  
  1550. unsigned long RPC_ENTRY 
  1551. NdrHardStructMemorySize( 
  1552.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1553.     PFORMAT_STRING                      pFormat
  1554.     );
  1555.  
  1556. unsigned long RPC_ENTRY 
  1557. NdrComplexStructMemorySize( 
  1558.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1559.     PFORMAT_STRING                      pFormat
  1560.     );
  1561.  
  1562. /* Arrays */
  1563.  
  1564. unsigned long RPC_ENTRY 
  1565. NdrFixedArrayMemorySize( 
  1566.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1567.     PFORMAT_STRING                      pFormat
  1568.     );
  1569.  
  1570. unsigned long RPC_ENTRY 
  1571. NdrConformantArrayMemorySize( 
  1572.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1573.     PFORMAT_STRING                      pFormat
  1574.     );
  1575.  
  1576. unsigned long RPC_ENTRY 
  1577. NdrConformantVaryingArrayMemorySize( 
  1578.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1579.     PFORMAT_STRING                      pFormat
  1580.     );
  1581.  
  1582. unsigned long RPC_ENTRY 
  1583. NdrVaryingArrayMemorySize( 
  1584.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1585.     PFORMAT_STRING                      pFormat
  1586.     );
  1587.  
  1588. unsigned long RPC_ENTRY 
  1589. NdrComplexArrayMemorySize( 
  1590.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1591.     PFORMAT_STRING                      pFormat
  1592.     );
  1593.  
  1594. /* Strings */
  1595.  
  1596. unsigned long RPC_ENTRY 
  1597. NdrConformantStringMemorySize( 
  1598.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1599.     PFORMAT_STRING                      pFormat
  1600.     );
  1601.  
  1602. unsigned long RPC_ENTRY 
  1603. NdrNonConformantStringMemorySize( 
  1604.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1605.     PFORMAT_STRING                      pFormat
  1606.     );
  1607.  
  1608. /* Unions */
  1609.  
  1610. unsigned long RPC_ENTRY 
  1611. NdrEncapsulatedUnionMemorySize( 
  1612.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1613.     PFORMAT_STRING                      pFormat
  1614.     );
  1615.  
  1616. unsigned long RPC_ENTRY 
  1617. NdrNonEncapsulatedUnionMemorySize( 
  1618.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1619.     PFORMAT_STRING                      pFormat
  1620.     );
  1621.  
  1622. /* Transmit as and represent as*/
  1623.  
  1624. unsigned long RPC_ENTRY
  1625. NdrXmitOrRepAsMemorySize(
  1626.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1627.     PFORMAT_STRING                      pFormat
  1628.     );
  1629.  
  1630. /* Cairo Interface pointer */
  1631.  
  1632. unsigned long RPC_ENTRY
  1633. NdrInterfacePointerMemorySize(
  1634.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1635.     PFORMAT_STRING                      pFormat
  1636.     );
  1637.  
  1638. /*
  1639.  * Freeing routines
  1640.  */
  1641.  
  1642. void RPC_ENTRY
  1643. NdrPointerFree(
  1644.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1645.     unsigned char __RPC_FAR *           pMemory, 
  1646.     PFORMAT_STRING                      pFormat   
  1647.     );
  1648.  
  1649. /* Structures */
  1650.  
  1651. void RPC_ENTRY 
  1652. NdrSimpleStructFree( 
  1653.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1654.     unsigned char __RPC_FAR *           pMemory, 
  1655.     PFORMAT_STRING                      pFormat   
  1656.     );
  1657.  
  1658. void RPC_ENTRY 
  1659. NdrConformantStructFree( 
  1660.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1661.     unsigned char __RPC_FAR *           pMemory, 
  1662.     PFORMAT_STRING                      pFormat   
  1663.     );
  1664.  
  1665. void RPC_ENTRY 
  1666. NdrConformantVaryingStructFree( 
  1667.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1668.     unsigned char __RPC_FAR *           pMemory, 
  1669.     PFORMAT_STRING                      pFormat   
  1670.     );
  1671.  
  1672. void RPC_ENTRY
  1673. NdrHardStructFree( 
  1674.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1675.     unsigned char __RPC_FAR *           pMemory, 
  1676.     PFORMAT_STRING                      pFormat   
  1677.     );
  1678.  
  1679. void RPC_ENTRY
  1680. NdrComplexStructFree( 
  1681.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1682.     unsigned char __RPC_FAR *           pMemory, 
  1683.     PFORMAT_STRING                      pFormat   
  1684.     );
  1685.  
  1686. /* Arrays */
  1687.  
  1688. void RPC_ENTRY 
  1689. NdrFixedArrayFree( 
  1690.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1691.     unsigned char __RPC_FAR *           pMemory, 
  1692.     PFORMAT_STRING                      pFormat   
  1693.     );
  1694.  
  1695. void RPC_ENTRY 
  1696. NdrConformantArrayFree( 
  1697.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1698.     unsigned char __RPC_FAR *           pMemory, 
  1699.     PFORMAT_STRING                      pFormat   
  1700.     );
  1701.  
  1702. void RPC_ENTRY 
  1703. NdrConformantVaryingArrayFree( 
  1704.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1705.     unsigned char __RPC_FAR *           pMemory, 
  1706.     PFORMAT_STRING                      pFormat   
  1707.     );
  1708.  
  1709. void RPC_ENTRY 
  1710. NdrVaryingArrayFree( 
  1711.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1712.     unsigned char __RPC_FAR *           pMemory, 
  1713.     PFORMAT_STRING                      pFormat   
  1714.     );
  1715.  
  1716. void RPC_ENTRY 
  1717. NdrComplexArrayFree( 
  1718.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1719.     unsigned char __RPC_FAR *           pMemory, 
  1720.     PFORMAT_STRING                      pFormat   
  1721.     );
  1722.  
  1723. /* Unions */
  1724.  
  1725. void RPC_ENTRY 
  1726. NdrEncapsulatedUnionFree( 
  1727.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1728.     unsigned char __RPC_FAR *           pMemory, 
  1729.     PFORMAT_STRING                      pFormat   
  1730.     );
  1731.  
  1732. void RPC_ENTRY 
  1733. NdrNonEncapsulatedUnionFree(  
  1734.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1735.     unsigned char __RPC_FAR *           pMemory, 
  1736.     PFORMAT_STRING                      pFormat   
  1737.     );
  1738.  
  1739. /* Byte count */
  1740.  
  1741. void RPC_ENTRY 
  1742. NdrByteCountPointerFree( 
  1743.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1744.     unsigned char __RPC_FAR *           pMemory, 
  1745.     PFORMAT_STRING                      pFormat   
  1746.     );
  1747.  
  1748. /* Transmit as and represent as*/
  1749.  
  1750. void RPC_ENTRY 
  1751. NdrXmitOrRepAsFree( 
  1752.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1753.     unsigned char __RPC_FAR *           pMemory, 
  1754.     PFORMAT_STRING                      pFormat   
  1755.     );
  1756.  
  1757. /* Cairo Interface pointer */
  1758.  
  1759. void RPC_ENTRY 
  1760. NdrInterfacePointerFree( 
  1761.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1762.     unsigned char __RPC_FAR *           pMemory, 
  1763.     PFORMAT_STRING                      pFormat   
  1764.     );
  1765.  
  1766. /*
  1767.  * Endian conversion routine.
  1768.  */
  1769.  
  1770. void RPC_ENTRY 
  1771. NdrConvert( 
  1772.     PMIDL_STUB_MESSAGE                  pStubMsg, 
  1773.     PFORMAT_STRING                      pFormat   
  1774.     );
  1775.  
  1776. /* 
  1777.  * Auxilary routines
  1778.  */
  1779.  
  1780. void RPC_ENTRY 
  1781. NdrClientInitializeNew( 
  1782.     PRPC_MESSAGE                        pRpcMsg,
  1783.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1784.     PMIDL_STUB_DESC                     pStubDescriptor,
  1785.     unsigned int                        ProcNum
  1786.     );
  1787.  
  1788. unsigned char __RPC_FAR * RPC_ENTRY
  1789. NdrServerInitializeNew( 
  1790.     PRPC_MESSAGE                        pRpcMsg,
  1791.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1792.     PMIDL_STUB_DESC                     pStubDescriptor
  1793.     );
  1794.  
  1795. void RPC_ENTRY 
  1796. NdrClientInitialize( 
  1797.     PRPC_MESSAGE                        pRpcMsg,
  1798.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1799.     PMIDL_STUB_DESC                     pStubDescriptor,
  1800.     unsigned int                        ProcNum
  1801.     );
  1802.  
  1803. unsigned char __RPC_FAR * RPC_ENTRY
  1804. NdrServerInitialize( 
  1805.     PRPC_MESSAGE                        pRpcMsg,
  1806.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1807.     PMIDL_STUB_DESC                     pStubDescriptor
  1808.     );
  1809.  
  1810. unsigned char __RPC_FAR * RPC_ENTRY
  1811. NdrServerInitializeUnmarshall ( 
  1812.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1813.     PMIDL_STUB_DESC                     pStubDescriptor,
  1814.     PRPC_MESSAGE                        pRpcMsg 
  1815.     );
  1816.  
  1817. void RPC_ENTRY
  1818. NdrServerInitializeMarshall ( 
  1819.     PRPC_MESSAGE                        pRpcMsg,
  1820.     PMIDL_STUB_MESSAGE                  pStubMsg 
  1821.     );
  1822.  
  1823. unsigned char __RPC_FAR * RPC_ENTRY
  1824. NdrGetBuffer( 
  1825.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1826.     unsigned long                       BufferLength,
  1827.     RPC_BINDING_HANDLE                  Handle
  1828.     );
  1829.  
  1830. unsigned char __RPC_FAR * RPC_ENTRY
  1831. NdrNsGetBuffer( 
  1832.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1833.     unsigned long                       BufferLength,
  1834.     RPC_BINDING_HANDLE                  Handle
  1835.     );
  1836.  
  1837. unsigned char __RPC_FAR * RPC_ENTRY
  1838. NdrSendReceive(
  1839.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1840.     unsigned char __RPC_FAR*                        pBufferEnd
  1841.     );
  1842.  
  1843. unsigned char __RPC_FAR * RPC_ENTRY
  1844. NdrNsSendReceive(
  1845.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1846.     unsigned char __RPC_FAR *                       pBufferEnd,
  1847.     RPC_BINDING_HANDLE __RPC_FAR *              pAutoHandle
  1848.     );
  1849.  
  1850. void RPC_ENTRY
  1851. NdrFreeBuffer(
  1852.     PMIDL_STUB_MESSAGE                  pStubMsg
  1853.     );
  1854.  
  1855. /* 
  1856.  * Interpeter calls.
  1857.  */
  1858.  
  1859. /* client */
  1860.  
  1861. CLIENT_CALL_RETURN RPC_VAR_ENTRY
  1862. NdrClientCall( 
  1863.     PMIDL_STUB_DESC                     pStubDescriptor,
  1864.     PFORMAT_STRING                      pFormat,
  1865.     ...
  1866.     );
  1867.  
  1868. /* server */
  1869. typedef enum {
  1870.     STUB_UNMARSHAL,
  1871.     STUB_CALL_SERVER,
  1872.     STUB_MARSHAL,
  1873.     STUB_CALL_SERVER_NO_HRESULT
  1874. }STUB_PHASE;
  1875.  
  1876. typedef enum {
  1877.     PROXY_CALCSIZE,
  1878.     PROXY_GETBUFFER,
  1879.     PROXY_MARSHAL,
  1880.     PROXY_SENDRECEIVE,
  1881.     PROXY_UNMARSHAL
  1882. }PROXY_PHASE;
  1883.  
  1884. #if __IBMC__
  1885. /* C compiler wants this structure declared */
  1886. struct IRpcStubBuffer;
  1887. #endif
  1888.  
  1889. long RPC_ENTRY
  1890. NdrStubCall (
  1891.     struct IRpcStubBuffer __RPC_FAR *    pThis,
  1892.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  1893.     PRPC_MESSAGE                         pRpcMsg,
  1894.     unsigned long __RPC_FAR *            pdwStubPhase
  1895.     );
  1896.  
  1897. void RPC_ENTRY
  1898. NdrServerCall(
  1899.     PRPC_MESSAGE                        pRpcMsg
  1900.     );
  1901.  
  1902. int RPC_ENTRY
  1903. NdrServerUnmarshall( 
  1904.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  1905.     PRPC_MESSAGE                         pRpcMsg,
  1906.     PMIDL_STUB_MESSAGE                   pStubMsg,
  1907.     PMIDL_STUB_DESC                      pStubDescriptor,
  1908.     PFORMAT_STRING                       pFormat,
  1909.     void __RPC_FAR *                     pParamList
  1910.     );
  1911.  
  1912. void RPC_ENTRY
  1913. NdrServerMarshall(
  1914.     struct IRpcStubBuffer __RPC_FAR *    pThis,
  1915.     struct IRpcChannelBuffer __RPC_FAR * pChannel,
  1916.     PMIDL_STUB_MESSAGE                   pStubMsg,
  1917.     PFORMAT_STRING                       pFormat
  1918.     );
  1919.  
  1920. /* Comm and Fault status */
  1921.  
  1922. RPC_STATUS RPC_ENTRY
  1923. NdrMapCommAndFaultStatus(
  1924.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1925.     unsigned long __RPC_FAR *                       pCommStatus,
  1926.     unsigned long __RPC_FAR *                       pFaultStatus,
  1927.     RPC_STATUS                          Status
  1928.     );
  1929.  
  1930. /* Helper routines */
  1931.  
  1932. int RPC_ENTRY
  1933. NdrSH_UPDecision(
  1934.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1935.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1936.     RPC_BUFPTR                          pBuffer
  1937.     );
  1938.  
  1939. int RPC_ENTRY
  1940. NdrSH_TLUPDecision(
  1941.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1942.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem
  1943.     );
  1944.  
  1945. int RPC_ENTRY
  1946. NdrSH_TLUPDecisionBuffer(
  1947.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1948.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem
  1949.     );
  1950.  
  1951. int RPC_ENTRY
  1952. NdrSH_IfAlloc(
  1953.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1954.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1955.     unsigned long                       Count
  1956.     );
  1957.  
  1958. int RPC_ENTRY
  1959. NdrSH_IfAllocRef(
  1960.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1961.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1962.     unsigned long                       Count
  1963.     );
  1964.  
  1965. int RPC_ENTRY
  1966. NdrSH_IfAllocSet(
  1967.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1968.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1969.     unsigned long                       Count
  1970.     );
  1971.  
  1972. RPC_BUFPTR RPC_ENTRY
  1973. NdrSH_IfCopy(
  1974.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1975.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1976.     unsigned long                       Count
  1977.     );
  1978.  
  1979. RPC_BUFPTR RPC_ENTRY
  1980. NdrSH_IfAllocCopy(
  1981.     PMIDL_STUB_MESSAGE                  pStubMsg,
  1982.     unsigned char           __RPC_FAR *__RPC_FAR *          pPtrInMem,
  1983.     unsigned long                       Count
  1984.     );
  1985.  
  1986. unsigned long RPC_ENTRY
  1987. NdrSH_Copy(
  1988.     unsigned char           __RPC_FAR *         pStubMsg,
  1989.     unsigned char           __RPC_FAR *         pPtrInMem,
  1990.     unsigned long                       Count
  1991.     );
  1992.  
  1993. void RPC_ENTRY
  1994. NdrSH_IfFree(
  1995.     PMIDL_STUB_MESSAGE                  pMessage,
  1996.     unsigned char           __RPC_FAR *         pPtr );
  1997.  
  1998.  
  1999. RPC_BUFPTR  RPC_ENTRY
  2000. NdrSH_StringMarshall(
  2001.     PMIDL_STUB_MESSAGE                  pMessage,
  2002.     unsigned char           __RPC_FAR *         pMemory,
  2003.     unsigned long                       Count,
  2004.     int                                 Size );
  2005.  
  2006. RPC_BUFPTR  RPC_ENTRY
  2007. NdrSH_StringUnMarshall(
  2008.     PMIDL_STUB_MESSAGE                  pMessage,
  2009.     unsigned char           __RPC_FAR *__RPC_FAR *          pMemory,
  2010.     int                                 Size );
  2011.  
  2012. /****************************************************************************
  2013.     MIDL 2.0 memory package: rpc_ss_* rpc_sm_*
  2014.  ****************************************************************************/
  2015.  
  2016. typedef void __RPC_FAR * RPC_SS_THREAD_HANDLE;
  2017.  
  2018. typedef void __RPC_FAR * __RPC_API 
  2019. RPC_CLIENT_ALLOC (
  2020.     IN size_t Size
  2021.     );
  2022.  
  2023. typedef void __RPC_API 
  2024. RPC_CLIENT_FREE (
  2025.     IN void __RPC_FAR * Ptr
  2026.     );
  2027.  
  2028. /*++
  2029.      RpcSs* package
  2030. --*/
  2031.  
  2032. void __RPC_FAR * RPC_ENTRY
  2033. RpcSsAllocate (
  2034.     IN size_t Size
  2035.     );
  2036.  
  2037. void RPC_ENTRY
  2038. RpcSsDisableAllocate (
  2039.     void
  2040.     );
  2041.  
  2042. void RPC_ENTRY
  2043. RpcSsEnableAllocate (
  2044.     void
  2045.     );
  2046.  
  2047. void RPC_ENTRY
  2048. RpcSsFree (
  2049.     IN void __RPC_FAR * NodeToFree
  2050.     );
  2051.  
  2052. RPC_SS_THREAD_HANDLE RPC_ENTRY
  2053. RpcSsGetThreadHandle (
  2054.     void
  2055.     );
  2056.  
  2057. void RPC_ENTRY
  2058. RpcSsSetClientAllocFree (
  2059.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2060.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree
  2061.     );
  2062.  
  2063. void RPC_ENTRY
  2064. RpcSsSetThreadHandle (
  2065.     IN RPC_SS_THREAD_HANDLE Id
  2066.     );
  2067.  
  2068. void RPC_ENTRY
  2069. RpcSsSwapClientAllocFree (
  2070.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2071.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree,
  2072.     OUT RPC_CLIENT_ALLOC __RPC_FAR * __RPC_FAR * OldClientAlloc,
  2073.     OUT RPC_CLIENT_FREE __RPC_FAR * __RPC_FAR * OldClientFree
  2074.     );
  2075.  
  2076. /*++
  2077.      RpcSm* package
  2078. --*/
  2079.  
  2080. void __RPC_FAR * RPC_ENTRY
  2081. RpcSmAllocate (
  2082.     IN  size_t          Size,
  2083.     OUT RPC_STATUS __RPC_FAR *    pStatus
  2084.     );
  2085.  
  2086. RPC_STATUS RPC_ENTRY
  2087. RpcSmClientFree (
  2088.     IN  void __RPC_FAR * pNodeToFree
  2089.     );
  2090.  
  2091. RPC_STATUS  RPC_ENTRY
  2092. RpcSmDestroyClientContext (
  2093.     IN void __RPC_FAR * __RPC_FAR * ContextHandle
  2094.     );
  2095.  
  2096. RPC_STATUS  RPC_ENTRY
  2097. RpcSmDisableAllocate (
  2098.     void
  2099.     );
  2100.  
  2101. RPC_STATUS  RPC_ENTRY
  2102. RpcSmEnableAllocate (
  2103.     void
  2104.     );
  2105.  
  2106. RPC_STATUS  RPC_ENTRY
  2107. RpcSmFree (
  2108.     IN void __RPC_FAR * NodeToFree
  2109.     );
  2110.  
  2111. RPC_SS_THREAD_HANDLE RPC_ENTRY
  2112. RpcSmGetThreadHandle (
  2113.     OUT RPC_STATUS __RPC_FAR *    pStatus
  2114.     );
  2115.  
  2116. RPC_STATUS  RPC_ENTRY
  2117. RpcSmSetClientAllocFree (
  2118.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2119.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree
  2120.     );
  2121.  
  2122. RPC_STATUS  RPC_ENTRY
  2123. RpcSmSetThreadHandle (
  2124.     IN RPC_SS_THREAD_HANDLE Id
  2125.     );
  2126.  
  2127. RPC_STATUS  RPC_ENTRY
  2128. RpcSmSwapClientAllocFree (
  2129.     IN RPC_CLIENT_ALLOC __RPC_FAR * ClientAlloc,
  2130.     IN RPC_CLIENT_FREE __RPC_FAR * ClientFree,
  2131.     OUT RPC_CLIENT_ALLOC __RPC_FAR * __RPC_FAR * OldClientAlloc,
  2132.     OUT RPC_CLIENT_FREE __RPC_FAR * __RPC_FAR * OldClientFree
  2133.     );
  2134.  
  2135. /*++
  2136.      Ndr stub entry points
  2137. --*/
  2138.  
  2139. void RPC_ENTRY
  2140. NdrRpcSsEnableAllocate(
  2141.     PMIDL_STUB_MESSAGE      pMessage );
  2142.  
  2143. void RPC_ENTRY
  2144. NdrRpcSsDisableAllocate(
  2145.     PMIDL_STUB_MESSAGE      pMessage );
  2146.  
  2147. void RPC_ENTRY
  2148. NdrRpcSmSetClientToOsf(
  2149.     PMIDL_STUB_MESSAGE      pMessage );
  2150.  
  2151. void __RPC_FAR *  RPC_ENTRY
  2152. NdrRpcSmClientAllocate (
  2153.     IN size_t Size
  2154.     );
  2155.  
  2156. void  RPC_ENTRY
  2157. NdrRpcSmClientFree (
  2158.     IN void __RPC_FAR * NodeToFree
  2159.     );
  2160.  
  2161. void __RPC_FAR *  RPC_ENTRY
  2162. NdrRpcSsDefaultAllocate (
  2163.     IN size_t Size
  2164.     );
  2165.  
  2166. void  RPC_ENTRY
  2167. NdrRpcSsDefaultFree (
  2168.     IN void __RPC_FAR * NodeToFree
  2169.     );
  2170.  
  2171. /****************************************************************************
  2172.     end of memory package: rpc_ss_* rpc_sm_*
  2173.  ****************************************************************************/
  2174.  
  2175. /****************************************************************************
  2176.  * Full Pointer APIs
  2177.  ****************************************************************************/
  2178.  
  2179. PFULL_PTR_XLAT_TABLES RPC_ENTRY
  2180. NdrFullPointerXlatInit( 
  2181.     unsigned long           NumberOfPointers,
  2182.     XLAT_SIDE               XlatSide
  2183.     );
  2184.  
  2185. void RPC_ENTRY
  2186. NdrFullPointerXlatFree( 
  2187.     PFULL_PTR_XLAT_TABLES   pXlatTables
  2188.     );
  2189.  
  2190. int RPC_ENTRY
  2191. NdrFullPointerQueryPointer( 
  2192.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2193.     void __RPC_FAR *                    pPointer,
  2194.     unsigned char           QueryType,
  2195.     unsigned long __RPC_FAR *           pRefId
  2196.     );
  2197.  
  2198. int RPC_ENTRY
  2199. NdrFullPointerQueryRefId( 
  2200.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2201.     unsigned long           RefId,
  2202.     unsigned char           QueryType,
  2203.     void __RPC_FAR *__RPC_FAR *                 ppPointer
  2204.     );
  2205.  
  2206. void RPC_ENTRY
  2207. NdrFullPointerInsertRefId( 
  2208.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2209.     unsigned long           RefId,
  2210.     void __RPC_FAR *                    pPointer
  2211.     );
  2212.  
  2213. int RPC_ENTRY
  2214. NdrFullPointerFree( 
  2215.     PFULL_PTR_XLAT_TABLES   pXlatTables,
  2216.     void __RPC_FAR *                    Pointer
  2217.     );
  2218.  
  2219. void __RPC_FAR *  RPC_ENTRY
  2220. NdrAllocate( 
  2221.     PMIDL_STUB_MESSAGE      pStubMsg,
  2222.     size_t                  Len 
  2223.     );
  2224.  
  2225. void RPC_ENTRY
  2226. NdrClearOutParameters(
  2227.     PMIDL_STUB_MESSAGE      pStubMsg,
  2228.     PFORMAT_STRING          pFormat,
  2229.     void __RPC_FAR *        ArgAddr
  2230.     );
  2231.  
  2232.  
  2233. /****************************************************************************
  2234.  * Proxy APIs
  2235.  ****************************************************************************/
  2236.  
  2237. void __RPC_FAR * RPC_ENTRY
  2238. NdrOleAllocate (
  2239.     IN size_t Size
  2240.     );
  2241.  
  2242. void RPC_ENTRY
  2243. NdrOleFree (
  2244.     IN void __RPC_FAR * NodeToFree
  2245.     );
  2246.  
  2247. #ifdef CONST_VTABLE
  2248. #define CONST_VTBL const
  2249. #else
  2250. #define CONST_VTBL
  2251. #endif
  2252.  
  2253.  
  2254.  
  2255.  
  2256. #ifdef __cplusplus
  2257. }
  2258. #endif
  2259.  
  2260. // Reset the packing level for DOS, Windows and Mac.
  2261.  
  2262. #if defined(__RPC_DOS__) || defined(__RPC_WIN16__) || defined(__RPC_MAC__)
  2263. #pragma pack()
  2264. #endif
  2265.  
  2266. #endif /* __RPCNDR_H__ */
  2267.