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.

151 lines
3.9 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1996 - 2000 Microsoft Corporation
  3. Module Name :
  4. asyncndr.h
  5. Abstract :
  6. This file contains the ndr async related definitions.
  7. Author :
  8. Ryszard K. Kott (ryszardk) Nov 1996
  9. Revision History :
  10. ---------------------------------------------------------------------*/
  11. #ifndef __ASYNCNDR_H__
  12. #define __ASYNCNDR_H__
  13. #define RPC_ASYNC_CURRENT_VERSION RPC_ASYNC_VERSION_1_0
  14. #define RPC_ASYNC_SIGNATURE 0x43595341 /* ASNC */
  15. #define NDR_ASYNC_SIGNATURE 0x63797341 /* Asnc */
  16. #define RPC_FREED_ASYNC_SIGNATURE 0x45454541 /* AEEE */
  17. #define NDR_FREED_ASYNC_SIGNATURE 0x65656561 /* aeee */
  18. #define RPC_ASYNC_HANDLE PRPC_ASYNC_STATE
  19. #define NDR_ASYNC_VERSION sizeof( NDR_ASYNC_MESSAGE )
  20. #define NDR_ASYNC_GUARD_SIZE (0x10)
  21. #define NDR_ASYNC_PREP_PHASE 1
  22. #define NDR_ASYNC_SET_PHASE 2
  23. #define NDR_ASYNC_CALL_PHASE 3
  24. #define NDR_ASYNC_ERROR_PHASE 4
  25. typedef struct _Flags
  26. {
  27. unsigned short ValidCallPending : 1;
  28. unsigned short ErrorPending : 1;
  29. unsigned short BadStubData : 1;
  30. unsigned short RuntimeCleanedUp : 1;
  31. unsigned short ClientHandleCreated : 1;
  32. unsigned short HandlelessObjCall : 1;
  33. unsigned short Unused : 10;
  34. } NDR_ASYNC_CALL_FLAGS;
  35. typedef struct _NDR_ASYNC_MESSAGE
  36. {
  37. long Version;
  38. long Signature;
  39. RPC_ASYNC_HANDLE AsyncHandle; // raw and CAsyncMgr *
  40. NDR_ASYNC_CALL_FLAGS Flags;
  41. unsigned short StubPhase;
  42. unsigned long ErrorCode;
  43. RPC_MESSAGE RpcMsg;
  44. MIDL_STUB_MESSAGE StubMsg;
  45. NDR_SCONTEXT CtxtHndl[MAX_CONTEXT_HNDL_NUMBER];
  46. ulong * pdwStubPhase;
  47. // Note: the correlation cache needs to be sizeof(pointer) aligned
  48. NDR_PROC_CONTEXT ProcContext;
  49. // guard at the end of the message
  50. unsigned char AsyncGuard[NDR_ASYNC_GUARD_SIZE];
  51. } NDR_ASYNC_MESSAGE, *PNDR_ASYNC_MESSAGE;
  52. #define AsyncAlloca( msg, size ) \
  53. NdrpAlloca( &msg->ProcContext.AllocateContext, size )
  54. RPC_STATUS
  55. NdrpCompleteAsyncCall (
  56. IN PRPC_ASYNC_STATE AsyncHandle,
  57. IN PNDR_ASYNC_MESSAGE pAsyncMsg,
  58. IN void * pReply
  59. );
  60. RPC_STATUS
  61. NdrpCompleteAsyncClientCall(
  62. RPC_ASYNC_HANDLE AsyncHandle,
  63. IN PNDR_ASYNC_MESSAGE pAsyncMsg,
  64. void * pReturnValue
  65. );
  66. RPC_STATUS
  67. NdrpCompleteAsyncServerCall(
  68. RPC_ASYNC_HANDLE AsyncHandle,
  69. IN PNDR_ASYNC_MESSAGE pAsyncMsg,
  70. void * pReturnValue
  71. );
  72. RPC_STATUS
  73. NdrpAsyncAbortCall(
  74. PRPC_ASYNC_STATE AsyncHandle,
  75. PNDR_ASYNC_MESSAGE pAsyncMsg,
  76. unsigned long ExceptionCode,
  77. BOOL bFreeParams
  78. );
  79. RPC_STATUS
  80. NdrpInitializeAsyncMsg(
  81. void * StartofStack,
  82. PNDR_ASYNC_MESSAGE pAsyncMsg );
  83. void
  84. NdrpFreeAsyncMsg(
  85. PNDR_ASYNC_MESSAGE pAsyncMsg );
  86. void
  87. NdrpFreeAsyncHandleAndMessage(
  88. PRPC_ASYNC_STATE AsyncHandle);
  89. void
  90. NdrAsyncSend(
  91. PMIDL_STUB_MESSAGE pStubMsg,
  92. BOOL fPartial );
  93. void
  94. NdrLastAsyncReceive(
  95. PMIDL_STUB_MESSAGE pStubMsg );
  96. RPC_STATUS
  97. NdrValidateBothAndLockAsyncHandle(
  98. RPC_ASYNC_HANDLE AsyncHandle );
  99. RPC_STATUS
  100. NdrpValidateAndLockAsyncHandle(
  101. RPC_ASYNC_HANDLE AsyncHandle );
  102. RPC_STATUS
  103. NdrUnlockHandle(
  104. RPC_ASYNC_HANDLE AsyncHandle );
  105. RPC_STATUS
  106. NdrpValidateAsyncMsg(
  107. PNDR_ASYNC_MESSAGE pAsyncMsg );
  108. void
  109. NdrpRegisterAsyncHandle(
  110. PMIDL_STUB_MESSAGE pStubMsg,
  111. void * AsyncHandle );
  112. #endif // __ASYNCNDR_H__