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.

109 lines
3.3 KiB

  1. // admin.h : Declaration of the CNntpAdmin
  2. // Dependencies:
  3. #include "metafact.h"
  4. /////////////////////////////////////////////////////////////////////////////
  5. // nntpadm
  6. class CNntpAdmin :
  7. public CComDualImpl<INntpAdmin, &IID_INntpAdmin, &LIBID_NNTPADMLib>,
  8. public ISupportErrorInfo,
  9. public CComObjectRoot,
  10. public CComCoClass<CNntpAdmin,&CLSID_CNntpAdmin>
  11. {
  12. public:
  13. CNntpAdmin();
  14. virtual ~CNntpAdmin ();
  15. BEGIN_COM_MAP(CNntpAdmin)
  16. COM_INTERFACE_ENTRY(IDispatch)
  17. COM_INTERFACE_ENTRY(INntpAdmin)
  18. COM_INTERFACE_ENTRY(ISupportErrorInfo)
  19. END_COM_MAP()
  20. //DECLARE_NOT_AGGREGATABLE(CNntpAdmin)
  21. // Remove the comment from the line above if you don't want your object to
  22. // support aggregation. The default is to support it
  23. DECLARE_REGISTRY(CNntpAdmin, _T("Nntpadm.Admin.1"), _T("Nntpadm.Admin"), IDS_NNTPADMIN_DESC, THREADFLAGS_BOTH)
  24. // ISupportsErrorInfo
  25. STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
  26. // INntpAdmin
  27. public:
  28. //////////////////////////////////////////////////////////////////////
  29. // Properties:
  30. //////////////////////////////////////////////////////////////////////
  31. // Pointers to other INntpAdmin interfaces:
  32. STDMETHODIMP get_ServerAdmin ( IDispatch ** ppIDispatch );
  33. // STDMETHODIMP get_ServiceAdmin ( IDispatch ** ppIDispatch );
  34. // Which service to configure:
  35. STDMETHODIMP get_Server ( BSTR * pstrServer );
  36. STDMETHODIMP put_Server ( BSTR strServer );
  37. STDMETHODIMP get_ServiceInstance ( long * plServiceInstance );
  38. STDMETHODIMP put_ServiceInstance ( long lServiceInstance );
  39. // Versioning:
  40. STDMETHODIMP get_HighVersion ( long * plHighVersion );
  41. STDMETHODIMP get_LowVersion ( long * plLowVersion );
  42. STDMETHODIMP get_BuildNum ( long * plBuildNumber );
  43. STDMETHODIMP get_ServiceVersion ( long * plServiceVersion );
  44. //////////////////////////////////////////////////////////////////////
  45. // Methods:
  46. //////////////////////////////////////////////////////////////////////
  47. STDMETHODIMP EnumerateInstances ( SAFEARRAY ** ppsaInstances );
  48. STDMETHODIMP EnumerateInstancesVariant ( SAFEARRAY ** ppsaInstances );
  49. STDMETHODIMP CreateInstance (
  50. BSTR strNntpFileDirectory,
  51. BSTR strHomeDirectory,
  52. BSTR strProgId,
  53. BSTR strMdbGuid,
  54. long * plInstanceId
  55. );
  56. STDMETHODIMP DestroyInstance ( long lInstanceId );
  57. STDMETHODIMP ErrorToString ( long lErrorCode, BSTR * pstrError );
  58. STDMETHODIMP Tokenize ( BSTR strIn, BSTR * pstrOut );
  59. STDMETHODIMP Truncate ( BSTR strIn, long cMaxChars, BSTR * pstrOut );
  60. //////////////////////////////////////////////////////////////////////
  61. // Data:
  62. //////////////////////////////////////////////////////////////////////
  63. private:
  64. CComBSTR m_strServer;
  65. DWORD m_dwServiceInstance;
  66. DWORD m_dwServiceVersion;
  67. // Metabase:
  68. CMetabaseFactory m_mbFactory;
  69. HRESULT QueryMetabaseInstances ( IMSAdminBase * pMetabase, SAFEARRAY ** ppsaInstances );
  70. HRESULT CreateNewInstance (
  71. IMSAdminBase * pMetabase,
  72. BSTR strNntpFileDirectory,
  73. BSTR strHomeDirectory,
  74. BSTR strProgId,
  75. BSTR strMdbGuid,
  76. long * plInstanceId
  77. );
  78. HRESULT DeleteInstance ( IMSAdminBase * pMetabase, long lInstanceId );
  79. HRESULT CreateVRoot(
  80. CMetabaseKey &mkeyNntp,
  81. BSTR strVPath,
  82. BSTR strProgId,
  83. BSTR strMdbGuid,
  84. LPWSTR wszKeyPath
  85. );
  86. };