Leaked source code of windows server 2003
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.

715 lines
20 KiB

  1. /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright <c> 1993-2000 Microsoft Corporation
  3. Module Name :
  4. ndrp.h
  5. Abtract :
  6. Contains private definitions for Ndr64 files in this directory. This
  7. file is included by all source files in this directory.
  8. Author :
  9. David Kays dkays October 1993
  10. Revision History :
  11. --------------------------------------------------------------------*/
  12. #ifndef _NDRP_
  13. #define _NDRP_
  14. #include <sysinc.h>
  15. #include "rpc.h"
  16. #include "rpcndr.h"
  17. // Get new token definitions for 64b.
  18. #define RPC_NDR_64
  19. #include "ndrtypes.h"
  20. #include "ndr64types.h"
  21. #include "..\ndr20\ndrpall.h"
  22. // Jump table defines
  23. //
  24. // Marshal jump tables
  25. //
  26. typedef void (* PNDR64_MARSHALL_ROUTINE)(
  27. PMIDL_STUB_MESSAGE,
  28. uchar *,
  29. PNDR64_FORMAT
  30. );
  31. extern PNDR64_MARSHALL_ROUTINE const Ndr64MarshallRoutinesTable[];
  32. extern PNDR64_MARSHALL_ROUTINE const Ndr64EmbeddedMarshallRoutinesTable[];
  33. extern PSIMPLETYPE_MARSHAL_ROUTINE const Ndr64SimpleTypeMarshallRoutinesTable[] ;
  34. inline void
  35. Ndr64TopLevelTypeMarshall(
  36. PMIDL_STUB_MESSAGE pStubMsg,
  37. uchar * pMemory,
  38. PNDR64_FORMAT pFormat )
  39. {
  40. (*Ndr64MarshallRoutinesTable[*(PFORMAT_STRING)pFormat] )
  41. ( pStubMsg,
  42. pMemory,
  43. pFormat );
  44. }
  45. inline void
  46. Ndr64EmbeddedTypeMarshall(
  47. PMIDL_STUB_MESSAGE pStubMsg,
  48. uchar * pMemory,
  49. PNDR64_FORMAT pFormat )
  50. {
  51. (*Ndr64EmbeddedMarshallRoutinesTable[*(PFORMAT_STRING)pFormat] )
  52. ( pStubMsg,
  53. pMemory,
  54. pFormat );
  55. }
  56. //
  57. // Buffer size jump tables
  58. //
  59. typedef void (* PNDR64_SIZE_ROUTINE)(
  60. PMIDL_STUB_MESSAGE pStubMsg,
  61. uchar * pMemory,
  62. PNDR64_FORMAT pFormat
  63. );
  64. extern PNDR64_SIZE_ROUTINE const Ndr64SizeRoutinesTable[];
  65. extern PNDR64_SIZE_ROUTINE const Ndr64EmbeddedSizeRoutinesTable[];
  66. inline void
  67. Ndr64TopLevelTypeSize(
  68. PMIDL_STUB_MESSAGE pStubMsg,
  69. uchar * pMemory,
  70. PNDR64_FORMAT pFormat )
  71. {
  72. (*Ndr64SizeRoutinesTable[*(PFORMAT_STRING)pFormat])( pStubMsg,
  73. pMemory,
  74. pFormat );
  75. }
  76. inline void
  77. Ndr64EmbeddedTypeSize(
  78. PMIDL_STUB_MESSAGE pStubMsg,
  79. uchar * pMemory,
  80. PNDR64_FORMAT pFormat )
  81. {
  82. (*Ndr64EmbeddedSizeRoutinesTable[*(PFORMAT_STRING)pFormat])( pStubMsg,
  83. pMemory,
  84. pFormat );
  85. }
  86. void
  87. Ndr64ComplexStructBufferSize(
  88. PMIDL_STUB_MESSAGE pStubMsg,
  89. uchar * pMemory,
  90. PNDR64_FORMAT pFormat );
  91. void
  92. Ndr64ComplexArrayBufferSize(
  93. PMIDL_STUB_MESSAGE pStubMsg,
  94. uchar * pMemory,
  95. PNDR64_FORMAT pFormat );
  96. //
  97. // Memsize jump tables
  98. //
  99. typedef void (* PNDR64_MEM_SIZE_ROUTINE)(
  100. PMIDL_STUB_MESSAGE pStubMsg,
  101. PNDR64_FORMAT pFormat
  102. );
  103. extern PNDR64_MEM_SIZE_ROUTINE const Ndr64MemSizeRoutinesTable[];
  104. extern PNDR64_MEM_SIZE_ROUTINE const Ndr64EmbeddedMemSizeRoutinesTable[];
  105. inline void
  106. Ndr64TopLevelTypeMemorySize(
  107. PMIDL_STUB_MESSAGE pStubMsg,
  108. PNDR64_FORMAT pFormat )
  109. {
  110. (*Ndr64MemSizeRoutinesTable[*(PFORMAT_STRING)pFormat] )
  111. ( pStubMsg,
  112. pFormat );
  113. }
  114. inline void
  115. Ndr64EmbeddedTypeMemorySize(
  116. PMIDL_STUB_MESSAGE pStubMsg,
  117. PNDR64_FORMAT pFormat )
  118. {
  119. (*Ndr64EmbeddedMemSizeRoutinesTable[*(PFORMAT_STRING)pFormat] )
  120. ( pStubMsg,
  121. pFormat );
  122. }
  123. void
  124. Ndr64ComplexStructMemorySize(
  125. PMIDL_STUB_MESSAGE pStubMsg,
  126. PNDR64_FORMAT pFormat );
  127. void
  128. Ndr64ComplexArrayMemorySize(
  129. PMIDL_STUB_MESSAGE pStubMsg,
  130. PNDR64_FORMAT pFormat );
  131. //
  132. // Unmarshal
  133. //
  134. typedef void (* PNDR64_UNMARSHALL_ROUTINE)(
  135. PMIDL_STUB_MESSAGE,
  136. uchar **,
  137. PNDR64_FORMAT,
  138. bool
  139. );
  140. extern PNDR64_UNMARSHALL_ROUTINE const Ndr64UnmarshallRoutinesTable[];
  141. extern PNDR64_UNMARSHALL_ROUTINE const Ndr64EmbeddedUnmarshallRoutinesTable[];
  142. inline void
  143. Ndr64EmbeddedTypeUnmarshall(
  144. PMIDL_STUB_MESSAGE pStubMsg,
  145. uchar ** ppMemory,
  146. PNDR64_FORMAT pFormat )
  147. {
  148. (*Ndr64EmbeddedUnmarshallRoutinesTable[*(PFORMAT_STRING)pFormat])
  149. (pStubMsg,
  150. ppMemory,
  151. pFormat,
  152. false );
  153. }
  154. inline void
  155. Ndr64TopLevelTypeUnmarshall(
  156. PMIDL_STUB_MESSAGE pStubMsg,
  157. uchar ** ppMemory,
  158. PNDR64_FORMAT pFormat,
  159. bool fMustAlloc )
  160. {
  161. (*Ndr64UnmarshallRoutinesTable[*(PFORMAT_STRING)pFormat])
  162. (pStubMsg,
  163. ppMemory,
  164. pFormat,
  165. fMustAlloc );
  166. }
  167. //
  168. // Free routines
  169. //
  170. typedef void (* PNDR64_FREE_ROUTINE)(
  171. PMIDL_STUB_MESSAGE,
  172. uchar *,
  173. PNDR64_FORMAT
  174. );
  175. extern PNDR64_FREE_ROUTINE const Ndr64FreeRoutinesTable[];
  176. extern PNDR64_FREE_ROUTINE const Ndr64EmbeddedFreeRoutinesTable[];
  177. inline void
  178. Ndr64EmbeddedTypeFree(
  179. PMIDL_STUB_MESSAGE pStubMsg,
  180. uchar * pMemory,
  181. PNDR64_FORMAT pFormat )
  182. {
  183. (*Ndr64EmbeddedFreeRoutinesTable[*(PFORMAT_STRING)pFormat])
  184. ( pStubMsg,
  185. pMemory,
  186. pFormat );
  187. }
  188. inline void
  189. Ndr64ToplevelTypeFree(
  190. PMIDL_STUB_MESSAGE pStubMsg,
  191. uchar * pMemory,
  192. PNDR64_FORMAT pFormat )
  193. {
  194. (*Ndr64FreeRoutinesTable[*(PFORMAT_STRING)pFormat])
  195. ( pStubMsg,
  196. pMemory,
  197. pFormat );
  198. }
  199. #include "..\..\ndr20\fullptr.h"
  200. #include "pipendr.h"
  201. #include "mulsyntx.h"
  202. #include "pointer.h"
  203. #include "expr.h"
  204. uchar *
  205. Ndr64pMemoryIncrement(
  206. PMIDL_STUB_MESSAGE pStubMsg,
  207. uchar * pMemory,
  208. PNDR64_FORMAT pFormat,
  209. BOOL fUseBufferConformance
  210. );
  211. inline
  212. NDR64_UINT32
  213. Ndr64pMemorySize(
  214. PMIDL_STUB_MESSAGE pStubMsg,
  215. PNDR64_FORMAT pFormat,
  216. BOOL fUseBufferConformance )
  217. {
  218. return
  219. PtrToUlong(Ndr64pMemoryIncrement( pStubMsg,
  220. NULL,
  221. pFormat,
  222. fUseBufferConformance ) );
  223. }
  224. BOOL
  225. Ndr64pIsStructStringTerminator(
  226. NDR64_UINT8* pMemory,
  227. NDR64_UINT32 ElementSize
  228. );
  229. NDR64_UINT32
  230. Ndr64pStructStringLen(
  231. NDR64_UINT8* pMemory,
  232. NDR64_UINT32 ElementSize
  233. );
  234. NDR64_UINT32
  235. Ndr64pCommonStringSize(
  236. PMIDL_STUB_MESSAGE pStubMsg,
  237. uchar * pMemory,
  238. const NDR64_STRING_HEADER_FORMAT *pStringFormat
  239. );
  240. inline NDR64_UINT32
  241. Ndr64pConvertTo2GB(
  242. NDR64_UINT64 Data64
  243. )
  244. {
  245. if ( Data64 > 0x7FFFFFFF )
  246. {
  247. RpcRaiseException( RPC_X_INVALID_BOUND );
  248. return 0;
  249. }
  250. return (NDR64_UINT32) Data64;
  251. }
  252. __forceinline NDR64_UINT32
  253. Ndr64pMultiplyUpTo2GB( NDR64_UINT64 Op1, NDR64_UINT32 Op2 )
  254. {
  255. if ( Op1 > 0x7fffffff )
  256. {
  257. RpcRaiseException ( RPC_X_INVALID_BOUND);
  258. return 0;
  259. }
  260. NDR64_UINT64 Res = Op1 * Op2;
  261. if ( Res > 0x7fffffff )
  262. {
  263. RpcRaiseException ( RPC_X_INVALID_BOUND);
  264. return 0;
  265. }
  266. return (NDR64_UINT32) Res;
  267. }
  268. void
  269. Ndr64pInitUserMarshalCB(
  270. MIDL_STUB_MESSAGE *pStubMsg,
  271. NDR64_USER_MARSHAL_FORMAT * pUserFormat,
  272. USER_MARSHAL_CB_TYPE CBType,
  273. USER_MARSHAL_CB *pUserMarshalCB
  274. );
  275. CLIENT_CALL_RETURN RPC_ENTRY
  276. NdrpClientCall3(
  277. void * pThis,
  278. MIDL_STUBLESS_PROXY_INFO *pProxyInfo,
  279. unsigned long nProcNum,
  280. void *pReturnValue,
  281. NDR_PROC_CONTEXT * pContext,
  282. unsigned char * StartofStack
  283. );
  284. PNDR64_FORMAT
  285. Ndr64pFindUnionArm(
  286. PMIDL_STUB_MESSAGE pStubMsg,
  287. const NDR64_UNION_ARM_SELECTOR* pArmSelector,
  288. EXPR_VALUE Value
  289. );
  290. EXPR_VALUE
  291. Ndr64pSimpleTypeToExprValue(
  292. NDR64_FORMAT_CHAR FormatChar,
  293. uchar *pSimple);
  294. EXPR_VALUE
  295. Ndr64pCastExprValueToExprValue(
  296. NDR64_FORMAT_CHAR FormatChar,
  297. EXPR_VALUE Value);
  298. // Context Handle Functions
  299. NDR_SCONTEXT
  300. RPC_ENTRY
  301. Ndr64ContextHandleInitialize(
  302. IN PMIDL_STUB_MESSAGE pStubMsg,
  303. IN PFORMAT_STRING pFormat
  304. );
  305. void
  306. RPC_ENTRY
  307. Ndr64ServerContextNewMarshall(
  308. PMIDL_STUB_MESSAGE pStubMsg,
  309. NDR_SCONTEXT ContextHandle,
  310. NDR_RUNDOWN RundownRoutine,
  311. PFORMAT_STRING pFormat
  312. );
  313. NDR_SCONTEXT
  314. RPC_ENTRY
  315. Ndr64ServerContextNewUnmarshall(
  316. IN PMIDL_STUB_MESSAGE pStubMsg,
  317. IN PFORMAT_STRING pFormat
  318. );
  319. void
  320. Ndr64pCleanupServerContextHandles(
  321. MIDL_STUB_MESSAGE * pStubMsg,
  322. long NumberParams,
  323. NDR64_PARAM_FORMAT* Params,
  324. uchar * pArgBuffer,
  325. BOOL fManagerRoutineException
  326. );
  327. // Free
  328. void
  329. RPC_ENTRY
  330. Ndr64PointerFree(
  331. PMIDL_STUB_MESSAGE pStubMsg,
  332. unsigned char __RPC_FAR * pMemory,
  333. PNDR64_FORMAT pFormat
  334. );
  335. // Mrshl
  336. void
  337. RPC_ENTRY
  338. Ndr64SimpleTypeMarshall(
  339. PMIDL_STUB_MESSAGE pStubMsg,
  340. unsigned char __RPC_FAR * pMemory,
  341. unsigned char FormatChar
  342. );
  343. // Unmarshall
  344. void
  345. RPC_ENTRY
  346. Ndr64SimpleTypeUnmarshall(
  347. PMIDL_STUB_MESSAGE pStubMsg,
  348. unsigned char __RPC_FAR * pMemory,
  349. unsigned char FormatChar
  350. );
  351. // Initialization
  352. void
  353. Ndr64ClientInitialize(
  354. PRPC_MESSAGE pRpcMsg,
  355. PMIDL_STUB_MESSAGE pStubMsg,
  356. PMIDL_STUBLESS_PROXY_INFO pProxyInfo,
  357. unsigned int ProcNum
  358. );
  359. unsigned char *
  360. Ndr64ServerInitialize(
  361. PRPC_MESSAGE pRpcMsg,
  362. PMIDL_STUB_MESSAGE pStubMsg,
  363. PMIDL_STUB_DESC pStubDescriptor
  364. );
  365. void
  366. Ndr64ServerInitializePartial(
  367. PRPC_MESSAGE pRpcMsg,
  368. PMIDL_STUB_MESSAGE pStubMsg,
  369. PMIDL_STUB_DESC pStubDescriptor,
  370. unsigned long RequestedBufferSize
  371. );
  372. // Get Buffer variations
  373. unsigned char *
  374. Ndr64GetBuffer(
  375. PMIDL_STUB_MESSAGE pStubMsg,
  376. unsigned long BufferLength );
  377. unsigned char *
  378. Ndr64NsGetBuffer(
  379. PMIDL_STUB_MESSAGE pStubMsg,
  380. unsigned long BufferLength );
  381. unsigned char *
  382. Ndr64GetPipeBuffer(
  383. PMIDL_STUB_MESSAGE pStubMsg,
  384. unsigned long BufferLength );
  385. void
  386. Ndr64ClearOutParameters(
  387. PMIDL_STUB_MESSAGE pStubMsg,
  388. PNDR64_FORMAT pFormat,
  389. uchar * ArgAddr
  390. );
  391. extern void __fastcall NdrpSimpleTypeCharMarshall (
  392. PMIDL_STUB_MESSAGE pStubMsg,
  393. uchar * pMemory);
  394. extern void __fastcall NdrpSimpleTypeShortMarshall (
  395. PMIDL_STUB_MESSAGE pStubMsg,
  396. uchar * pMemory);
  397. extern void __fastcall NdrpSimpleTypeLongMarshall (
  398. PMIDL_STUB_MESSAGE pStubMsg,
  399. uchar * pMemory);
  400. extern void __fastcall NdrpSimpleTypeHyperMarshall (
  401. PMIDL_STUB_MESSAGE pStubMsg,
  402. uchar * pMemory);
  403. extern void __fastcall NdrpSimpleTypeIgnoreMarshall (
  404. PMIDL_STUB_MESSAGE ,
  405. uchar * );
  406. extern void __fastcall NdrpSimpleTypeInvalidMarshall (
  407. PMIDL_STUB_MESSAGE ,
  408. uchar * );
  409. // These end of buffer checks can be performed on a receiving side only.
  410. // The necessary setup is there for memorysize, unmarshal and convert walks.
  411. // This also includes pickling walk.
  412. // Don't use this on the sending side.
  413. // Checks if the pointer is past the end of the buffer. Do not check for wraparound.
  414. #define CHECK_EOB_RAISE_BSD( p ) \
  415. { \
  416. if( (char *)(p) > (char*)pStubMsg->BufferEnd ) \
  417. { \
  418. RpcRaiseException( RPC_X_BAD_STUB_DATA ); \
  419. } \
  420. }
  421. #define CHECK_EOB_RAISE_IB( p ) \
  422. { \
  423. if( (char *)(p) > (char*)pStubMsg->BufferEnd ) \
  424. { \
  425. RpcRaiseException( RPC_X_INVALID_BOUND ); \
  426. } \
  427. }
  428. // Checks if p + incsize is past the end of the bufffer.
  429. //
  430. #define CHECK_EOB_WITH_WRAP_RAISE_BSD( p, incsize ) \
  431. { \
  432. char *NewBuffer = ((char *)(p)) + (SIZE_T)(incsize); \
  433. if( (NewBuffer > (char*)(pStubMsg->BufferEnd)) || (NewBuffer < (char*)(p)) ) \
  434. { \
  435. RpcRaiseException( RPC_X_BAD_STUB_DATA ); \
  436. } \
  437. }
  438. #define CHECK_EOB_WITH_WRAP_RAISE_IB( p, incsize ) \
  439. { \
  440. char *NewBuffer = ((char *)(p)) + (SIZE_T)(incsize); \
  441. if( (NewBuffer > (char*)(pStubMsg->BufferEnd)) || (NewBuffer < (char*)(p)) ) \
  442. { \
  443. RpcRaiseException( RPC_X_INVALID_BOUND ); \
  444. } \
  445. }
  446. // This would be appropriate on the sending side for marshaling.
  447. #define CHECK_SEND_EOB_RAISE_BSD( p ) \
  448. if ( (char*)(pStubMsg->RpcMsg->Buffer + pStubMsg->RpcMsg->BufferLength) < (char*)( p ) ) \
  449. RpcRaiseException( RPC_X_BAD_STUB_DATA )
  450. //
  451. // Defined in global.c
  452. //
  453. extern const unsigned char Ndr64SimpleTypeBufferSize[];
  454. extern const unsigned char Ndr64SimpleTypeMemorySize[];
  455. extern const unsigned long Ndr64TypeFlags[];
  456. // This definition is adjusted for a native platform.
  457. // The wire size is fixed for DCE NDR regardless of platform.
  458. #define PTR_MEM_SIZE sizeof(void *)
  459. #define PTR_MEM_ALIGN (sizeof(void *)-1)
  460. #define PTR_WIRE_REP(p) (p?(NDR64_PTR_WIRE_TYPE)(UNIQUE_POINTER_MARK):0)
  461. #define CONTEXT_HANDLE_WIRE_SIZE 20
  462. #define IGNORED(Param)
  463. //
  464. // Proc info flags macros.
  465. //
  466. #define IS_OLE_INTERFACE(Flags) ((Flags) & Oi_OBJECT_PROC)
  467. #define HAS_RPCFLAGS(Flags) ((Flags) & Oi_HAS_RPCFLAGS)
  468. #define DONT_HANDLE_EXCEPTION(Flags) \
  469. ((Flags) & Oi_IGNORE_OBJECT_EXCEPTION_HANDLING)
  470. //
  471. // Routine index macro.
  472. //
  473. #define NDR64_ROUTINE_INDEX(FC) ( (FC) )
  474. //
  475. // Simple type alignment and size lookup macros.
  476. //
  477. #define NDR64_SIMPLE_TYPE_BUFALIGN(FormatChar) (Ndr64SimpleTypeBufferSize[FormatChar]-1)
  478. #define NDR64_SIMPLE_TYPE_MEMALIGN(FormatChar) (Ndr64SimpleTypeMemorySize[FormatChar]-1)
  479. #define NDR64_SIMPLE_TYPE_BUFSIZE(FormatChar) (Ndr64SimpleTypeBufferSize[FormatChar])
  480. #define NDR64_SIMPLE_TYPE_MEMSIZE(FormatChar) (Ndr64SimpleTypeMemorySize[FormatChar])
  481. #if defined(__RPC_WIN32__)
  482. #define NDR64_USER_MARSHAL_MARKER (0x72657355);
  483. #else
  484. #define NDR64_USER_MARSHAL_MARKER (0x7265735572657355);
  485. #endif
  486. #if defined(__RPC_WIN32__)
  487. #define NDR64_CONTEXT_HANDLE_MARSHAL_MARKER (0xbaadbeef);
  488. #else
  489. #define NDR64_CONTEXT_HANDLE_MARSHAL_MARKER (0xbaadbeefbaadbeef);
  490. #endif
  491. //
  492. // Format character attribute bits used in global Ndr64TypesFlags defined in
  493. // global.c.
  494. //
  495. #define _SIMPLE_TYPE_ 0x0001L
  496. #define _POINTER_ 0x0002L
  497. #define _STRUCT_ 0x0004L
  498. #define _ARRAY_ 0x0008L
  499. #define _STRING_ 0x0010L
  500. #define _UNION_ 0x0020L
  501. #define _XMIT_AS_ 0x0040L
  502. #define _BY_VALUE_ 0x0080L
  503. #define _HANDLE_ 0x0100L
  504. #define _BASIC_POINTER_ 0x0200L
  505. //
  506. // Format character query macros.
  507. //
  508. #define NDR64_IS_SIMPLE_TYPE(FC) (Ndr64TypeFlags[(FC)] & _SIMPLE_TYPE_)
  509. #define NDR64_IS_POINTER_TYPE(FC) (Ndr64TypeFlags[(FC)] & _POINTER_)
  510. #define NDR64_IS_BASIC_POINTER(FC) (Ndr64TypeFlags[(FC)] & _BASIC_POINTER_)
  511. #define NDR64_IS_ARRAY(FC) (Ndr64TypeFlags[(FC)] & _ARRAY_)
  512. #define NDR64_IS_STRUCT(FC) (Ndr64TypeFlags[(FC)] & _STRUCT_)
  513. #define NDR64_IS_UNION(FC) (Ndr64TypeFlags[(FC)] & _UNION_)
  514. #define NDR64_IS_STRING(FC) (Ndr64TypeFlags[(FC)] & _STRING_)
  515. #define NDR64_IS_ARRAY_OR_STRING(FC) (Ndr64TypeFlags[(FC)] & (_STRING_ | _ARRAY_))
  516. #define NDR64_IS_XMIT_AS(FC) (Ndr64TypeFlags[(FC)] & _XMIT_AS_)
  517. #define NDR64_IS_BY_VALUE(FC) (Ndr64TypeFlags[(FC)] & _BY_VALUE_)
  518. #define NDR64_IS_HANDLE(FC) (Ndr64TypeFlags[(FC)] & _HANDLE_)
  519. //
  520. // Pointer attribute extraction and querying macros.
  521. //
  522. #define NDR64_ALLOCATE_ALL_NODES( FC ) ((FC) & FC_ALLOCATE_ALL_NODES)
  523. #define NDR64_DONT_FREE( FC ) ((FC) & FC_DONT_FREE)
  524. #define NDR64_ALLOCED_ON_STACK( FC ) ((FC) & FC_ALLOCED_ON_STACK)
  525. #define NDR64_SIMPLE_POINTER( FC ) ((FC) & FC_SIMPLE_POINTER)
  526. #define NDR64_POINTER_DEREF( FC ) ((FC) & FC_POINTER_DEREF)
  527. //
  528. // Handle query macros.
  529. //
  530. #define NDR64_IS_HANDLE_PTR( FC ) ((FC) & HANDLE_PARAM_IS_VIA_PTR)
  531. #define NDR64_IS_HANDLE_IN( FC ) ((FC) & HANDLE_PARAM_IS_IN)
  532. #define NDR64_IS_HANDLE_OUT( FC ) ((FC) & HANDLE_PARAM_IS_OUT)
  533. #define NDR64_IS_HANDLE_RETURN( FC ) ((FC) & HANDLE_PARAM_IS_RETURN)
  534. #define NDR64_NEW_EMBEDDED_ALLOCATION_FLAG ( ( unsigned char ) 0x01 )
  535. #define NDR64_CONF_MARK_VALID_FLAG ( ( unsigned char ) 0x02 )
  536. #define NDR64_VAR_MARK_VALID_FLAG ( ( unsigned char ) 0x04 )
  537. #define NDR64_WALKIP_FLAG ( ( unsigned char ) 0x08 )
  538. #define NDR64_SKIP_REF_CHECK_FLAG ( ( unsigned char ) 0x40 )
  539. #define NDR64_IS_CONF_MARK_VALID( f ) ( ( f ) & NDR64_CONF_MARK_VALID_FLAG )
  540. #define NDR64_SET_CONF_MARK_VALID( f ) ( ( f ) |= NDR64_CONF_MARK_VALID_FLAG )
  541. #define NDR64_RESET_CONF_MARK_VALID( f ) ( ( f ) &= ~NDR64_CONF_MARK_VALID_FLAG )
  542. #define NDR64_IS_VAR_MARK_VALID( f ) ( ( f ) & NDR64_VAR_MARK_VALID_FLAG )
  543. #define NDR64_SET_VAR_MARK_VALID( f ) ( ( f ) |= NDR64_VAR_MARK_VALID_FLAG )
  544. #define NDR64_RESET_VAR_MARK_VALID( f ) ( ( f ) &= ~NDR64_VAR_MARK_VALID_FLAG )
  545. #define NDR64_IS_NEW_EMBEDDED_ALLOCATION( f ) ( ( f ) & NDR64_NEW_EMBEDDED_ALLOCATION_FLAG )
  546. #define NDR64_SET_NEW_EMBEDDED_ALLOCATION( f ) ( ( f ) |= NDR64_NEW_EMBEDDED_ALLOCATION_FLAG )
  547. #define NDR64_RESET_IS_NEW_EMBEDDED_ALLOCATION( f ) ( ( f ) &= ~NDR64_NEW_EMBEDDED_ALLOCATION_FLAG )
  548. #define NDR64_IS_WALKIP( f ) ( ( f ) & NDR64_WALKIP_FLAG )
  549. #define NDR64_SET_WALKIP( f ) ( ( f ) |= NDR64_WALKIP_FLAG )
  550. #define NDR64_RESET_WALKIP( f ) ( ( f ) &= ~NDR64_WALKIP_FLAG )
  551. #define NDR64_IS_SKIP_REF_CHECK( f ) ( ( f ) & NDR64_SKIP_REF_CHECK_FLAG )
  552. #define NDR64_SET_SKIP_REF_CHECK( f ) ( ( f ) |= NDR64_SKIP_REF_CHECK_FLAG )
  553. #define NDR64_RESET_SKIP_REF_CHECK( f ) ( ( f ) &= ~NDR64_SKIP_REF_CHECK_FLAG )
  554. #define NDR64_RESET_EMBEDDED_FLAGS_TO_STANDALONE( f ) \
  555. ( ( f ) &= ~ ( NDR64_NEW_EMBEDDED_ALLOCATION_FLAG | \
  556. NDR64_CONF_MARK_VALID_FLAG | \
  557. NDR64_VAR_MARK_VALID_FLAG ) )
  558. #define EXCEPTION_FLAG ( pContext->ExceptionFlag )
  559. #endif