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.

156 lines
3.4 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1994 - 1996.
  5. //
  6. // File: password.hxx
  7. //
  8. // Contents: Task wizard password property page.
  9. //
  10. // Classes: CPasswordPage
  11. //
  12. // History: 4-28-1997 DavidMun Created
  13. //
  14. //---------------------------------------------------------------------------
  15. #ifndef __PASSWORD_HXX_
  16. #define __PASSWORD_HXX_
  17. //+--------------------------------------------------------------------------
  18. //
  19. // Class: CPasswordPage
  20. //
  21. // Purpose: Implement the task wizard password property page
  22. //
  23. // History: 4-28-1997 DavidMun Created
  24. //
  25. //---------------------------------------------------------------------------
  26. class CPasswordPage: public CWizPage
  27. {
  28. public:
  29. CPasswordPage::CPasswordPage(
  30. CTaskWizard *pParent,
  31. LPTSTR ptszFolderPath,
  32. HPROPSHEETPAGE *phPSP);
  33. CPasswordPage::~CPasswordPage();
  34. //
  35. // CPropPage overrides
  36. //
  37. virtual LRESULT
  38. _OnCommand(
  39. INT id,
  40. HWND hwndCtl,
  41. UINT codeNotify);
  42. //
  43. // CWizPage overrides
  44. //
  45. virtual LRESULT
  46. _OnInitDialog(
  47. LPARAM lParam);
  48. virtual LRESULT
  49. _OnPSNSetActive(
  50. LPARAM lParam);
  51. virtual LRESULT
  52. _OnWizBack();
  53. //
  54. // CPasswordPage methods
  55. //
  56. LPCTSTR
  57. GetAccountName();
  58. LPCTSTR
  59. GetPassword();
  60. VOID
  61. ZeroCredentials();
  62. private:
  63. VOID
  64. _UpdateWizButtons();
  65. CTaskWizard *_pParent;
  66. TCHAR _tszUserName[MAX_PATH + 1];
  67. TCHAR _tszPassword[MAX_PATH + 1];
  68. TCHAR _tszConfirmPassword[MAX_PATH + 1];
  69. };
  70. //+--------------------------------------------------------------------------
  71. //
  72. // Member: CPasswordPage::GetAccountName
  73. //
  74. // Synopsis: Access function for user name
  75. //
  76. // History: 5-20-1997 DavidMun Created
  77. //
  78. //---------------------------------------------------------------------------
  79. inline LPCTSTR
  80. CPasswordPage::GetAccountName()
  81. {
  82. return _tszUserName;
  83. }
  84. //+--------------------------------------------------------------------------
  85. //
  86. // Member: CPasswordPage::GetPassword
  87. //
  88. // Synopsis: Access function for password
  89. //
  90. // History: 5-20-1997 DavidMun Created
  91. //
  92. //---------------------------------------------------------------------------
  93. inline LPCTSTR
  94. CPasswordPage::GetPassword()
  95. {
  96. return _tszPassword;
  97. }
  98. //+--------------------------------------------------------------------------
  99. //
  100. // Member: CPasswordPage::ZeroCredentials
  101. //
  102. // Synopsis: Overwrites account name and password information stored by
  103. // this object with zeros.
  104. //
  105. // History: 5-20-1997 DavidMun Created
  106. //
  107. // Notes: Call this function as soon as credential information is no
  108. // longer needed to minimize the time plain-text credentials
  109. // are stored in memory.
  110. //
  111. //---------------------------------------------------------------------------
  112. inline VOID
  113. CPasswordPage::ZeroCredentials()
  114. {
  115. SecureZeroMemory(&_tszUserName, sizeof _tszUserName);
  116. SecureZeroMemory(&_tszPassword, sizeof _tszPassword);
  117. SecureZeroMemory(&_tszConfirmPassword, sizeof _tszConfirmPassword);
  118. }
  119. #endif // __PASSWORD_HXX_