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.

143 lines
3.5 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 <schannel.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. WinHelpDebug(HIDD_CERTMAP_ADV_RUL_GENERAL);
  60. WinHelp( HIDD_CERTMAP_ADV_RUL_GENERAL );
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CWildWizOne message handlers
  64. //---------------------------------------------------------------------------
  65. BOOL CWildWizOne::OnInitDialog()
  66. {
  67. // call the parental oninitdialog
  68. BOOL f = CPropertyPage::OnInitDialog();
  69. // set the easy default strings
  70. m_sz_description = m_pRule->GetRuleName();
  71. m_bool_enable = m_pRule->GetRuleEnabled();
  72. // exchange the data
  73. UpdateData( FALSE );
  74. // return the answer
  75. return f;
  76. }
  77. //---------------------------------------------------------------------------
  78. BOOL CWildWizOne::OnApply()
  79. {
  80. CERT_FIELD_ID id;
  81. CString szSub, sz;
  82. LPBYTE pbBin;
  83. DWORD cbBin;
  84. UINT cItems;
  85. UINT iItem;
  86. USES_CONVERSION;
  87. // update the data
  88. UpdateData( TRUE );
  89. // set the easy data
  90. m_pRule->SetRuleName( T2A((LPTSTR)(LPCTSTR)m_sz_description) );
  91. m_pRule->SetRuleEnabled( m_bool_enable );
  92. // it is valid
  93. SetModified( FALSE );
  94. return TRUE;
  95. }
  96. //---------------------------------------------------------------------------
  97. BOOL CWildWizOne::OnSetActive()
  98. {
  99. // if this is a wizard, gray out the back button
  100. if ( m_fIsWizard )
  101. m_pPropSheet->SetWizardButtons( PSWIZB_NEXT );
  102. return CPropertyPage::OnSetActive();
  103. }
  104. //---------------------------------------------------------------------------
  105. void CWildWizOne::OnChangeDescription()
  106. {
  107. // we can now apply
  108. SetModified();
  109. }
  110. //---------------------------------------------------------------------------
  111. void CWildWizOne::OnEnableRule()
  112. {
  113. // we can now apply
  114. SetModified();
  115. }