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.

129 lines
5.8 KiB

  1. /*****************************************************************************
  2. * (C) COPYRIGHT MICROSOFT CORPORATION, 2002
  3. *
  4. * AUTHOR: ByronC
  5. *
  6. * DATE: 3/22/2002
  7. *
  8. * @doc INTERNAL
  9. *
  10. * @module AsyncRPCEventTransport.h - Definitions for the client-side transport mechanism to receive events |
  11. *
  12. * This header file contains the definition for the AsyncRPCEventTransport
  13. * class. It is a subclss of <c ClientEventTransport> and is used to shield
  14. * the higher-level run-time event notification classes from the particulars
  15. * of a specific transport mechanism, in this case AsyncRPC.
  16. *
  17. *****************************************************************************/
  18. //
  19. // Defines
  20. //
  21. #define DEF_LRPC_SEQ TEXT("ncalrpc")
  22. #define DEF_LRPC_ENDPOINT TEXT("WET_LRPC")
  23. #define AsyncRPCEventTransport_UNINIT_SIG ClientEventTransport_UNINIT_SIG
  24. #define AsyncRPCEventTransport_INIT_SIG ClientEventTransport_INIT_SIG
  25. #define AsyncRPCEventTransport_TERM_SIG ClientEventTransport_TERM_SIG
  26. #define AsyncRPCEventTransport_DEL_SIG ClientEventTransport_DEL_SIG
  27. /*****************************************************************************
  28. *
  29. * @doc INTERNAL
  30. *
  31. * @class AsyncRPCEventTransport | Implements an event notification mechanism over AsyncRPC.
  32. *
  33. * @comm
  34. * This is a sub-class of <c ClientEventTransport>. It is used to shield the higher-level
  35. * run-time event notification classes from the implmentation details of
  36. * AsyncRPC as a transport mechanism.
  37. *
  38. * NOTE: Most methods of this class are not thread safe. The caller of this
  39. * class is expected to synchronize access to it.
  40. *
  41. *****************************************************************************/
  42. class AsyncRPCEventTransport : public ClientEventTransport
  43. {
  44. //@access Public members
  45. public:
  46. // @cmember Constructor
  47. AsyncRPCEventTransport();
  48. // @cmember Destructor
  49. virtual ~AsyncRPCEventTransport();
  50. // @cmember Connect to the WIA Service
  51. HRESULT virtual OpenConnectionToServer();
  52. // @cmember Disconnect from the WIA Service
  53. HRESULT virtual CloseConnectionToServer();
  54. // @cmember Sets up the mechanism by which the client will receive notifications
  55. HRESULT virtual OpenNotificationChannel();
  56. // @cmember Tears down the mechanism by which the client receives notifications
  57. HRESULT virtual CloseNotificationChannel();
  58. // @cmember Informs service of client's specific registration/unregistration requests
  59. HRESULT virtual SendRegisterUnregisterInfo(EventRegistrationInfo *pEventRegistrationInfo);
  60. // @cmember Once an event occurs, this will retrieve the relevant data
  61. HRESULT virtual FillEventData(WiaEventInfo *pWiaEventInfo);
  62. //@access Private members
  63. protected:
  64. // @cmember Frees any memory allocated for the members in <md AsyncRPCEventTransport::m_AsyncEventNotifyData>.
  65. VOID FreeAsyncEventNotifyData();
  66. // @cmember Keeps track of the outstanding AsyncRPC Call used to receive notifications
  67. RPC_ASYNC_STATE m_AsyncState;
  68. // @cmember This member is filled in by the server when the AsyncRPC call completes
  69. WIA_ASYNC_EVENT_NOTIFY_DATA m_AsyncEventNotifyData;
  70. // @cmember Handle to the RPC server from which we receive event notifications
  71. RPC_BINDING_HANDLE m_RpcBindingHandle;
  72. // @cmember Our context which uniquely identifies us with the server.
  73. STI_CLIENT_CONTEXT m_AsyncClientContext;
  74. // @cmember Our context which uniquely identifies us with the server.
  75. STI_CLIENT_CONTEXT m_SyncClientContext;
  76. //
  77. // Comments for member variables
  78. //
  79. // @mdata ULONG | AsyncRPCEventTransport | m_ulSig |
  80. // The signature for this class, used for debugging purposes.
  81. // Doing a <nl>"db [addr_of_class]"<nl> would yield one of the following
  82. // signatures for this class:
  83. // @flag AsyncRPCEventTransport_UNINIT_SIG | 'TrnU' - Object has not been successfully
  84. // initialized
  85. // @flag AsyncRPCEventTransport_INIT_SIG | 'TrnI' - Object has been successfully
  86. // initialized
  87. // @flag AsyncRPCEventTransport_TERM_SIG | 'TrnT' - Object is in the process of
  88. // terminating.
  89. // @flag AsyncRPCEventTransport_INIT_SIG | 'TrnD' - Object has been deleted
  90. // (destructor was called)
  91. //
  92. //
  93. // @mdata HANDLE | AsyncRPCEventTransport | m_hPendingEvent |
  94. // Handle to an event object used to signal caller that an event is ready for retrieval.
  95. // Callers get this handle first via a call to <mf ClientEventTransport::getNotificationHandle>.
  96. // They then wait on this handle until signaled, which indicates a WIA event has arrived
  97. // and is ready for retrieval. The event information is then retrieved via a call to
  98. // <mf AsyncRPCEventTransport::FillEventData>.
  99. //
  100. // @mdata RPC_ASYNC_STATE | AsyncRPCEventTransport | m_AsyncState |
  101. // This structure is used to make the Async call by which we receive event notifications
  102. // from the server. See <mf AsyncRPCEventTransport::OpenNotificationChannel>.
  103. //
  104. // @mdata WIA_ASYNC_EVENT_NOTIFY_DATA | AsyncRPCEventTransport | m_AsyncEventNotifyData |
  105. // This member is filled in by the server when the AsyncRPC call completes. If the call
  106. // completed successfully, this structure contains the relevant WIA event information.
  107. //
  108. // @mdata RPC_BINDING_HANDLE | AsyncRPCEventTransport | m_RpcBindingHandle |
  109. // RPC Binding handle used to reference our RPC server from which we receive event notifications.
  110. //
  111. // @mdata STI_CLIENT_CONTEXT | AsyncRPCEventTransport | m_ClientContext |
  112. // Our context which uniquely identifies us with the server.
  113. };