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.

177 lines
5.4 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. STDMETHOD(ModemConnected)( /*[in ]*/ BSTR bstrServer ,
  75. /*[out, retval]*/ VARIANT_BOOL *fModemConnected);
  76. };
  77. /////////////////////////////////////////////////////////////////////////////
  78. // CSAFUser
  79. class ATL_NO_VTABLE CSAFUser :
  80. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  81. public IDispatchImpl<ISAFUser, &IID_ISAFUser, &LIBID_HelpServiceTypeLib>
  82. {
  83. CComBSTR m_bstrUserName;
  84. CComBSTR m_bstrDomainName;
  85. void Cleanup();
  86. public:
  87. CSAFUser();
  88. ~CSAFUser();
  89. DECLARE_NO_REGISTRY()
  90. DECLARE_NOT_AGGREGATABLE(CSAFUser)
  91. BEGIN_COM_MAP(CSAFUser)
  92. COM_INTERFACE_ENTRY(ISAFUser)
  93. COM_INTERFACE_ENTRY(IDispatch)
  94. END_COM_MAP()
  95. // ISAFUser
  96. public:
  97. STDMETHOD(get_UserName )(/*[out, retval]*/ BSTR *pbstrUserName );
  98. STDMETHOD(get_DomainName )(/*[out, retval]*/ BSTR *pbstrDomainName);
  99. STDMETHOD(put_UserName )(/*[in ]*/ BSTR bstrUserName);
  100. STDMETHOD(put_DomainName )(/*[in ]*/ BSTR bstrDomainName);
  101. };
  102. /////////////////////////////////////////////////////////////////////////////
  103. // CSAFSession
  104. class ATL_NO_VTABLE CSAFSession :
  105. public CComObjectRootEx<MPC::CComSafeMultiThreadModel>,
  106. public IDispatchImpl<ISAFSession, &IID_ISAFSession, &LIBID_HelpServiceTypeLib>
  107. {
  108. CComBSTR m_bstrUserName;
  109. CComBSTR m_bstrDomainName;
  110. DWORD m_dwSessionID;
  111. SessionStateEnum m_SessionConnectState;
  112. void Cleanup();
  113. public:
  114. CSAFSession();
  115. ~CSAFSession();
  116. DECLARE_NO_REGISTRY()
  117. DECLARE_NOT_AGGREGATABLE(CSAFSession)
  118. BEGIN_COM_MAP(CSAFSession)
  119. COM_INTERFACE_ENTRY(ISAFSession)
  120. COM_INTERFACE_ENTRY(IDispatch)
  121. END_COM_MAP()
  122. // ISAFSession
  123. public:
  124. STDMETHOD(get_SessionID )(/*[out, retval]*/ DWORD *dwSessionID );
  125. STDMETHOD(put_SessionID )(/*[in ]*/ DWORD dwSessionID );
  126. STDMETHOD(get_SessionState)(/*[out, retval]*/ SessionStateEnum *SessionState );
  127. STDMETHOD(put_SessionState)(/*[in ]*/ SessionStateEnum SessionState );
  128. STDMETHOD(get_UserName )(/*[out, retval]*/ BSTR *bstrUserName );
  129. STDMETHOD(put_UserName )(/*[in ]*/ BSTR bstrUserName );
  130. STDMETHOD(get_DomainName )(/*[out, retval]*/ BSTR *bstrDomainName );
  131. STDMETHOD(put_DomainName )(/*[in ]*/ BSTR bstrDomainName );
  132. };
  133. #endif //__SAF_UNSOLICITEDRC_H_