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.

114 lines
3.7 KiB

  1. #ifndef ServerNode_h
  2. #define ServerNode_h
  3. #include "resource.h"
  4. #include <atlsnap.h>
  5. #include <objidl.h>
  6. #include "pop3.h"
  7. #include <P3Admin.h>
  8. class CRootNode;
  9. class CDomainNode;
  10. typedef std::list<CDomainNode*> DOMAINLIST;
  11. // This change is necessary in order to get a range of Menu ID entries that works
  12. #define SNAPINCOMMAND_RANGE_ENTRY_POP3(id1, id2, func) \
  13. if (id1 <= nID && nID <= id2) \
  14. { \
  15. hr = func(nID, bHandled, pObj); \
  16. if (bHandled) \
  17. return hr; \
  18. }
  19. //////////////////////////////////////////////////////////////////////////////////
  20. //
  21. // CServerNode
  22. //
  23. //////////////////////////////////////////////////////////////////////////////////
  24. class CServerNode : public CSnapInItemImpl<CServerNode>
  25. {
  26. public:
  27. static const GUID* m_NODETYPE;
  28. static const OLECHAR* m_SZNODETYPE;
  29. static const OLECHAR* m_SZDISPLAY_NAME;
  30. static const CLSID* m_SNAPIN_CLASSID;
  31. CComPtr<IControlbar> m_spControlBar;
  32. BEGIN_SNAPINCOMMAND_MAP(CServerNode, FALSE)
  33. SNAPINCOMMAND_ENTRY ( IDM_SERVER_TOP_DISCONNECT, OnDisconnect )
  34. SNAPINCOMMAND_ENTRY ( IDM_SERVER_NEW_DOMAIN, OnNewDomain )
  35. SNAPINCOMMAND_RANGE_ENTRY_POP3( IDM_SERVER_TASK_START, IDM_SERVER_TASK_RESUME, OnServerService )
  36. END_SNAPINCOMMAND_MAP()
  37. // Standard Class Constructor/Destructor
  38. CServerNode(BSTR strServerName, CRootNode* pParent, BOOL bLocalServer = FALSE);
  39. virtual ~CServerNode();
  40. // Standard ATL Snap-In Impl Over-rides
  41. STDMETHOD(QueryPagesFor)(DATA_OBJECT_TYPES type)
  42. {
  43. if ( type == CCT_SCOPE || type == CCT_RESULT )
  44. {
  45. return S_OK;
  46. }
  47. return S_FALSE;
  48. }
  49. STDMETHOD(GetScopePaneInfo)(SCOPEDATAITEM *pScopeDataItem);
  50. STDMETHOD(GetResultPaneInfo)(RESULTDATAITEM *pResultDataItem);
  51. LPOLESTR GetResultPaneColInfo(int nCol);
  52. STDMETHOD(GetResultViewType)( LPOLESTR* ppViewType, long* pViewOptions );
  53. STDMETHOD(Notify)( MMC_NOTIFY_TYPE event, LPARAM arg, LPARAM param, IComponentData* pComponentData, IComponent* pComponent, DATA_OBJECT_TYPES type);
  54. // MenuItem Implementations
  55. STDMETHOD(AddMenuItems) (LPCONTEXTMENUCALLBACK piCallback, long* pInsertionAllowed, DATA_OBJECT_TYPES type );
  56. STDMETHOD(OnNewDomain) (bool& bHandled, CSnapInObjectRootBase* pObj );
  57. STDMETHOD(OnDisconnect) (bool& bHandled, CSnapInObjectRootBase* pObj );
  58. STDMETHOD(OnServerService) (UINT nID, bool& bHandled, CSnapInObjectRootBase* pObj );
  59. // PropertySheet Implementation
  60. STDMETHOD(CreatePropertyPages)(LPPROPERTYSHEETCALLBACK lpProvider, LONG_PTR handle, IUnknown* pUnk, DATA_OBJECT_TYPES type);
  61. public:
  62. // Public function for children to delete themselves
  63. HRESULT DeleteDomain(CDomainNode* pDomainNode);
  64. // Server Properties
  65. HRESULT m_hrValidServer;
  66. BOOL m_bCreateUser;
  67. CComPtr<IP3Config> m_spConfig;
  68. // Helper Function
  69. HRESULT GetAuth(BOOL* pbHashPW = NULL, BOOL* pbSAM = NULL);
  70. HRESULT GetConfirmAddUser( BOOL *pbConfirm );
  71. HRESULT SetConfirmAddUser( BOOL bConfirm );
  72. void Release();
  73. private:
  74. // Private function to help with refresh and expanding
  75. HRESULT OnExpand(BOOL bExpand, HSCOPEITEM hScopeItem, IConsole* pConsole);
  76. // Parent Information
  77. CRootNode* m_pParent;
  78. // Server Information
  79. DOMAINLIST m_lDomains;
  80. // Column text needs to be allocated by us, so we'll free them in the destructor
  81. CComBSTR m_bstrAuthentication;
  82. CComBSTR m_bstrMailRoot;
  83. CComBSTR m_bstrPort;
  84. CComBSTR m_bstrLogLevel;
  85. CComBSTR m_bstrServiceStatus;
  86. //Ref Count
  87. LONG m_lRefCount;
  88. };
  89. #endif // ServerNode_h