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.

122 lines
2.8 KiB

  1. #pragma once
  2. #include <set>
  3. #include "DomainAccount.h"
  4. #include "DomainContainer.h"
  5. #include "VarSetBase.h"
  6. #include <MigrationMutex.h>
  7. #ifndef StringSet
  8. typedef std::set<_bstr_t> StringSet;
  9. #endif
  10. #define MAXIMUM_PREFIX_SUFFIX_LENGTH 8
  11. //---------------------------------------------------------------------------
  12. // MigrationBase Class
  13. //---------------------------------------------------------------------------
  14. class CMigrationBase
  15. {
  16. public:
  17. void SetInternalInterface(IMigrationInternal* pInternal)
  18. {
  19. m_spInternal = pInternal;
  20. }
  21. protected:
  22. CMigrationBase();
  23. ~CMigrationBase();
  24. void InitSourceDomainAndContainer(bool bMustExist = true);
  25. void InitTargetDomainAndContainer();
  26. void VerifyInterIntraForest();
  27. void VerifyCallerDelegated();
  28. CContainer& GetSourceContainer()
  29. {
  30. if (m_SourceContainer)
  31. {
  32. return m_SourceContainer;
  33. }
  34. else
  35. {
  36. return m_SourceDomain;
  37. }
  38. }
  39. CContainer& GetTargetContainer()
  40. {
  41. if (m_TargetContainer)
  42. {
  43. return m_TargetContainer;
  44. }
  45. else
  46. {
  47. return m_TargetDomain;
  48. }
  49. }
  50. void DoOption(long lOptions, VARIANT& vntInclude, VARIANT& vntExclude);
  51. virtual void DoNone();
  52. virtual void DoNames();
  53. virtual void DoDomain();
  54. void FillInVarSetForUsers(CDomainAccounts& rUsers, CVarSet& rVarSet);
  55. void FillInVarSetForGroups(CDomainAccounts& rGroups, CVarSet& rVarSet);
  56. void FillInVarSetForComputers(CDomainAccounts& rComputers, bool bMigrateOnly, bool bMoveToTarget, bool bReboot, long lRebootDelay, CVarSet& rVarSet);
  57. void MutexWait()
  58. {
  59. m_Mutex.ObtainOwnership();
  60. }
  61. void MutexRelease()
  62. {
  63. m_Mutex.ReleaseOwnership();
  64. }
  65. void VerifyRenameConflictPrefixSuffixValid();
  66. void VerifyCanAddSidHistory();
  67. void VerifyTargetContainerPathLength();
  68. void VerifyPasswordOption();
  69. void SetDefaultExcludedSystemProperties();
  70. void PerformMigration(CVarSet& rVarSet);
  71. void SaveSettings(CVarSet& rVarSet)
  72. {
  73. IIManageDBPtr spDatabase(__uuidof(IManageDB));
  74. spDatabase->SaveSettings(IUnknownPtr(rVarSet.GetInterface()));
  75. }
  76. void FixObjectsInHierarchy(LPCTSTR pszType);
  77. protected:
  78. void InitRecurseMaintainOption(long lOptions);
  79. void GetExcludeNames(VARIANT& vntExclude, StringSet& setExcludeNames);
  80. protected:
  81. IMigrationInternalPtr m_spInternal;
  82. CDomain m_SourceDomain;
  83. CContainer m_SourceContainer;
  84. CDomain m_TargetDomain;
  85. CContainer m_TargetContainer;
  86. int m_nRecurseMaintain;
  87. StringSet m_setIncludeNames;
  88. StringSet m_setExcludeNames;
  89. CMigrationMutex m_Mutex;
  90. };