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.

149 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1999-2000 Microsoft Corporation
  3. Module Name:
  4. TSRDPRemoteDesktopSession
  5. Abstract:
  6. This is the TS/RDP implementation of the Remote Desktop Server class.
  7. The Remote Desktop Server class defines functions that define
  8. pluggable C++ interface for remote desktop access, by abstracting
  9. the implementation specific details of remote desktop access for the
  10. server-side into the following C++ methods:
  11. Author:
  12. Tad Brockway 02/00
  13. Revision History:
  14. --*/
  15. #ifndef __TSRDPREMOTEDESKTOPSESSION_H_
  16. #define __TSRDPREMOTEDESKTOPSESSION_H_
  17. #include "RemoteDesktopSession.h"
  18. #include "TSRDPServerDataChannelMgr.h"
  19. #include <sessmgr.h>
  20. ///////////////////////////////////////////////////////
  21. //
  22. // CTSRDPRemoteDesktopSession
  23. //
  24. class CTSRDPRemoteDesktopSession : public CComObject<CRemoteDesktopSession>
  25. {
  26. private:
  27. DWORD m_SessionID;
  28. CComBSTR m_ConnectParms;
  29. CComBSTR m_UseHostName;
  30. protected:
  31. //
  32. // Final Initialization and Shutdown
  33. //
  34. // Parms are non-null, if the session is being opened, instead of
  35. // create new.
  36. //
  37. virtual HRESULT Initialize(
  38. BSTR connectParms,
  39. CRemoteDesktopServerHost *hostObject,
  40. REMOTE_DESKTOP_SHARING_CLASS sharingClass,
  41. BOOL bEnableCallback,
  42. DWORD timeOut,
  43. BSTR userHelpCreateBlob,
  44. LONG tsSessionID,
  45. BSTR userSID
  46. );
  47. void Shutdown();
  48. //
  49. // Instruct object to use hostname or ipaddress when constructing
  50. // connect parameters
  51. //
  52. virtual HRESULT UseHostName( BSTR hostname ) {
  53. CComObject<CRemoteDesktopSession>::UseHostName( hostname );
  54. m_UseHostName = hostname;
  55. return S_OK;
  56. }
  57. //
  58. // Multiplexes Channel Data
  59. //
  60. CComObject<CTSRDPServerChannelMgr> *m_ChannelMgr;
  61. //
  62. // Accessor Method for Data Channel Manager
  63. //
  64. virtual CRemoteDesktopChannelMgr *GetChannelMgr() {
  65. return m_ChannelMgr;
  66. }
  67. //
  68. // Return the session description and name, depending on the subclass.
  69. //
  70. virtual VOID GetSessionName(CComBSTR &name);
  71. virtual VOID GetSessionDescription(CComBSTR &descr);
  72. //
  73. // Fetch our Token User struct.
  74. //
  75. HRESULT FetchOurTokenUser(PTOKEN_USER *tokenUser);
  76. public:
  77. //
  78. // Constructor/Destructor
  79. //
  80. CTSRDPRemoteDesktopSession();
  81. ~CTSRDPRemoteDesktopSession();
  82. //
  83. // ISAFRemoteDesktopSession Methods
  84. //
  85. STDMETHOD(get_ConnectParms)(BSTR *parms);
  86. STDMETHOD(get_ChannelManager)(ISAFRemoteDesktopChannelMgr **mgr) {
  87. DC_BEGIN_FN("get_ChannelManager");
  88. HRESULT hr = S_OK;
  89. if (m_ChannelMgr != NULL) {
  90. m_ChannelMgr->AddRef();
  91. *mgr = m_ChannelMgr;
  92. }
  93. else {
  94. ASSERT(FALSE);
  95. hr = E_FAIL;
  96. }
  97. DC_END_FN();
  98. return hr;
  99. }
  100. STDMETHOD(Disconnect)();
  101. //
  102. // Return the name of this class.
  103. //
  104. virtual const LPTSTR ClassName() {
  105. return TEXT("CTSRDPRemoteDesktopSession");
  106. }
  107. HRESULT StartListening();
  108. };
  109. #endif //__TSRDPREMOTEDESKTOPSESSION_H_