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.

154 lines
3.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. dlgrecon.h
  7. Reconcile dialog
  8. FILE HISTORY:
  9. */
  10. #ifndef _DLGRECON_H
  11. #define _DLGRECON_H
  12. #ifndef _BUSYDLG_H
  13. #include "busydlg.h"
  14. #endif
  15. /*---------------------------------------------------------------------------
  16. CScopeReconInfo
  17. ---------------------------------------------------------------------------*/
  18. class CScopeReconInfo
  19. {
  20. public:
  21. CScopeReconInfo()
  22. : m_pScanList(NULL),
  23. m_dwScopeId(0xFFFFFFFF)
  24. {};
  25. ~CScopeReconInfo()
  26. {
  27. }
  28. CScopeReconInfo(CScopeReconInfo & ScopeReconInfo)
  29. {
  30. *this = ScopeReconInfo;
  31. }
  32. CScopeReconInfo & operator = (const CScopeReconInfo & ScopeReconInfo)
  33. {
  34. if (this != &ScopeReconInfo)
  35. {
  36. m_dwScopeId = ScopeReconInfo.m_dwScopeId;
  37. m_strName = ScopeReconInfo.m_strName;
  38. m_pScanList = ScopeReconInfo.m_pScanList;
  39. }
  40. return *this;
  41. }
  42. void FreeScanList()
  43. {
  44. if (m_pScanList)
  45. {
  46. ::DhcpRpcFreeMemory(m_pScanList);
  47. m_pScanList = NULL;
  48. }
  49. }
  50. public:
  51. DWORD m_dwScopeId;
  52. CString m_strName;
  53. LPDHCP_SCAN_LIST m_pScanList;
  54. };
  55. typedef CArray<CScopeReconInfo, CScopeReconInfo&> CScopeReconArrayBase;
  56. class CScopeReconArray : public CScopeReconArrayBase
  57. {
  58. public:
  59. ~CScopeReconArray()
  60. {
  61. for (int i = 0; i < GetSize(); i++)
  62. GetAt(i).FreeScanList();
  63. }
  64. };
  65. /*---------------------------------------------------------------------------
  66. CReconcileWorker
  67. ---------------------------------------------------------------------------*/
  68. class CReconcileWorker : public CDlgWorkerThread
  69. {
  70. public:
  71. CReconcileWorker(CDhcpServer * pServer, CScopeReconArray * pScopeReconArray);
  72. ~CReconcileWorker();
  73. void OnDoAction();
  74. protected:
  75. void CheckAllScopes();
  76. void CheckMScopes();
  77. void CheckScopes();
  78. DWORD ScanScope(CString & strName, DWORD dwScopeId);
  79. public:
  80. CDhcpServer * m_pServer;
  81. BOOL m_fReconcileAll;
  82. BOOL m_fMulticast;
  83. DWORD m_dwScopeId;
  84. CString m_strName;
  85. CScopeReconArray * m_pScopeReconArray;
  86. };
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CReconcileDlg dialog
  89. class CReconcileDlg : public CBaseDialog
  90. {
  91. // Construction
  92. public:
  93. CReconcileDlg(ITFSNode * pServerNode,
  94. BOOL fReconcileAll = FALSE,
  95. CWnd* pParent = NULL); // standard constructor
  96. // Dialog Data
  97. //{{AFX_DATA(CReconcileDlg)
  98. enum { IDD = IDD_RECONCILIATION };
  99. CListCtrl m_listctrlAddresses;
  100. //}}AFX_DATA
  101. BOOL m_bMulticast;
  102. // Context Help Support
  103. virtual DWORD * GetHelpMap() { return DhcpGetHelpMap(CReconcileDlg::IDD); }
  104. // Implementation
  105. protected:
  106. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  107. void SetOkButton(BOOL bListBuilt);
  108. void AddItemToList(CScopeReconInfo & scopeReconInfo);
  109. // Generated message map functions
  110. //{{AFX_MSG(CReconcileDlg)
  111. virtual BOOL OnInitDialog();
  112. virtual void OnOK();
  113. //}}AFX_MSG
  114. DECLARE_MESSAGE_MAP()
  115. SPITFSNode m_spNode;
  116. BOOL m_bListBuilt;
  117. BOOL m_fReconcileAll;
  118. CScopeReconArray m_ScopeReconArray;
  119. };
  120. #endif _DLGRECON_H