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.

174 lines
5.1 KiB

  1. /********************************************************************
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. UnsolicitedRC.h
  5. Abstract:
  6. Declaration of the CSAFRemoteDesktopConnection class.
  7. Revision History:
  8. KalyaniN created 09/29/'00
  9. ********************************************************************/
  10. #ifndef __SAF_UNSOLICITEDRC_H_
  11. #define __SAF_UNSOLICITEDRC_H_
  12. struct SSessionInfoItem
  13. {
  14. CComBSTR bstrDomain;
  15. CComBSTR bstrUser;
  16. DWORD dwSessionID;
  17. SessionStateEnum wtsConnectState;
  18. };
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CSAFRemoteDesktopConnection
  21. class CSAFRemoteDesktopConnection :
  22. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  23. public ISupportErrorInfo,
  24. public IDispatchImpl<ISAFRemoteDesktopConnection, &IID_ISAFRemoteDesktopConnection, &LIBID_HelpServiceTypeLib>
  25. {
  26. void Cleanup();
  27. public:
  28. CSAFRemoteDesktopConnection();
  29. ~CSAFRemoteDesktopConnection();
  30. BEGIN_COM_MAP(CSAFRemoteDesktopConnection)
  31. COM_INTERFACE_ENTRY(ISAFRemoteDesktopConnection)
  32. COM_INTERFACE_ENTRY(IDispatch)
  33. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  34. END_COM_MAP()
  35. DECLARE_NO_REGISTRY()
  36. DECLARE_NOT_AGGREGATABLE(CSAFRemoteDesktopConnection)
  37. // ISupportsErrorInfo
  38. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  39. // ISAFRemoteDesktopConnection
  40. public:
  41. STDMETHOD(ConnectRemoteDesktop )( /*[in]*/ BSTR bstrServerName, /*[out, retval]*/ ISAFRemoteConnectionData **ppRCD);
  42. };
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CSAFRemoteConnectionData
  45. class ATL_NO_VTABLE CSAFRemoteConnectionData :
  46. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  47. public IDispatchImpl<ISAFRemoteConnectionData, &IID_ISAFRemoteConnectionData, &LIBID_HelpServiceTypeLib>
  48. {
  49. long m_NumSessions;
  50. SSessionInfoItem* m_SessionInfoTable;
  51. CComBSTR m_bstrServerName;
  52. void Cleanup();
  53. public:
  54. DECLARE_NO_REGISTRY()
  55. DECLARE_NOT_AGGREGATABLE(CSAFRemoteConnectionData)
  56. BEGIN_COM_MAP(CSAFRemoteConnectionData)
  57. COM_INTERFACE_ENTRY(ISAFRemoteConnectionData)
  58. COM_INTERFACE_ENTRY(IDispatch)
  59. END_COM_MAP()
  60. CSAFRemoteConnectionData();
  61. ~CSAFRemoteConnectionData();
  62. HRESULT InitUserSessionsInfo(/*[in]*/ BSTR bstrServer );
  63. static HRESULT Populate( /*[in]*/ CPCHCollection* pColl );
  64. // ISAFRemoteConnectionData
  65. public:
  66. STDMETHOD(ConnectionParms)( /*[in ]*/ BSTR bstrServer ,
  67. /*[in ]*/ BSTR bstrUser ,
  68. /*[in ]*/ BSTR bstrDomain ,
  69. /*[in ]*/ long lSessionID ,
  70. /*[in ]*/ BSTR bstrUserHelpBlob ,
  71. /*[out, retval]*/ BSTR *bstrConnectionString );
  72. STDMETHOD(Sessions)( /*[in, optional]*/ VARIANT vUser, /*[in, optional]*/ VARIANT vDomain, /*[out, retval]*/ IPCHCollection* *ppC );
  73. STDMETHOD(Users )( /*[out, retval]*/ IPCHCollection* *ppC );
  74. };
  75. /////////////////////////////////////////////////////////////////////////////
  76. // CSAFUser
  77. class ATL_NO_VTABLE CSAFUser :
  78. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  79. public IDispatchImpl<ISAFUser, &IID_ISAFUser, &LIBID_HelpServiceTypeLib>
  80. {
  81. CComBSTR m_bstrUserName;
  82. CComBSTR m_bstrDomainName;
  83. void Cleanup();
  84. public:
  85. CSAFUser();
  86. ~CSAFUser();
  87. DECLARE_NO_REGISTRY()
  88. DECLARE_NOT_AGGREGATABLE(CSAFUser)
  89. BEGIN_COM_MAP(CSAFUser)
  90. COM_INTERFACE_ENTRY(ISAFUser)
  91. COM_INTERFACE_ENTRY(IDispatch)
  92. END_COM_MAP()
  93. // ISAFUser
  94. public:
  95. STDMETHOD(get_UserName )(/*[out, retval]*/ BSTR *pbstrUserName );
  96. STDMETHOD(get_DomainName )(/*[out, retval]*/ BSTR *pbstrDomainName);
  97. STDMETHOD(put_UserName )(/*[in ]*/ BSTR bstrUserName);
  98. STDMETHOD(put_DomainName )(/*[in ]*/ BSTR bstrDomainName);
  99. };
  100. /////////////////////////////////////////////////////////////////////////////
  101. // CSAFSession
  102. class ATL_NO_VTABLE CSAFSession :
  103. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  104. public IDispatchImpl<ISAFSession, &IID_ISAFSession, &LIBID_HelpServiceTypeLib>
  105. {
  106. CComBSTR m_bstrUserName;
  107. CComBSTR m_bstrDomainName;
  108. DWORD m_dwSessionID;
  109. SessionStateEnum m_SessionConnectState;
  110. void Cleanup();
  111. public:
  112. CSAFSession();
  113. ~CSAFSession();
  114. DECLARE_NO_REGISTRY()
  115. DECLARE_NOT_AGGREGATABLE(CSAFSession)
  116. BEGIN_COM_MAP(CSAFSession)
  117. COM_INTERFACE_ENTRY(ISAFSession)
  118. COM_INTERFACE_ENTRY(IDispatch)
  119. END_COM_MAP()
  120. // ISAFSession
  121. public:
  122. STDMETHOD(get_SessionID )(/*[out, retval]*/ DWORD *dwSessionID );
  123. STDMETHOD(put_SessionID )(/*[in ]*/ DWORD dwSessionID );
  124. STDMETHOD(get_SessionState)(/*[out, retval]*/ SessionStateEnum *SessionState );
  125. STDMETHOD(put_SessionState)(/*[in ]*/ SessionStateEnum SessionState );
  126. STDMETHOD(get_UserName )(/*[out, retval]*/ BSTR *bstrUserName );
  127. STDMETHOD(put_UserName )(/*[in ]*/ BSTR bstrUserName );
  128. STDMETHOD(get_DomainName )(/*[out, retval]*/ BSTR *bstrDomainName );
  129. STDMETHOD(put_DomainName )(/*[in ]*/ BSTR bstrDomainName );
  130. };
  131. #endif //__SAF_UNSOLICITEDRC_H_