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.

117 lines
2.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997-2001.
  5. //
  6. // File: AddSheet.cpp
  7. //
  8. // Contents:
  9. //
  10. //----------------------------------------------------------------------------
  11. #include "stdafx.h"
  12. #include "AddSheet.h"
  13. #ifdef _DEBUG
  14. #ifndef ALPHA
  15. #define new DEBUG_NEW
  16. #endif
  17. #undef THIS_FILE
  18. static char THIS_FILE[] = __FILE__;
  19. #endif
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CAddEFSWizSheet
  22. CAddEFSWizSheet::CAddEFSWizSheet (UINT nIDCaption, CUsers& externalUsers, bool bMachineIsStandAlone)
  23. :CWizard97PropertySheet (nIDCaption, IDB_RECOVERY_WATERMARK, IDB_RECOVERY_BANNER),
  24. m_externalUsers (externalUsers),
  25. m_bMachineIsStandAlone (bMachineIsStandAlone)
  26. {
  27. AddControlPages ();
  28. m_cfDsObjectNames = (CLIPFORMAT)RegisterClipboardFormat (CFSTR_DSOBJECTNAMES);
  29. }
  30. CAddEFSWizSheet::~CAddEFSWizSheet ()
  31. {
  32. }
  33. //
  34. // This routine adds the tab to the sheet
  35. //
  36. void CAddEFSWizSheet::AddControlPages ()
  37. {
  38. AddPage (&m_WelcomePage);
  39. AddPage (&m_LocatePage);
  40. AddPage (&m_CompletePage);
  41. }
  42. CLIPFORMAT CAddEFSWizSheet::GetDataFormat ()
  43. {
  44. return m_cfDsObjectNames;
  45. }
  46. DWORD CAddEFSWizSheet::Add (
  47. LPWSTR UserName,
  48. LPWSTR DnName,
  49. PVOID UserCert,
  50. PSID UserSid /*= NULL */,
  51. DWORD Flag /*= USERINFILE*/,
  52. PCCERT_CONTEXT pCertContext /*= NULL*/
  53. )
  54. {
  55. return m_Users.Add (
  56. UserName,
  57. DnName,
  58. UserCert,
  59. UserSid,
  60. Flag,
  61. pCertContext
  62. );
  63. }
  64. DWORD CAddEFSWizSheet::Remove (
  65. LPCWSTR UserName,
  66. LPCWSTR UserCertName
  67. )
  68. {
  69. return m_Users.Remove (
  70. UserName,
  71. UserCertName
  72. );
  73. }
  74. PUSERSONFILE CAddEFSWizSheet::StartEnum ()
  75. {
  76. return m_Users.StartEnum ();
  77. }
  78. PUSERSONFILE CAddEFSWizSheet::GetNextUser (
  79. PUSERSONFILE Token,
  80. CString &UserName,
  81. CString &CertName
  82. )
  83. {
  84. return m_Users.GetNextUser (
  85. Token,
  86. UserName,
  87. CertName
  88. );
  89. }
  90. void CAddEFSWizSheet::ClearUserList (void)
  91. {
  92. m_Users.Clear ();
  93. }
  94. DWORD CAddEFSWizSheet::AddNewUsers (void)
  95. {
  96. m_externalUsers.Add (m_Users);
  97. return 0;
  98. }