home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / rpcndr.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  79KB  |  3,076 lines

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