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.

155 lines
4.9 KiB

  1. // compage1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "afxcmn.h"
  5. #include "ISAdmin.h"
  6. #include "compage1.h"
  7. #include "registry.h"
  8. #include "genpage.h"
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CCOMPAGE1 property page
  15. IMPLEMENT_DYNCREATE(CCOMPAGE1, CGenPage)
  16. CCOMPAGE1::CCOMPAGE1() : CGenPage(CCOMPAGE1::IDD)
  17. {
  18. //{{AFX_DATA_INIT(CCOMPAGE1)
  19. //}}AFX_DATA_INIT
  20. }
  21. CCOMPAGE1::~CCOMPAGE1()
  22. {
  23. }
  24. void CCOMPAGE1::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CGenPage::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(CCOMPAGE1)
  28. DDX_Control(pDX, IDC_LISTENBACKLOGSPIN1, m_spinListenBacklog);
  29. DDX_Control(pDX, IDC_LOGBATSPIN1, m_spinLogBatSpin1);
  30. DDX_Control(pDX, IDC_CACHESPIN1, m_spinCacheSpin1);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CCOMPAGE1, CGenPage)
  34. //{{AFX_MSG_MAP(CCOMPAGE1)
  35. ON_EN_CHANGE(IDC_CACHEDATA1, OnChangeCachedata1)
  36. ON_EN_CHANGE(IDC_LOGBATDATA1, OnChangeLogbatdata1)
  37. ON_EN_CHANGE(IDC_LISTENBACKLOGDATA1, OnChangeListenbacklogdata1)
  38. //}}AFX_MSG_MAP
  39. END_MESSAGE_MAP()
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CCOMPAGE1 message handlers
  42. BOOL CCOMPAGE1::OnInitDialog()
  43. {
  44. int i;
  45. CGenPage::OnInitDialog();
  46. // TODO: Add extra initialization here
  47. for (i = 0; i < ComPage_TotalNumRegEntries; i++) {
  48. m_binNumericRegistryEntries[i].bIsChanged = FALSE;
  49. m_binNumericRegistryEntries[i].ulMultipleFactor = 1;
  50. }
  51. m_binNumericRegistryEntries[ComPage_LogBat].strFieldName = _T(LOGBATNAME);
  52. m_binNumericRegistryEntries[ComPage_LogBat].ulMultipleFactor = 1024;
  53. m_binNumericRegistryEntries[ComPage_LogBat].ulDefaultValue = DEFAULTLOGFILEBATCHSIZE;
  54. m_binNumericRegistryEntries[ComPage_MemCache].strFieldName = _T(MEMORYCACHENAME);
  55. m_binNumericRegistryEntries[ComPage_MemCache].ulMultipleFactor = 1024 * 1024;
  56. m_binNumericRegistryEntries[ComPage_MemCache].ulDefaultValue = DEFAULTMEMORYCACHESIZE;
  57. m_binNumericRegistryEntries[ComPage_ListenBacklog].strFieldName = _T(LISTENBACKLOGNAME);
  58. m_binNumericRegistryEntries[ComPage_ListenBacklog].ulDefaultValue = DEFAULTLISTENBACKLOG;
  59. for (i = 0; i < ComPage_TotalNumRegEntries; i++) {
  60. if (m_rkMainKey->QueryValue(m_binNumericRegistryEntries[i].strFieldName,
  61. m_binNumericRegistryEntries[i].ulFieldValue) != ERROR_SUCCESS) {
  62. m_binNumericRegistryEntries[i].ulFieldValue = m_binNumericRegistryEntries[i].ulDefaultValue;
  63. }
  64. }
  65. m_spinLogBatSpin1.SetRange(MINLOGFILEBATCHSIZE, MAXLOGFILEBATCHSIZE);
  66. m_spinLogBatSpin1.SetPos(LESSOROF((m_binNumericRegistryEntries[ComPage_LogBat].ulFieldValue /
  67. m_binNumericRegistryEntries[ComPage_LogBat].ulMultipleFactor), MAXLOGFILEBATCHSIZE));
  68. m_spinCacheSpin1.SetRange(MINMEMORYCACHESIZE, MAXMEMORYCACHESIZE);
  69. m_spinCacheSpin1.SetPos(LESSOROF((m_binNumericRegistryEntries[ComPage_MemCache].ulFieldValue /
  70. m_binNumericRegistryEntries[ComPage_MemCache].ulMultipleFactor), MAXMEMORYCACHESIZE));
  71. m_spinListenBacklog.SetRange(MINLISTENBACKLOG, MAXLISTENBACKLOG);
  72. m_spinListenBacklog.SetPos(LESSOROF((m_binNumericRegistryEntries[ComPage_ListenBacklog].ulFieldValue /
  73. m_binNumericRegistryEntries[ComPage_ListenBacklog].ulMultipleFactor), MAXLISTENBACKLOG));
  74. m_bSetChanged = TRUE; // Any more changes come from the user
  75. return TRUE; // return TRUE unless you set the focus to a control
  76. // EXCEPTION: OCX Property Pages should return FALSE
  77. }
  78. void CCOMPAGE1::OnChangeCachedata1()
  79. {
  80. // TODO: Add your control notification handler code here
  81. if (m_bSetChanged) {
  82. m_binNumericRegistryEntries[ComPage_MemCache].bIsChanged = TRUE;
  83. m_binNumericRegistryEntries[ComPage_MemCache].ulFieldValue = m_spinCacheSpin1.GetPos()
  84. * m_binNumericRegistryEntries[ComPage_MemCache].ulMultipleFactor;
  85. m_bIsDirty = TRUE;
  86. SetModified(TRUE);
  87. }
  88. }
  89. void CCOMPAGE1::OnChangeLogbatdata1()
  90. {
  91. // TODO: Add your control notification handler code here
  92. if (m_bSetChanged) {
  93. m_binNumericRegistryEntries[ComPage_LogBat].bIsChanged = TRUE;
  94. m_binNumericRegistryEntries[ComPage_LogBat].ulFieldValue = m_spinLogBatSpin1.GetPos() *
  95. m_binNumericRegistryEntries[ComPage_LogBat].ulMultipleFactor;
  96. m_bIsDirty = TRUE;
  97. SetModified(TRUE);
  98. }
  99. }
  100. void CCOMPAGE1::OnChangeListenbacklogdata1()
  101. {
  102. // TODO: Add your control notification handler code here
  103. if (m_bSetChanged) {
  104. m_binNumericRegistryEntries[ComPage_ListenBacklog].bIsChanged = TRUE;
  105. m_binNumericRegistryEntries[ComPage_ListenBacklog].ulFieldValue = m_spinListenBacklog.GetPos()
  106. * m_binNumericRegistryEntries[ComPage_ListenBacklog].ulMultipleFactor;
  107. m_bIsDirty = TRUE;
  108. SetModified(TRUE);
  109. }
  110. }
  111. void CCOMPAGE1::SaveInfo()
  112. {
  113. if (m_bIsDirty) {
  114. SaveNumericInfo(m_binNumericRegistryEntries, ComPage_TotalNumRegEntries);
  115. }
  116. CGenPage::SaveInfo();
  117. }