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.

141 lines
2.4 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1999
  6. //
  7. // File: async.cxx
  8. //
  9. //--------------------------------------------------------------------------
  10. #include <precomp.hxx>
  11. RPC_STATUS RPC_ENTRY
  12. RpcAsyncRegisterInfo (
  13. IN PRPC_ASYNC_STATE pAsync
  14. )
  15. /*++
  16. Routine Description:
  17. Obsolete function - just an entry point.
  18. Return Value:
  19. --*/
  20. {
  21. #if !defined(_M_IA64)
  22. return RPC_S_OK ;
  23. #else
  24. return RPC_S_CANNOT_SUPPORT;
  25. #endif
  26. }
  27. RPC_STATUS RPC_ENTRY
  28. RpcAsyncCancelCall (
  29. IN PRPC_ASYNC_STATE pAsync,
  30. IN BOOL fAbort
  31. )
  32. /*++
  33. Function Name:RpcAsyncCancelCall
  34. Parameters:
  35. Description:
  36. Returns:
  37. --*/
  38. {
  39. MESSAGE_OBJECT *MObject = (MESSAGE_OBJECT *) pAsync->RuntimeInfo;
  40. if (!ThreadSelf())
  41. {
  42. return RPC_S_OUT_OF_MEMORY;
  43. }
  44. if (MObject)
  45. {
  46. if (MObject->InvalidHandle(CALL_TYPE))
  47. {
  48. return (RPC_S_INVALID_BINDING);
  49. }
  50. return ((CALL *) MObject)->CancelAsyncCall(fAbort);
  51. }
  52. return (RPC_S_INVALID_BINDING);
  53. }
  54. RPC_STATUS RPC_ENTRY
  55. RpcAsyncGetCallStatus (
  56. IN PRPC_ASYNC_STATE pAsync
  57. )
  58. /*++
  59. Routine Description:
  60. description
  61. Arguments:
  62. pAsync -
  63. Return Value:
  64. RPC_S_OK - Function succeeded
  65. RPC_S_OUT_OF_MEMORY - we ran out of memory
  66. --*/
  67. {
  68. MESSAGE_OBJECT *MObject = (MESSAGE_OBJECT *) pAsync->RuntimeInfo;
  69. if (MObject)
  70. {
  71. if (MObject->InvalidHandle(CALL_TYPE))
  72. {
  73. return (RPC_S_INVALID_BINDING);
  74. }
  75. return ((CALL *) MObject)->GetCallStatus() ;
  76. }
  77. return RPC_S_INVALID_BINDING;
  78. }
  79. VOID APIENTRY
  80. I_RpcAPCRoutine (
  81. IN RPC_APC_INFO *pAPCInfo
  82. )
  83. {
  84. PRPC_ASYNC_STATE pAsync = pAPCInfo->pAsync;
  85. void *Context = pAPCInfo->Context;
  86. RPC_ASYNC_EVENT Event = pAPCInfo->Event;
  87. PFN_RPCNOTIFICATION_ROUTINE pRoutine =
  88. pAPCInfo->pAsync->u.APC.NotificationRoutine;
  89. ((CALL *) pAPCInfo->hCall)->FreeAPCInfo(pAPCInfo) ;
  90. (*pRoutine) (pAsync, Context, Event) ;
  91. //
  92. // We cannot do anything after the call to the user's API routine. The
  93. // may be gone
  94. //
  95. }
  96. ///////////////////////////////////////////////////////
  97. // Routines owned by NDR //
  98. ///////////////////////////////////////////////////////
  99. //
  100. //
  101. // RpcAsyncAbortCall
  102. // RpcAsyncCompleteCall
  103. //