home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / RTLWIN32.PAK / RPCNDR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  75.2 KB  |  2,644 lines

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