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.

142 lines
3.3 KiB

  1. // WildWizOne.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include <iadmw.h>
  5. #include "certmap.h"
  6. #include "ListRow.h"
  7. #include "ChkLstCt.h"
  8. extern "C"
  9. {
  10. #include <wincrypt.h>
  11. #include <sslsp.h>
  12. }
  13. #include "Iismap.hxx"
  14. #include "Iiscmr.hxx"
  15. #include "brwsdlg.h"
  16. #include "EdWldRul.h"
  17. #include "EdtRulEl.h"
  18. #include "WWzOne.h"
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CWildWizOne property page
  26. IMPLEMENT_DYNCREATE(CWildWizOne, CPropertyPage)
  27. CWildWizOne::CWildWizOne() : CPropertyPage(CWildWizOne::IDD)
  28. {
  29. //{{AFX_DATA_INIT(CWildWizOne)
  30. m_sz_description = _T("");
  31. m_bool_enable = FALSE;
  32. //}}AFX_DATA_INIT
  33. }
  34. CWildWizOne::~CWildWizOne()
  35. {
  36. }
  37. void CWildWizOne::DoDataExchange(CDataExchange* pDX)
  38. {
  39. CPropertyPage::DoDataExchange(pDX);
  40. //{{AFX_DATA_MAP(CWildWizOne)
  41. DDX_Text(pDX, IDC_DESCRIPTION, m_sz_description);
  42. DDV_MaxChars(pDX, m_sz_description, 120);
  43. DDX_Check(pDX, IDC_ENABLE_RULE, m_bool_enable);
  44. //}}AFX_DATA_MAP
  45. }
  46. BEGIN_MESSAGE_MAP(CWildWizOne, CPropertyPage)
  47. //{{AFX_MSG_MAP(CWildWizOne)
  48. ON_EN_CHANGE(IDC_DESCRIPTION, OnChangeDescription)
  49. ON_BN_CLICKED(IDC_ENABLE_RULE, OnEnableRule)
  50. //}}AFX_MSG_MAP
  51. ON_COMMAND(ID_HELP_FINDER, DoHelp)
  52. ON_COMMAND(ID_HELP, DoHelp)
  53. ON_COMMAND(ID_CONTEXT_HELP, DoHelp)
  54. ON_COMMAND(ID_DEFAULT_HELP, DoHelp)
  55. END_MESSAGE_MAP()
  56. //---------------------------------------------------------------------------
  57. void CWildWizOne::DoHelp()
  58. {
  59. WinHelp( HIDD_CERTMAP_ADV_RUL_GENERAL );
  60. }
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CWildWizOne message handlers
  63. //---------------------------------------------------------------------------
  64. BOOL CWildWizOne::OnInitDialog()
  65. {
  66. // call the parental oninitdialog
  67. BOOL f = CPropertyPage::OnInitDialog();
  68. // set the easy default strings
  69. m_sz_description = m_pRule->GetRuleName();
  70. m_bool_enable = m_pRule->GetRuleEnabled();
  71. // exchange the data
  72. UpdateData( FALSE );
  73. // return the answer
  74. return f;
  75. }
  76. //---------------------------------------------------------------------------
  77. BOOL CWildWizOne::OnApply()
  78. {
  79. CERT_FIELD_ID id;
  80. CString szSub, sz;
  81. LPBYTE pbBin;
  82. DWORD cbBin;
  83. UINT cItems;
  84. UINT iItem;
  85. USES_CONVERSION;
  86. // update the data
  87. UpdateData( TRUE );
  88. // set the easy data
  89. m_pRule->SetRuleName( T2A((LPTSTR)(LPCTSTR)m_sz_description) );
  90. m_pRule->SetRuleEnabled( m_bool_enable );
  91. // it is valid
  92. SetModified( FALSE );
  93. return TRUE;
  94. }
  95. //---------------------------------------------------------------------------
  96. BOOL CWildWizOne::OnSetActive()
  97. {
  98. // if this is a wizard, gray out the back button
  99. if ( m_fIsWizard )
  100. m_pPropSheet->SetWizardButtons( PSWIZB_NEXT );
  101. return CPropertyPage::OnSetActive();
  102. }
  103. //---------------------------------------------------------------------------
  104. void CWildWizOne::OnChangeDescription()
  105. {
  106. // we can now apply
  107. SetModified();
  108. }
  109. //---------------------------------------------------------------------------
  110. void CWildWizOne::OnEnableRule()
  111. {
  112. // we can now apply
  113. SetModified();
  114. }