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.

89 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. RemoteDesktopServerEventSink
  5. Abstract:
  6. This listens to the events from the IRemoteDesktopServer so
  7. we can find out when the client connects/disconnects
  8. Author:
  9. Marc Reyhner 7/5/2000
  10. --*/
  11. #ifndef __REMOTEDESKTOPSERVEREVENTSINK_H__
  12. #define __REMOTEDESKTOPSERVEREVENTSINK_H__
  13. #include "rdshost.h"
  14. #define IDC_EVENT_SOURCE_OBJ 1
  15. //
  16. // Info for all the event functions is entered here
  17. // there is a way to have ATL do this automatically using typelib's
  18. // but it is slower.
  19. //
  20. static _ATL_FUNC_INFO EventFuncNoParamsInfo =
  21. {
  22. CC_STDCALL, // Calling convention.
  23. VT_EMPTY, // Return type.
  24. 0, // Number of arguments.
  25. {VT_EMPTY} // Argument types.
  26. };
  27. static _ATL_FUNC_INFO EventFuncLongParamInfo =
  28. {
  29. CC_STDCALL, // Calling convention.
  30. VT_EMPTY, // Return type.
  31. 1, // Number of arguments.
  32. {VT_I4} // Argument types.
  33. };
  34. ////////////////////////////////////////////////
  35. //
  36. // CRemoteDesktopServerEventSink
  37. //
  38. // Event sink for server events.
  39. //
  40. class CRemoteDesktopServerEventSink :
  41. public IDispEventSimpleImpl<IDC_EVENT_SOURCE_OBJ, CRemoteDesktopServerEventSink,
  42. &DIID__ISAFRemoteDesktopSessionEvents>
  43. {
  44. public:
  45. // The sink map for ATL
  46. BEGIN_SINK_MAP(CRemoteDesktopServerEventSink)
  47. SINK_ENTRY_INFO(IDC_EVENT_SOURCE_OBJ, DIID__ISAFRemoteDesktopSessionEvents,
  48. 1, OnConnected,
  49. &EventFuncNoParamsInfo)
  50. SINK_ENTRY_INFO(IDC_EVENT_SOURCE_OBJ, DIID__ISAFRemoteDesktopSessionEvents,
  51. 2, OnDisconnected,
  52. &EventFuncNoParamsInfo)
  53. END_SINK_MAP()
  54. //
  55. // Event Sinks
  56. //
  57. // The client connected
  58. VOID __stdcall OnConnected();
  59. // The client disconnected
  60. VOID __stdcall OnDisconnected();
  61. // Return the name of this class.
  62. virtual const LPTSTR ClassName() {
  63. return TEXT("CRemoteDesktopServerEventSink");
  64. }
  65. };
  66. #endif