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.

134 lines
3.9 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2002.
  5. //
  6. // File: SnapMgr.h
  7. //
  8. // Contents: header file for Snapin Manager property page
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __SNAPMGR_H__
  12. #define __SNAPMGR_H__
  13. #endif // ~__SNAPMGR_H__
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CCertMgrChooseMachinePropPage dialog
  16. class CCertMgrChooseMachinePropPage : public CChooseMachinePropPage
  17. {
  18. // Construction
  19. public:
  20. CCertMgrChooseMachinePropPage();
  21. virtual ~CCertMgrChooseMachinePropPage();
  22. void AssignLocationPtr (DWORD* pdwLocation);
  23. // Dialog Data
  24. //{{AFX_DATA(CCertMgrChooseMachinePropPage)
  25. // NOTE - ClassWizard will add data members here.
  26. // DO NOT EDIT what you see in these blocks of generated code !
  27. //}}AFX_DATA
  28. // Overrides
  29. // ClassWizard generate virtual function overrides
  30. //{{AFX_VIRTUAL(CCertMgrChooseMachinePropPage)
  31. public:
  32. virtual BOOL OnSetActive();
  33. protected:
  34. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  35. //}}AFX_VIRTUAL
  36. // Implementation
  37. protected:
  38. // Generated message map functions
  39. //{{AFX_MSG(CCertMgrChooseMachinePropPage)
  40. //}}AFX_MSG
  41. DECLARE_MESSAGE_MAP()
  42. virtual LRESULT OnWizardNext();
  43. virtual BOOL OnKillActive();
  44. private:
  45. DWORD* m_pdwLocation;
  46. };
  47. /////////////////////////////////////////////////////////////////////////////
  48. // CCertMgrChooseMachinePropPage property page
  49. CCertMgrChooseMachinePropPage::CCertMgrChooseMachinePropPage() :
  50. CChooseMachinePropPage(),
  51. m_pdwLocation (0)
  52. {
  53. //{{AFX_DATA_INIT(CCertMgrChooseMachinePropPage)
  54. // NOTE: the ClassWizard will add member initialization here
  55. //}}AFX_DATA_INIT
  56. }
  57. CCertMgrChooseMachinePropPage::~CCertMgrChooseMachinePropPage()
  58. {
  59. }
  60. void CCertMgrChooseMachinePropPage::AssignLocationPtr(DWORD * pdwLocation)
  61. {
  62. m_pdwLocation = pdwLocation;
  63. }
  64. void CCertMgrChooseMachinePropPage::DoDataExchange(CDataExchange* pDX)
  65. {
  66. CChooseMachinePropPage::DoDataExchange(pDX);
  67. //{{AFX_DATA_MAP(CCertMgrChooseMachinePropPage)
  68. // NOTE: the ClassWizard will add DDX and DDV calls here
  69. //}}AFX_DATA_MAP
  70. }
  71. BEGIN_MESSAGE_MAP(CCertMgrChooseMachinePropPage, CChooseMachinePropPage)
  72. //{{AFX_MSG_MAP(CCertMgrChooseMachinePropPage)
  73. //}}AFX_MSG_MAP
  74. END_MESSAGE_MAP()
  75. /////////////////////////////////////////////////////////////////////////////
  76. // CCertMgrChooseMachinePropPage message handlers
  77. BOOL CCertMgrChooseMachinePropPage::OnSetActive()
  78. {
  79. if ( m_pdwLocation && CERT_SYSTEM_STORE_SERVICES == *m_pdwLocation )
  80. GetParent ()->PostMessage (PSM_SETWIZBUTTONS, 0, PSWIZB_BACK | PSWIZB_NEXT);
  81. else
  82. GetParent ()->PostMessage (PSM_SETWIZBUTTONS, 0, PSWIZB_BACK | PSWIZB_FINISH);
  83. // Do not call CChooseMachinePropPage here because it will disable the back button.
  84. // Call the grandparent instead.
  85. return CPropertyPage::OnSetActive();
  86. }
  87. BOOL CCertMgrChooseMachinePropPage::OnKillActive()
  88. {
  89. ASSERT_VALID(this);
  90. // override CPropertyPage::OnKillActive () so that UpdateData is not called
  91. return TRUE;
  92. }
  93. LRESULT CCertMgrChooseMachinePropPage::OnWizardNext()
  94. {
  95. if ( !UpdateData (TRUE) )
  96. return -1;
  97. if ( m_pstrMachineNameOut )
  98. {
  99. // Store the machine name into its output buffer
  100. // NTRAID# 487794 Certificates/Service account: cannot add snapin
  101. // targeted to local computer if illegal chars present in "Another
  102. // computer" textbox
  103. if ( m_fIsRadioLocalMachine )
  104. *m_pstrMachineNameOut = L"";
  105. else
  106. *m_pstrMachineNameOut = m_strMachineName;
  107. if (m_pfAllowOverrideMachineNameOut != NULL)
  108. *m_pfAllowOverrideMachineNameOut = m_fAllowOverrideMachineName;
  109. }
  110. return CChooseMachinePropPage::OnWizardNext ();
  111. }