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.

237 lines
6.2 KiB

  1. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name :
  4. asyncu.h
  5. Abstract :
  6. This file contains the ndr async uuid implementation.
  7. Author :
  8. Ryszard K. Kott (ryszardk) Oct 1997
  9. Revision History :
  10. ---------------------------------------------------------------------*/
  11. #ifndef __ASYNCU_H__
  12. #define __ASYNCU_H__
  13. #define NDR_ASYNC_PROXY_SIGNATURE 0x78507341 /* AsPx */
  14. #define NDR_ASYNC_STUB_SIGNATURE 0x74537341 /* AsSt */
  15. #define NDR_DCOM_ASYNC_SIGNATURE 0x734d7341 /* AsMs */
  16. #define NDR_FREED_ASYNC_SIGNATURE 0x65656561 /* aeee */
  17. #define NDR_FREED_DCOM_SIGNATURE 0x65656564 /* deee */
  18. #define NDR_DCOM_ASYNC_VERSION sizeof( NDR_DCOM_ASYNC_MESSAGE )
  19. #define NDR_ASYNC_GUARD_SIZE (0x10)
  20. #define NDR_ASYNC_PREP_PHASE 1
  21. #define NDR_ASYNC_SET_PHASE 2
  22. #define NDR_ASYNC_CALL_PHASE 3
  23. #define NDR_ASYNC_ERROR_PHASE 4
  24. typedef struct _Flags
  25. {
  26. unsigned short ValidCallPending : 1;
  27. unsigned short ErrorPending : 1;
  28. unsigned short BadStubData : 1;
  29. unsigned short RuntimeCleanedUp : 1;
  30. unsigned short ClientHandleCreated : 1;
  31. unsigned short HandlelessObjCall : 1;
  32. unsigned short ClientDcomPipeCall : 1;
  33. unsigned short Unused : 9;
  34. } NDR_ASYNC_CALL_FLAGS;
  35. typedef struct _NDR_DCOM_ASYNC_MESSAGE
  36. {
  37. long Version;
  38. long Signature;
  39. SYNTAX_TYPE SyntaxType;
  40. long nBeginParams;
  41. void * BeginParams;
  42. long nFinishParams;
  43. void * FinishParams;
  44. uchar * BeginStack;
  45. uchar * FinishStack;
  46. ulong BeginStackSize;
  47. ulong FinishStackSize;
  48. NDR_ASYNC_CALL_FLAGS Flags;
  49. void * pThis;
  50. CStdAsyncProxyBuffer * pAsyncPB;
  51. CStdAsyncStubBuffer * pAsyncSB;
  52. ulong * pdwStubPhase;
  53. unsigned short StubPhase;
  54. unsigned long ErrorCode;
  55. RPC_MESSAGE RpcMsg;
  56. MIDL_STUB_MESSAGE StubMsg;
  57. NDR_PROC_CONTEXT ProcContext;
  58. uchar * pArg;
  59. // Note: the correlation cache needs to be sizeof(pointer) aligned
  60. unsigned _int64 AppStack; // stack continues on
  61. } NDR_DCOM_ASYNC_MESSAGE, *PNDR_DCOM_ASYNC_MESSAGE;
  62. #define AsyncAlloca( msg, size ) \
  63. NdrpAlloca( &msg->ProcContext.AllocateContext, size )
  64. HRESULT
  65. NdrpSetupBeginClientCall(
  66. CStdAsyncProxyBuffer * pAsyncPB,
  67. void * StartofStack,
  68. unsigned short StackSize,
  69. REFIID riid );
  70. HRESULT
  71. NdrpSetupFinishClientCall(
  72. CStdAsyncProxyBuffer * pAsyncPB,
  73. void * StartofStack,
  74. unsigned short StackSize,
  75. REFIID riid,
  76. unsigned long AsyncProcNum );
  77. HRESULT
  78. NdrpSetupBeginStubCall(
  79. CStdAsyncStubBuffer * pAsyncSB,
  80. unsigned short StackSize,
  81. REFIID riid );
  82. HRESULT
  83. NdrpSetupFinishStubCall(
  84. CStdAsyncStubBuffer * pAsyncSB,
  85. unsigned short StackSize,
  86. REFIID riid );
  87. HRESULT
  88. NdrpBeginDcomAsyncStubCall(
  89. struct IRpcStubBuffer * pThis,
  90. struct IRpcChannelBuffer * pChannel,
  91. PRPC_MESSAGE pRpcMsg,
  92. ulong * pdwStubPhase );
  93. ULONG STDMETHODCALLTYPE
  94. NdrpAsyncProxyAddRef(
  95. CStdAsyncProxyBuffer * pAsyncPB );
  96. ULONG STDMETHODCALLTYPE
  97. NdrpAsyncProxyRelease(
  98. CStdAsyncProxyBuffer * pAsyncPB );
  99. HRESULT
  100. NdrpAsyncProxyLock(
  101. CStdAsyncProxyBuffer * pAsyncPB );
  102. void
  103. NdrpAsyncProxyUnlock(
  104. CStdAsyncProxyBuffer * pAsyncPB );
  105. HRESULT
  106. NdrpAsyncProxyCleanup(
  107. CStdAsyncProxyBuffer * pAsyncPB );
  108. HRESULT
  109. NdrpSetupBeginServerCall(
  110. CStdAsyncStubBuffer * pAsyncPB,
  111. void * StartofStack,
  112. unsigned short StackSize,
  113. REFIID riid );
  114. void
  115. NdrpCloneInOutArgs(
  116. NDR_DCOM_ASYNC_MESSAGE * pAsyncMsg,
  117. PPARAM_DESCRIPTION FinishParams,
  118. int FinishParamCount );
  119. void
  120. NdrpFreeDcomAsyncMsg(
  121. PNDR_DCOM_ASYNC_MESSAGE pAsyncMsg );
  122. HRESULT
  123. NdrpAsyncStubSignal(
  124. CStdAsyncStubBuffer * pAsyncSB );
  125. HRESULT
  126. NdrpAsyncStubAddRef(
  127. CStdAsyncStubBuffer * pAsyncSB );
  128. ULONG STDMETHODCALLTYPE
  129. NdrpAsyncStubRelease(
  130. CStdAsyncStubBuffer * pAsyncSB );
  131. HRESULT
  132. NdrpAsyncStubLock(
  133. CStdAsyncStubBuffer * pAsyncSB );
  134. void
  135. NdrpAsyncStubUnlock(
  136. CStdAsyncStubBuffer * pAsyncSB );
  137. HRESULT
  138. NdrpAsyncStubCleanup(
  139. CStdAsyncStubBuffer * pAsyncSB );
  140. BOOL
  141. NdrpDcomAsyncSend(
  142. PMIDL_STUB_MESSAGE pStubMsg,
  143. ISynchronize * pSynchronize );
  144. BOOL
  145. NdrpDcomAsyncClientSend(
  146. PMIDL_STUB_MESSAGE pStubMsg,
  147. IUnknown * punkOuter );
  148. void
  149. NdrDcomAsyncReceive(
  150. PMIDL_STUB_MESSAGE pStubMsg );
  151. HRESULT
  152. NdrpValidateDcomAsyncMsg(
  153. PNDR_DCOM_ASYNC_MESSAGE pAsyncMsg );
  154. HRESULT
  155. NdrpValidateDcomAsyncMsg(
  156. PNDR_DCOM_ASYNC_MESSAGE pAsyncMsg
  157. );
  158. HRESULT
  159. NdrpCompleteDcomAsyncStubCall(
  160. CStdAsyncStubBuffer * pAsyncSB
  161. );
  162. HRESULT
  163. NdrpValidateAsyncStubCall(
  164. CStdAsyncStubBuffer * pAsyncSB
  165. );
  166. void
  167. NdrpCloneInOnlyCorrArgs(
  168. NDR_DCOM_ASYNC_MESSAGE * pAsyncMsg,
  169. PFORMAT_STRING pTypeFormat
  170. );
  171. HRESULT
  172. NdrpValidateAsyncProxyCall(
  173. CStdAsyncProxyBuffer * pAsyncPB
  174. );
  175. #define NdrHrFromWin32Error( exc ) NdrStubErrorHandler( exc )
  176. #endif // __ASYNCU_H__