home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / RPCNDR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  64.9 KB  |  2,285 lines

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