Advertisement
Thunder-Menu

rpcndr.h

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