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.

108 lines
3.4 KiB

  1. // admin.h : Declaration of the CSmtpAdmin
  2. // Dependencies:
  3. #include "resource.h" // main symbols
  4. #include "metafact.h"
  5. struct IMSAdminBase;
  6. // Service Versioning:
  7. #define SERVICE_IS_K2(dwVersion) ((dwVersion) == 1)
  8. #define SERVICE_IS_MCIS(dwVersion) ((dwVersion) == 0)
  9. /////////////////////////////////////////////////////////////////////////////
  10. // smtpadm
  11. class CSmtpAdmin :
  12. public CComDualImpl<ISmtpAdmin, &IID_ISmtpAdmin, &LIBID_SMTPADMLib>,
  13. public ISupportErrorInfo,
  14. public CComObjectRoot,
  15. public CComCoClass<CSmtpAdmin,&CLSID_CSmtpAdmin>
  16. {
  17. public:
  18. CSmtpAdmin();
  19. virtual ~CSmtpAdmin ();
  20. BEGIN_COM_MAP(CSmtpAdmin)
  21. COM_INTERFACE_ENTRY(IDispatch)
  22. COM_INTERFACE_ENTRY(ISmtpAdmin)
  23. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  24. END_COM_MAP()
  25. //DECLARE_NOT_AGGREGATABLE(CSmtpAdmin)
  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(CSmtpAdmin, _T("Smtpadm.Admin.1"), _T("Smtpadm.Admin"), IDS_SMTPADMIN_DESC, THREADFLAGS_BOTH)
  29. // ISupportsErrorInfo
  30. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  31. // ISmtpAdmin
  32. public:
  33. //////////////////////////////////////////////////////////////////////
  34. // Properties:
  35. //////////////////////////////////////////////////////////////////////
  36. // Pointers to other ISmtpAdmin interfaces:
  37. STDMETHODIMP get_ServiceAdmin ( IDispatch ** ppIDispatch );
  38. STDMETHODIMP get_VirtualServerAdmin ( IDispatch ** ppIDispatch );
  39. STDMETHODIMP get_SessionsAdmin ( IDispatch ** ppIDispatch );
  40. STDMETHODIMP get_AliasAdmin ( IDispatch ** ppIDispatch );
  41. STDMETHODIMP get_UserAdmin ( IDispatch ** ppIDispatch );
  42. STDMETHODIMP get_DLAdmin ( IDispatch ** ppIDispatch );
  43. STDMETHODIMP get_DomainAdmin ( IDispatch ** ppIDispatch );
  44. STDMETHODIMP get_VirtualDirectoryAdmin ( IDispatch ** ppIDispatch );
  45. // Which service to configure:
  46. STDMETHODIMP get_Server ( BSTR * pstrServer );
  47. STDMETHODIMP put_Server ( BSTR strServer );
  48. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  49. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  50. // Versioning:
  51. STDMETHODIMP get_HighVersion ( long * plHighVersion );
  52. STDMETHODIMP get_LowVersion ( long * plLowVersion );
  53. STDMETHODIMP get_BuildNum ( long * plBuildNumber );
  54. STDMETHODIMP get_ServiceVersion ( long * plServiceVersion );
  55. //////////////////////////////////////////////////////////////////////
  56. // Methods:
  57. //////////////////////////////////////////////////////////////////////
  58. STDMETHODIMP EnumerateInstances ( SAFEARRAY ** ppsaInstances );
  59. STDMETHODIMP EnumerateInstancesVariant ( SAFEARRAY ** ppsaInstances );
  60. STDMETHODIMP CreateInstance ( BSTR pstrMailRoot, long * plInstanceId );
  61. STDMETHODIMP DestroyInstance ( long lInstanceId );
  62. STDMETHODIMP ErrorToString ( DWORD dwErrorCode, BSTR * pstrError );
  63. STDMETHODIMP Tokenize ( BSTR strIn, BSTR * pstrOut );
  64. //////////////////////////////////////////////////////////////////////
  65. // Data:
  66. //////////////////////////////////////////////////////////////////////
  67. private:
  68. CComBSTR m_strServer;
  69. DWORD m_dwServiceInstance;
  70. DWORD m_dwServiceVersion;
  71. // Metabase:
  72. CMetabaseFactory m_mbFactory;
  73. HRESULT QueryMetabaseInstances ( IMSAdminBase * pMetabase, SAFEARRAY ** ppsaInstances );
  74. HRESULT CreateNewInstance ( IMSAdminBase * pMetabase, long * plInstanceId, BSTR pstrMailRoot );
  75. HRESULT DeleteInstance ( IMSAdminBase * pMetabase, long lInstanceId );
  76. };