home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / RPCNDR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  77.6 KB  |  3,083 lines

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