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.

131 lines
2.8 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. MmOffer.cpp
  7. dialog to IPSec Main Mode Offers
  8. FILE HISTORY:
  9. */
  10. #include "stdafx.h"
  11. #include "spddb.h"
  12. #include "spdutil.h"
  13. #include "mmauthpp.h"
  14. #ifdef _DEBUG
  15. #define new DEBUG_NEW
  16. #undef THIS_FILE
  17. static char THIS_FILE[] = __FILE__;
  18. #endif
  19. /////////////////////////////////////////////////////////////////////////////
  20. // CAuthGenPage message handlers
  21. IMPLEMENT_DYNCREATE(CAuthGenPage, CPropertyPageBase)
  22. CAuthGenPage::CAuthGenPage()
  23. : CPropertyPageBase(CAuthGenPage::IDD)
  24. {
  25. //{{AFX_DATA_INIT(CAuthGenPage)
  26. // NOTE: the ClassWizard will add member initialization here
  27. //}}AFX_DATA_INIT
  28. }
  29. CAuthGenPage::~CAuthGenPage()
  30. {
  31. }
  32. void CAuthGenPage::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CPropertyPage::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CAuthGenPage)
  36. DDX_Control(pDX, IDC_LIST_MM_POL_AUTH, m_listAuth);
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CAuthGenPage, CPropertyPageBase)
  40. //{{AFX_MSG_MAP(CAuthGenPage)
  41. //}}AFX_MSG_MAP
  42. END_MESSAGE_MAP()
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CAuthGenPage message handlers
  45. BOOL CAuthGenPage::OnInitDialog()
  46. {
  47. CPropertyPage::OnInitDialog();
  48. PopulateAuthInfo();
  49. return TRUE;
  50. }
  51. void CAuthGenPage::PopulateAuthInfo()
  52. {
  53. CString st;
  54. int nWidth;
  55. int nRows;
  56. Assert(m_pAuthMethods);
  57. ListView_SetExtendedListViewStyle(m_listAuth.GetSafeHwnd(),
  58. LVS_EX_FULLROWSELECT);
  59. st.LoadString(IDS_MM_AUTH_METHOD);
  60. nWidth = m_listAuth.GetStringWidth(st) + 50;
  61. m_listAuth.InsertColumn(0, st, LVCFMT_LEFT, nWidth);
  62. RECT rect;
  63. m_listAuth.GetClientRect(&rect);
  64. st.LoadString(IDS_MM_AUTH_DETAIL);
  65. nWidth = rect.right - nWidth;
  66. m_listAuth.InsertColumn(1, st, LVCFMT_LEFT, nWidth);
  67. nRows = 0;
  68. for (int i = 0; i < (int)m_pAuthMethods->m_arrAuthInfo.GetSize(); i++)
  69. {
  70. nRows = m_listAuth.InsertItem(nRows, _T(""));
  71. if (-1 != nRows)
  72. {
  73. MmAuthToString(m_pAuthMethods->m_arrAuthInfo[i]->m_AuthMethod, &st);
  74. m_listAuth.SetItemText(nRows, 0, st);
  75. st.Empty();
  76. switch(m_pAuthMethods->m_arrAuthInfo[i]->m_AuthMethod)
  77. {
  78. case IKE_PRESHARED_KEY:
  79. st = (LPCTSTR) m_pAuthMethods->m_arrAuthInfo[i]->m_pAuthInfo;
  80. break;
  81. case IKE_DSS_SIGNATURE:
  82. //not valid yet
  83. break;
  84. case IKE_RSA_SIGNATURE:
  85. st = (LPCTSTR) m_pAuthMethods->m_arrAuthInfo[i]->m_pAuthInfo;
  86. break;
  87. case IKE_RSA_ENCRYPTION:
  88. //not valid yet
  89. break;
  90. case IKE_SSPI:
  91. break;
  92. }
  93. m_listAuth.SetItemText(nRows, 1, st);
  94. }
  95. nRows++;
  96. }
  97. }
  98. BOOL CAuthGenPage::OnPropertyChange(BOOL bScope, LONG_PTR *ChangeMask)
  99. {
  100. return FALSE;
  101. }