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.

87 lines
3.0 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. croot.h
  7. DHCP root node information (the root node is not displayed
  8. in the MMC framework but contains information such as
  9. all of the servers in this snapin).
  10. FILE HISTORY:
  11. */
  12. #ifndef _CROOT_H
  13. #define _CROOT_H
  14. #ifndef _DHCPHAND_H
  15. #include "dhcphand.h"
  16. #endif
  17. #define COMPUTERNAME_LEN_MAX 255
  18. /*---------------------------------------------------------------------------
  19. Class: CDhcpRootHandler
  20. ---------------------------------------------------------------------------*/
  21. class CDhcpRootHandler : public CDhcpHandler
  22. {
  23. // Interface
  24. public:
  25. CDhcpRootHandler(ITFSComponentData *pCompData);
  26. // Node handler functionality we override
  27. OVERRIDE_NodeHandler_HasPropertyPages();
  28. OVERRIDE_NodeHandler_CreatePropertyPages();
  29. OVERRIDE_NodeHandler_OnAddMenuItems();
  30. OVERRIDE_NodeHandler_OnCommand();
  31. OVERRIDE_NodeHandler_GetString();
  32. // base handler functionality we override
  33. OVERRIDE_BaseHandlerNotify_OnExpand();
  34. OVERRIDE_BaseHandlerNotify_OnPropertyChange();
  35. OVERRIDE_BaseHandlerNotify_OnRemoveChildren();
  36. // Result handler functionality
  37. OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
  38. OVERRIDE_ResultHandler_AddMenuItems();
  39. OVERRIDE_ResultHandler_Command();
  40. OVERRIDE_ResultHandler_OnGetResultViewType();
  41. public:
  42. // helper routines
  43. void CreateLocalDhcpServer();
  44. HRESULT AddServer(LPCWSTR pServerIp, LPCTSTR pServerName, BOOL bNewServer, DWORD dwServerOptions = 0x00000000, DWORD dwRefreshInterval = 0xffffffff, BOOL bExtension = FALSE);
  45. HRESULT GetGroupName(CString * pstrGroupName);
  46. HRESULT SetGroupName(LPCTSTR pszGroupName);
  47. BOOL IsServerInList(ITFSNode * pRootNode, DHCP_IP_ADDRESS dhcpIpAddressNew, CString & strName);
  48. DWORD LoadOldServerList(ITFSNode * pRootNode);
  49. HRESULT AddServerSortedIp(ITFSNode * pNewNode, BOOL bNewServer);
  50. HRESULT AddServerSortedName(ITFSNode * pNewNode, BOOL bNewServer);
  51. public:
  52. // CDhcpHandler overrides
  53. virtual HRESULT InitializeNode(ITFSNode * pNode);
  54. // Implementation
  55. private:
  56. // Command handlers
  57. HRESULT OnCreateNewServer(ITFSNode * pNode);
  58. HRESULT OnBrowseServers(ITFSNode * pNode);
  59. HRESULT OnImportOldList(ITFSNode * pNode);
  60. BOOL OldServerListExists();
  61. // helpers
  62. HRESULT CheckMachine(ITFSNode * pRootNode, LPDATAOBJECT pDataObject);
  63. HRESULT RemoveOldEntries(ITFSNode * pRootNode, DHCP_IP_ADDRESS dhcpAddress);
  64. void UpdateResultMessage(ITFSNode * pNode);
  65. private:
  66. BOOL m_bMachineAdded;
  67. BOOL m_fViewMessage;
  68. };
  69. #endif _CROOT_H