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.

178 lines
5.3 KiB

  1. // ssl1.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ISAdmin.h"
  5. #include "ssl1.h"
  6. #ifdef _DEBUG
  7. #undef THIS_FILE
  8. static char BASED_CODE THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // SSL1 property page
  12. IMPLEMENT_DYNCREATE(SSL1, CGenPage)
  13. SSL1::SSL1() : CGenPage(SSL1::IDD)
  14. {
  15. //{{AFX_DATA_INIT(SSL1)
  16. m_ulSecurePort = 0;
  17. //}}AFX_DATA_INIT
  18. }
  19. SSL1::~SSL1()
  20. {
  21. }
  22. void SSL1::DoDataExchange(CDataExchange* pDX)
  23. {
  24. CGenPage::DoDataExchange(pDX);
  25. //{{AFX_DATA_MAP(SSL1)
  26. DDX_Control(pDX, IDC_SSLENABLESSLDATA1, m_cboxEnableSSL);
  27. DDX_Control(pDX, IDC_SSLENABLEPCTDATA1, m_cboxEnablePCT);
  28. DDX_Control(pDX, IDC_SSLCREATEPROCESSASUSERDATA1, m_cboxCreateProcessAsUser);
  29. DDX_Text(pDX, IDC_SSLSECUREPORTDATA1, m_ulSecurePort);
  30. DDV_MinMaxDWord(pDX, m_ulSecurePort, 0, 4294967295);
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(SSL1, CGenPage)
  34. //{{AFX_MSG_MAP(SSL1)
  35. ON_EN_CHANGE(IDC_SSLSECUREPORTDATA1, OnChangeSslsecureportdata1)
  36. ON_BN_CLICKED(IDC_SSLCREATEPROCESSASUSERDATA1, OnSslcreateprocessasuserdata1)
  37. ON_BN_CLICKED(IDC_SSLENABLEPCTDATA1, OnSslenablepctdata1)
  38. ON_BN_CLICKED(IDC_SSLENABLESSLDATA1, OnSslenablessldata1)
  39. //}}AFX_MSG_MAP
  40. END_MESSAGE_MAP()
  41. /////////////////////////////////////////////////////////////////////////////
  42. // SSL1 message handlers
  43. BOOL SSL1::OnInitDialog()
  44. {
  45. int i;
  46. CGenPage::OnInitDialog();
  47. // TODO: Add extra initialization here
  48. for (i = 0; i < SSLPage_TotalNumRegEntries; i++) {
  49. m_binNumericRegistryEntries[i].bIsChanged = FALSE;
  50. m_binNumericRegistryEntries[i].ulMultipleFactor = 1;
  51. }
  52. m_binNumericRegistryEntries[SSLPage_SecurePort].strFieldName = _T(SECUREPORTNAME);
  53. m_binNumericRegistryEntries[SSLPage_SecurePort].ulDefaultValue = DEFAULTSECUREPORT;
  54. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].strFieldName = _T(ENCRYPTIONFLAGSNAME);
  55. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulDefaultValue = DEFAULTENCRYPTIONFLAGS;
  56. m_binNumericRegistryEntries[SSLPage_CreateProcessAsUser].strFieldName = _T(CREATEPROCESSASUSERNAME);
  57. m_binNumericRegistryEntries[SSLPage_CreateProcessAsUser].ulDefaultValue = DEFAULTCREATEPROCESSASUSER;
  58. for (i = 0; i < SSLPage_TotalNumRegEntries; i++) {
  59. if (m_rkMainKey->QueryValue(m_binNumericRegistryEntries[i].strFieldName,
  60. m_binNumericRegistryEntries[i].ulFieldValue) != ERROR_SUCCESS) {
  61. m_binNumericRegistryEntries[i].ulFieldValue = m_binNumericRegistryEntries[i].ulDefaultValue;
  62. }
  63. }
  64. m_ulSecurePort = m_binNumericRegistryEntries[SSLPage_SecurePort].ulFieldValue;
  65. m_cboxEnableSSL.SetCheck(GETCHECKBOXVALUEFROMREG(
  66. (m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue & ENC_CAPS_SSL)
  67. ? TRUEVALUE : FALSEVALUE));
  68. m_cboxEnablePCT.SetCheck(GETCHECKBOXVALUEFROMREG(
  69. (m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue & ENC_CAPS_PCT)
  70. ? TRUEVALUE : FALSEVALUE));
  71. m_cboxCreateProcessAsUser.SetCheck(GETCHECKBOXVALUEFROMREG(m_binNumericRegistryEntries[SSLPage_CreateProcessAsUser].ulFieldValue));
  72. UpdateData(FALSE); // Force Edit box(es) to pick up value(s)
  73. m_bSetChanged = TRUE; // Any more changes come from the user
  74. return TRUE; // return TRUE unless you set the focus to a control
  75. // EXCEPTION: OCX Property Pages should return FALSE
  76. }
  77. void SSL1::OnChangeSslsecureportdata1()
  78. {
  79. // TODO: Add your control notification handler code here
  80. if (m_bSetChanged) {
  81. m_binNumericRegistryEntries[SSLPage_SecurePort].bIsChanged = TRUE;
  82. m_bIsDirty = TRUE;
  83. SetModified(TRUE);
  84. }
  85. }
  86. void SSL1::OnSslcreateprocessasuserdata1()
  87. {
  88. // TODO: Add your control notification handler code here
  89. if (m_bSetChanged) {
  90. m_binNumericRegistryEntries[SSLPage_CreateProcessAsUser].bIsChanged = TRUE;
  91. m_binNumericRegistryEntries[SSLPage_CreateProcessAsUser].ulFieldValue =
  92. GETREGVALUEFROMCHECKBOX(m_cboxCreateProcessAsUser.GetCheck());
  93. m_bIsDirty = TRUE;
  94. SetModified(TRUE);
  95. }
  96. }
  97. void SSL1::OnSslenablepctdata1()
  98. {
  99. // TODO: Add your control notification handler code here
  100. if (m_bSetChanged) {
  101. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].bIsChanged = TRUE;
  102. if (GETREGVALUEFROMCHECKBOX(m_cboxEnablePCT.GetCheck()) == TRUEVALUE)
  103. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue |= ENC_CAPS_PCT;
  104. else
  105. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue &= ~ENC_CAPS_PCT;
  106. m_bIsDirty = TRUE;
  107. SetModified(TRUE);
  108. }
  109. }
  110. void SSL1::OnSslenablessldata1()
  111. {
  112. // TODO: Add your control notification handler code here
  113. if (m_bSetChanged) {
  114. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].bIsChanged = TRUE;
  115. if (GETREGVALUEFROMCHECKBOX(m_cboxEnableSSL.GetCheck()) == TRUEVALUE)
  116. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue |= ENC_CAPS_SSL;
  117. else
  118. m_binNumericRegistryEntries[SSLPage_EncryptionFlags].ulFieldValue &= ~ENC_CAPS_SSL;
  119. m_bIsDirty = TRUE;
  120. SetModified(TRUE);
  121. }
  122. }
  123. void SSL1::SaveInfo()
  124. {
  125. if (m_bIsDirty) {
  126. m_binNumericRegistryEntries[SSLPage_SecurePort].ulFieldValue = m_ulSecurePort;
  127. SaveNumericInfo(m_binNumericRegistryEntries, SSLPage_TotalNumRegEntries);
  128. }
  129. CGenPage::SaveInfo();
  130. }