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.

149 lines
4.1 KiB

  1. // vdir.h : Declaration of the CSmtpAdminVirtualDirectory
  2. #ifndef _VDIR_H_
  3. #define _VDIR_H_
  4. #include "resource.h" // main symbols
  5. #include "smtptype.h"
  6. #include "smtpapi.h"
  7. #include "metafact.h"
  8. class CMetabaseKey;
  9. /////////////////////////////////////////////////////////////////////////////
  10. // smtpadm
  11. class CSmtpAdminVirtualDirectory :
  12. public CComDualImpl<ISmtpAdminVirtualDirectory, &IID_ISmtpAdminVirtualDirectory, &LIBID_SMTPADMLib>,
  13. public ISupportErrorInfo,
  14. public CComObjectRoot,
  15. public CComCoClass<CSmtpAdminVirtualDirectory,&CLSID_CSmtpAdminVirtualDirectory>
  16. {
  17. public:
  18. CSmtpAdminVirtualDirectory();
  19. virtual ~CSmtpAdminVirtualDirectory();
  20. BEGIN_COM_MAP(CSmtpAdminVirtualDirectory)
  21. COM_INTERFACE_ENTRY(IDispatch)
  22. COM_INTERFACE_ENTRY(ISmtpAdminVirtualDirectory)
  23. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  24. END_COM_MAP()
  25. //DECLARE_NOT_AGGREGATABLE(CSmtpAdminVirtualDirectory)
  26. // Remove the comment from the line above if you don't want your object to
  27. // support aggregation. The default is to support it
  28. DECLARE_REGISTRY(CSmtpAdminVirtualDirectory, _T("Smtpadm.VirtualDirectory.1"), _T("Smtpadm.VirtualDirectory"), IDS_SMTPADMIN_VIRTUALDIRECTORY_DESC, THREADFLAGS_BOTH)
  29. // ISupportsErrorInfo
  30. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  31. // ISmtpAdminVirtualDirectory
  32. public:
  33. //////////////////////////////////////////////////////////////////////
  34. // Properties:
  35. //////////////////////////////////////////////////////////////////////
  36. // Which service to configure:
  37. STDMETHODIMP get_Server ( BSTR * pstrServer );
  38. STDMETHODIMP put_Server ( BSTR strServer );
  39. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  40. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  41. // Enumeration properties:
  42. STDMETHODIMP get_Count ( long * plCount );
  43. // The current virtual directory's properties:
  44. STDMETHODIMP get_VirtualName ( BSTR * pstrName );
  45. STDMETHODIMP put_VirtualName ( BSTR strName );
  46. STDMETHODIMP get_Directory ( BSTR * pstrPath );
  47. STDMETHODIMP put_Directory ( BSTR strPath );
  48. STDMETHODIMP get_User ( BSTR * pstrUserName );
  49. STDMETHODIMP put_User ( BSTR strUserName );
  50. STDMETHODIMP get_Password ( BSTR * pstrPassword );
  51. STDMETHODIMP put_Password ( BSTR strPassword );
  52. STDMETHODIMP get_LogAccess ( BOOL* pfLogAccess );
  53. STDMETHODIMP put_LogAccess ( BOOL fLogAccess );
  54. STDMETHODIMP get_AccessPermission( long* plAccessPermission );
  55. STDMETHODIMP put_AccessPermission( long lAccessPermission );
  56. STDMETHODIMP get_SslAccessPermission( long* plSslAccessPermission );
  57. STDMETHODIMP put_SslAccessPermission( long lSslAccessPermission );
  58. //////////////////////////////////////////////////////////////////////
  59. // Methods:
  60. //////////////////////////////////////////////////////////////////////
  61. // home directory "/"
  62. STDMETHODIMP GetHomeDirectory ( );
  63. STDMETHODIMP SetHomeDirectory ( );
  64. // create / delete entry
  65. STDMETHODIMP Create ( );
  66. STDMETHODIMP Delete ( );
  67. // get /set property for current vdir
  68. STDMETHODIMP Get ( );
  69. STDMETHODIMP Set ( );
  70. // enumeration
  71. STDMETHODIMP Enumerate ( );
  72. STDMETHODIMP GetNth ( long lIndex );
  73. //////////////////////////////////////////////////////////////////////
  74. // Data:
  75. //////////////////////////////////////////////////////////////////////
  76. private:
  77. CComBSTR m_strServer;
  78. DWORD m_dwServiceInstance;
  79. long m_lCount;
  80. CComBSTR m_strName;
  81. CComBSTR m_strDirectory;
  82. CComBSTR m_strUser;
  83. CComBSTR m_strPassword;
  84. BOOL m_fLogAccess;
  85. DWORD m_dwAccess;
  86. DWORD m_dwSslAccess;
  87. BOOL m_fEnumerateCalled;
  88. // Metabase:
  89. CMetabaseFactory m_mbFactory;
  90. // Todo: add a list
  91. //PVDIR_ENTRY m_pVdir[];
  92. LIST_ENTRY m_list;
  93. // private methods
  94. void Clear(); // reset the state
  95. BOOL GetVRootPropertyFromMetabase( CMetabaseKey* hMB, const TCHAR* szName,
  96. TCHAR* szDirectory, TCHAR* szUser, TCHAR* szPassword, DWORD* pdwAccess,
  97. DWORD* pdwSslAccess, BOOL* pfLogAccess);
  98. BOOL SetVRootPropertyToMetabase( CMetabaseKey* hMB, const TCHAR* szName,
  99. const TCHAR* szDirectory, const TCHAR* szUser, const TCHAR* szPassword,
  100. DWORD dwAccess, DWORD dwSslAccess, BOOL fLogAccess);
  101. };
  102. #endif