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.

127 lines
4.1 KiB

  1. // service.h: Implementation of INntpVirtualServer
  2. /////////////////////////////////////////////////////////////////////////////
  3. // Dependencies
  4. /////////////////////////////////////////////////////////////////////////////
  5. #include "metafact.h"
  6. /////////////////////////////////////////////////////////////////////////////
  7. // nntpadm
  8. class CNntpAdminService :
  9. public CComDualImpl<INntpService, &IID_INntpService, &LIBID_NNTPADMLib>,
  10. public ISupportErrorInfo,
  11. public CComObjectRoot,
  12. public CComCoClass<CNntpAdminService,&CLSID_CNntpService>
  13. {
  14. public:
  15. CNntpAdminService();
  16. virtual ~CNntpAdminService ();
  17. BEGIN_COM_MAP(CNntpAdminService)
  18. COM_INTERFACE_ENTRY(IDispatch)
  19. COM_INTERFACE_ENTRY(INntpService)
  20. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  21. END_COM_MAP()
  22. //DECLARE_NOT_AGGREGATABLE(CNntpAdminService)
  23. // Remove the comment from the line above if you don't want your object to
  24. // support aggregation. The default is to support it
  25. DECLARE_REGISTRY(CNntpAdminService, _T("Nntpadm.Service.1"), _T("Nntpadm.Service"), IDS_NNTPADMINSERVER_DESC, THREADFLAGS_BOTH)
  26. // ISupportsErrorInfo
  27. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  28. // INntpService
  29. public:
  30. //////////////////////////////////////////////////////////////////////
  31. // Properties:
  32. //////////////////////////////////////////////////////////////////////
  33. // Which Server to configure:
  34. STDMETHODIMP get_Server ( BSTR * pstrServer );
  35. STDMETHODIMP put_Server ( BSTR strServer );
  36. // Server Properties:
  37. STDMETHODIMP get_ArticleTimeLimit ( long * plArticleTimeLimit );
  38. STDMETHODIMP put_ArticleTimeLimit ( long lArticleTimeLimit );
  39. STDMETHODIMP get_HistoryExpiration ( long * plHistoryExpiration );
  40. STDMETHODIMP put_HistoryExpiration ( long lHistoryExpiration );
  41. STDMETHODIMP get_HonorClientMsgIDs ( BOOL * pfHonorClientMsgIDs );
  42. STDMETHODIMP put_HonorClientMsgIDs ( BOOL fHonorClientMsgIDs );
  43. STDMETHODIMP get_SmtpServer ( BSTR * pstrSmtpServer );
  44. STDMETHODIMP put_SmtpServer ( BSTR strSmtpServer );
  45. STDMETHODIMP get_AllowClientPosts ( BOOL * pfAllowClientPosts );
  46. STDMETHODIMP put_AllowClientPosts ( BOOL fAllowClientPosts );
  47. STDMETHODIMP get_AllowFeedPosts ( BOOL * pfAllowFeedPosts );
  48. STDMETHODIMP put_AllowFeedPosts ( BOOL fAllowFeedPosts );
  49. STDMETHODIMP get_AllowControlMsgs ( BOOL * pfAllowControlMsgs );
  50. STDMETHODIMP put_AllowControlMsgs ( BOOL fAllowControlMsgs );
  51. STDMETHODIMP get_DefaultModeratorDomain ( BSTR * pstrDefaultModeratorDomain );
  52. STDMETHODIMP put_DefaultModeratorDomain ( BSTR strDefaultModeratorDomain );
  53. STDMETHODIMP get_CommandLogMask ( long * plCommandLogMask );
  54. STDMETHODIMP put_CommandLogMask ( long lCommandLogMask );
  55. STDMETHODIMP get_DisableNewnews ( BOOL * pfDisableNewnews );
  56. STDMETHODIMP put_DisableNewnews ( BOOL fDisableNewnews );
  57. STDMETHODIMP get_ExpireRunFrequency ( long * plExpireRunFrequency );
  58. STDMETHODIMP put_ExpireRunFrequency ( long lExpireRunFrequency );
  59. STDMETHODIMP get_ShutdownLatency ( long * plShutdownLatency );
  60. STDMETHODIMP put_ShutdownLatency ( long lShutdownLatency );
  61. //////////////////////////////////////////////////////////////////////
  62. // Methods:
  63. //////////////////////////////////////////////////////////////////////
  64. STDMETHODIMP Get ( );
  65. STDMETHODIMP Set ( BOOL fFailIfChanged);
  66. //////////////////////////////////////////////////////////////////////
  67. // Data:
  68. //////////////////////////////////////////////////////////////////////
  69. private:
  70. CComBSTR m_strServer;
  71. DWORD m_dwArticleTimeLimit;
  72. DWORD m_dwHistoryExpiration;
  73. BOOL m_fHonorClientMsgIDs;
  74. CComBSTR m_strSmtpServer;
  75. BOOL m_fAllowClientPosts;
  76. BOOL m_fAllowFeedPosts;
  77. BOOL m_fAllowControlMsgs;
  78. CComBSTR m_strDefaultModeratorDomain;
  79. DWORD m_dwCommandLogMask;
  80. BOOL m_fDisableNewnews;
  81. DWORD m_dwExpireRunFrequency;
  82. DWORD m_dwShutdownLatency;
  83. // Status:
  84. BOOL m_fGotProperties;
  85. DWORD m_bvChangedFields;
  86. FILETIME m_ftLastChanged;
  87. // Metabase:
  88. CMetabaseFactory m_mbFactory;
  89. HRESULT GetPropertiesFromMetabase ( IMSAdminBase * pMetabase);
  90. HRESULT SendPropertiesToMetabase ( BOOL fFailIfChanged, IMSAdminBase * pMetabase);
  91. // Validation:
  92. BOOL ValidateStrings ( ) const;
  93. BOOL ValidateProperties ( ) const;
  94. void CorrectProperties ( );
  95. };