Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2286 lines
63 KiB

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