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.

131 lines
2.8 KiB

  1. // WelcomePage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "CertWiz.h"
  5. #include "WelcomePage.h"
  6. #include "Certificat.h"
  7. #include "certutil.h"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CWelcomePage property page
  15. IMPLEMENT_DYNCREATE(CWelcomePage, CIISWizardBookEnd2)
  16. CWelcomePage::CWelcomePage(CCertificate * pCert)
  17. : CIISWizardBookEnd2(CWelcomePage::IDD, IDS_WELCOME_PAGE_CAPTION, &pCert->m_idErrorText),
  18. m_pCert(pCert),
  19. m_ContinuationFlag(CONTINUE_UNDEFINED)
  20. {
  21. //{{AFX_DATA_INIT(CWelcomePage)
  22. //}}AFX_DATA_INIT
  23. }
  24. CWelcomePage::~CWelcomePage()
  25. {
  26. }
  27. void CWelcomePage::DoDataExchange(CDataExchange* pDX)
  28. {
  29. CIISWizardBookEnd2::DoDataExchange(pDX);
  30. //{{AFX_DATA_MAP(CWelcomePage)
  31. //}}AFX_DATA_MAP
  32. }
  33. BEGIN_MESSAGE_MAP(CWelcomePage, CIISWizardBookEnd2)
  34. //{{AFX_MSG_MAP(CWelcomePage)
  35. //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CWelcomePage message handlers
  39. LRESULT
  40. CWelcomePage::OnWizardNext()
  41. /*++
  42. Routine Description:
  43. Next button handler
  44. Arguments:
  45. None
  46. Return Value:
  47. 0 to automatically advance to the next page;
  48. 1 to prevent the page from changing.
  49. To jump to a page other than the next one,
  50. return the identifier of the dialog to be displayed.
  51. --*/
  52. {
  53. ASSERT(m_pCert != NULL);
  54. int id;
  55. switch (m_ContinuationFlag)
  56. {
  57. case CONTINUE_NEW_CERT:
  58. id = IDD_PAGE_NEXT_NEW;
  59. break;
  60. case CONTINUE_PENDING_CERT:
  61. id = IDD_PAGE_NEXT_PENDING;
  62. break;
  63. case CONTINUE_INSTALLED_CERT:
  64. id = IDD_PAGE_NEXT_INSTALLED;
  65. break;
  66. default:
  67. id = 1;
  68. }
  69. return id;
  70. }
  71. BOOL
  72. CWelcomePage::OnSetActive()
  73. /*++
  74. Routine Description:
  75. Activation handler
  76. Arguments:
  77. None
  78. Return Value:
  79. TRUE for success, FALSE for failure
  80. --*/
  81. {
  82. SetWizardButtons(PSWIZB_NEXT);
  83. return CIISWizardBookEnd2::OnSetActive();
  84. }
  85. BOOL CWelcomePage::OnInitDialog()
  86. {
  87. ASSERT(!m_pCert->m_MachineName.IsEmpty());
  88. ASSERT(!m_pCert->m_WebSiteInstanceName.IsEmpty());
  89. // check status of web server
  90. // set status flag
  91. #ifdef ENABLE_W3SVC_SSL_PAGE
  92. HRESULT hr = 0;
  93. GetSSLPortFromSite(m_pCert->m_MachineName,m_pCert->m_WebSiteInstanceName,m_pCert->m_SSLPort,&hr);
  94. #endif
  95. UINT id;
  96. if (m_pCert->HasPendingRequest())
  97. {
  98. m_ContinuationFlag = CONTINUE_PENDING_CERT;
  99. id = IDS_PENDING_REQUEST;
  100. }
  101. else if (m_pCert->HasInstalledCert())
  102. {
  103. m_ContinuationFlag = CONTINUE_INSTALLED_CERT;
  104. id = IDS_INSTALLED_CERT;
  105. }
  106. else
  107. {
  108. m_ContinuationFlag = CONTINUE_NEW_CERT;
  109. id = IDS_NEW_CERT;
  110. }
  111. m_pCert->SetBodyTextID(id);
  112. return CIISWizardBookEnd2::OnInitDialog();
  113. }