Source code of Windows XP (NT5)
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.

211 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1994-1998 Microsoft Corporation
  3. Module Name :
  4. ssldlg.cpp
  5. Abstract:
  6. SSL Dialog
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Project:
  10. Internet Services Manager
  11. Revision History:
  12. --*/
  13. //
  14. // Include Files
  15. //
  16. #include "stdafx.h"
  17. #include "w3scfg.h"
  18. #include "SSLDlg.h"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. CSSLDlg::CSSLDlg(
  25. IN DWORD & dwAccessPermissions,
  26. IN BOOL fSSL128Supported,
  27. IN CWnd * pParent OPTIONAL
  28. )
  29. /*++
  30. Routine Description:
  31. SSL Dialog constructor
  32. Arguments:
  33. LPCTSTR lpstrServerName : Server name, For API name only
  34. DWORD & dwAccessPermissions : Access permissions
  35. BOOL fSSLSupported : SSL Supported
  36. CWnd * pParent : Optional parent window
  37. Return Value:
  38. N/A
  39. --*/
  40. : CDialog(CSSLDlg::IDD, pParent),
  41. m_fSSL128Supported(fSSL128Supported),
  42. m_dwAccessPermissions(dwAccessPermissions)
  43. {
  44. #if 0 // Keep Class wizard happy
  45. //{{AFX_DATA_INIT(CSSLDlg)
  46. m_fRequire128BitSSL = FALSE;
  47. //}}AFX_DATA_INIT
  48. #endif // 0
  49. m_fRequire128BitSSL = IS_FLAG_SET(m_dwAccessPermissions, MD_ACCESS_SSL128);
  50. }
  51. void
  52. CSSLDlg::DoDataExchange(
  53. IN CDataExchange * pDX
  54. )
  55. /*++
  56. Routine Description:
  57. Initialise/Store Control Data
  58. Arguments:
  59. CDataExchange * pDX : Data exchange object
  60. Return Value:
  61. None
  62. --*/
  63. {
  64. CDialog::DoDataExchange(pDX);
  65. //{{AFX_DATA_MAP(CSSLDlg)
  66. DDX_Check(pDX, IDC_CHECK_REQUIRE_128BIT, m_fRequire128BitSSL);
  67. //}}AFX_DATA_MAP
  68. }
  69. //
  70. // Message Map
  71. //
  72. BEGIN_MESSAGE_MAP(CSSLDlg, CDialog)
  73. //{{AFX_MSG_MAP(CSSLDlg)
  74. //}}AFX_MSG_MAP
  75. END_MESSAGE_MAP()
  76. /*
  77. void
  78. CSSLDlg::SetSSLText()
  79. /*++
  80. Routine Description:
  81. Set control texts depending on availability of
  82. SSL
  83. Arguments:
  84. None
  85. Return Value:
  86. None
  87. --/
  88. {
  89. CString str;
  90. if (!m_fSSLEnabledOnServer)
  91. {
  92. VERIFY(str.LoadString(IDS_CHECK_REQUIRE_SSL_NOT_ENABLED));
  93. }
  94. else
  95. {
  96. VERIFY(str.LoadString(m_fSSLInstalledOnServer
  97. ? IDS_CHECK_REQUIRE_SSL_INSTALLED
  98. : IDS_CHECK_REQUIRE_SSL_NOT_INSTALLED));
  99. }
  100. m_check_RequireSSL.SetWindowText(str);
  101. }
  102. */
  103. //
  104. // Message Handlers
  105. //
  106. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  107. void
  108. CSSLDlg::OnOK()
  109. /*++
  110. Routine Description:
  111. 'ok' button handler
  112. Arguments:
  113. None
  114. Return Value:
  115. None
  116. --*/
  117. {
  118. if (UpdateData(TRUE))
  119. {
  120. SET_FLAG_IF(m_fRequire128BitSSL, m_dwAccessPermissions, MD_ACCESS_SSL128);
  121. CDialog::OnOK();
  122. }
  123. //
  124. // Don't dismiss the dialog
  125. //
  126. }
  127. BOOL
  128. CSSLDlg::OnInitDialog()
  129. /*++
  130. Routine Description:
  131. WM_INITDIALOG handler. Initialize the dialog.
  132. Arguments:
  133. None.
  134. Return Value:
  135. TRUE if no focus is to be set automatically, FALSE if the focus
  136. is already set.
  137. --*/
  138. {
  139. CDialog::OnInitDialog();
  140. GetDlgItem(IDC_CHECK_REQUIRE_128BIT)->EnableWindow(m_fSSL128Supported);
  141. return TRUE;
  142. }