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.

190 lines
5.0 KiB

  1. // CopyMoveCertRemotePage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "certwiz.h"
  5. #include "CopyMoveCertRemotePage.h"
  6. #include "Certificat.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CCopyMoveCertFromRemotePage property page
  14. IMPLEMENT_DYNCREATE(CCopyMoveCertFromRemotePage, CIISWizardPage)
  15. CCopyMoveCertFromRemotePage::CCopyMoveCertFromRemotePage(CCertificate * pCert)
  16. : CIISWizardPage(CCopyMoveCertFromRemotePage::IDD, IDS_CERTWIZ, TRUE),
  17. m_pCert(pCert)
  18. {
  19. //{{AFX_DATA_INIT(CCopyMoveCertFromRemotePage)
  20. m_Index = -1;
  21. m_MarkAsExportable = FALSE;
  22. //}}AFX_DATA_INIT
  23. }
  24. CCopyMoveCertFromRemotePage::~CCopyMoveCertFromRemotePage()
  25. {
  26. }
  27. void CCopyMoveCertFromRemotePage::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CIISWizardPage::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(CCopyMoveCertFromRemotePage)
  31. DDX_Check(pDX, IDC_MARK_AS_EXPORTABLE, m_MarkAsExportable);
  32. DDX_Radio(pDX, IDC_COPY_FROM_REMOTE, m_Index);
  33. //}}AFX_DATA_MAP
  34. }
  35. void CCopyMoveCertFromRemotePage::OnExportable()
  36. {
  37. UpdateData();
  38. }
  39. BEGIN_MESSAGE_MAP(CCopyMoveCertFromRemotePage, CIISWizardPage)
  40. //{{AFX_MSG_MAP(CCopyMoveCertFromRemotePage)
  41. ON_BN_CLICKED(IDC_MARK_AS_EXPORTABLE, OnExportable)
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CCopyMoveCertFromRemotePage message handlers
  46. LRESULT CCopyMoveCertFromRemotePage::OnWizardBack()
  47. {
  48. return IDD_PAGE_PREV;
  49. }
  50. LRESULT CCopyMoveCertFromRemotePage::OnWizardNext()
  51. {
  52. LRESULT res = 1;
  53. UpdateData();
  54. switch (m_Index)
  55. {
  56. case CONTINUE_COPY_FROM_REMOTE:
  57. m_pCert->m_DeleteAfterCopy = FALSE;
  58. m_pCert->m_MarkAsExportable = m_MarkAsExportable;
  59. res = IDD_PAGE_NEXT_COPY_FROM_REMOTE;
  60. break;
  61. case CONTINUE_MOVE_FROM_REMOTE:
  62. m_pCert->m_DeleteAfterCopy = TRUE;
  63. m_pCert->m_MarkAsExportable = m_MarkAsExportable;
  64. res = IDD_PAGE_NEXT_MOVE_FROM_REMOTE;
  65. break;
  66. }
  67. return res;
  68. }
  69. BOOL CCopyMoveCertFromRemotePage::OnSetActive()
  70. {
  71. m_pCert->SetStatusCode(CCertificate::REQUEST_UNDEFINED);
  72. SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  73. return CIISWizardPage::OnSetActive();
  74. }
  75. BOOL CCopyMoveCertFromRemotePage::OnInitDialog()
  76. {
  77. m_Index = 0;
  78. CIISWizardPage::OnInitDialog();
  79. return TRUE;
  80. }
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CCopyMoveCertToRemotePage property page
  83. IMPLEMENT_DYNCREATE(CCopyMoveCertToRemotePage, CIISWizardPage)
  84. CCopyMoveCertToRemotePage::CCopyMoveCertToRemotePage(CCertificate * pCert)
  85. : CIISWizardPage(CCopyMoveCertToRemotePage::IDD, IDS_CERTWIZ, TRUE),
  86. m_pCert(pCert)
  87. {
  88. //{{AFX_DATA_INIT(CCopyMoveCertToRemotePage)
  89. m_Index = -1;
  90. m_MarkAsExportable = FALSE;
  91. //}}AFX_DATA_INIT
  92. }
  93. CCopyMoveCertToRemotePage::~CCopyMoveCertToRemotePage()
  94. {
  95. }
  96. void CCopyMoveCertToRemotePage::DoDataExchange(CDataExchange* pDX)
  97. {
  98. CIISWizardPage::DoDataExchange(pDX);
  99. //{{AFX_DATA_MAP(CCopyMoveCertToRemotePage)
  100. DDX_Check(pDX, IDC_MARK_AS_EXPORTABLE, m_MarkAsExportable);
  101. DDX_Radio(pDX, IDC_COPY_TO_REMOTE, m_Index);
  102. //}}AFX_DATA_MAP
  103. }
  104. BEGIN_MESSAGE_MAP(CCopyMoveCertToRemotePage, CIISWizardPage)
  105. //{{AFX_MSG_MAP(CCopyMoveCertToRemotePage)
  106. ON_BN_CLICKED(IDC_MARK_AS_EXPORTABLE, OnExportable)
  107. //}}AFX_MSG_MAP
  108. END_MESSAGE_MAP()
  109. /////////////////////////////////////////////////////////////////////////////
  110. // CCopyMoveCertToRemotePage message handlers
  111. LRESULT CCopyMoveCertToRemotePage::OnWizardBack()
  112. {
  113. return IDD_PAGE_PREV;
  114. }
  115. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  116. LRESULT CCopyMoveCertToRemotePage::OnWizardNext()
  117. {
  118. LRESULT res = 1;
  119. UpdateData();
  120. switch (m_Index)
  121. {
  122. case CONTINUE_COPY_TO_REMOTE:
  123. //m_pCert->SetStatusCode(CCertificate::REQUEST_COPYREMOTE_CERT);
  124. m_pCert->m_DeleteAfterCopy = FALSE;
  125. m_pCert->m_MarkAsExportable = m_MarkAsExportable;
  126. res = IDD_PAGE_NEXT_COPY_TO_REMOTE;
  127. break;
  128. case CONTINUE_MOVE_TO_REMOTE:
  129. m_pCert->m_DeleteAfterCopy = TRUE;
  130. m_pCert->m_MarkAsExportable = m_MarkAsExportable;
  131. res = IDD_PAGE_NEXT_MOVE_TO_REMOTE;
  132. break;
  133. }
  134. return res;
  135. }
  136. BOOL CCopyMoveCertToRemotePage::OnSetActive()
  137. {
  138. m_pCert->SetStatusCode(CCertificate::REQUEST_UNDEFINED);
  139. SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT);
  140. return CIISWizardPage::OnSetActive();
  141. }
  142. BOOL CCopyMoveCertToRemotePage::OnInitDialog()
  143. {
  144. m_Index = 0;
  145. CIISWizardPage::OnInitDialog();
  146. // we should make some checks and disable some buttons
  147. if (!m_pCert->m_CertObjInstalled)
  148. {
  149. ASSERT(NULL != GetDlgItem(IDC_COPY_TO_REMOTE));
  150. ASSERT(NULL != GetDlgItem(IDC_MOVE_TO_REMOTE));
  151. GetDlgItem(IDC_COPY_TO_REMOTE)->EnableWindow(FALSE);
  152. GetDlgItem(IDC_MOVE_TO_REMOTE)->EnableWindow(FALSE);
  153. }
  154. return TRUE;
  155. }
  156. void CCopyMoveCertToRemotePage::OnExportable()
  157. {
  158. UpdateData();
  159. }