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.

138 lines
7.2 KiB

  1. /*---------------------------------------------------------------------------
  2. File: STArgs.hpp
  3. Comments: Arguments that define the settings for FST or EST translation.
  4. (c) Copyright 1995-1998, Mission Critical Software, Inc., All Rights Reserved
  5. Proprietary and confidential to Mission Critical Software, Inc.
  6. REVISION LOG ENTRY
  7. Revision By: Christy Boles
  8. Revised on 10/14/98 15:35:59
  9. ---------------------------------------------------------------------------
  10. */
  11. #ifndef __STARGS_HPP__
  12. #define __STARGS_HPP__
  13. #define REPLACE_SECURITY (1)
  14. #define ADD_SECURITY (2)
  15. #define REMOVE_SECURITY (3)
  16. #define SUMMARYSTATS (0x00000001)
  17. #define ACCOUNTSTATS (0x00000002)
  18. #define FILESTATS (0x00000004)
  19. #define PATHSTATS (0x00000008)
  20. #define MORESTATS (0x00000010)
  21. #define MASSIVEINFO (0x00000020)
  22. #define TRANSLATE_FILES (0x00000001)
  23. #define TRANSLATE_SHARES (0x00000002)
  24. #define TRANSLATE_MAILBOXES (0x00000004)
  25. #define TRANSLATE_CONTAINERS (0x00000008)
  26. #define TRANSLATE_LGROUPS (0x00000010)
  27. #define TRANSLATE_USERRIGHTS (0x00000020)
  28. #define TRANSLATE_USERPROFILES (0x00000040)
  29. #define TRANSLATE_PRINTERS (0x00000080)
  30. #define TRANSLATE_RECYCLER (0x00000100)
  31. #define TRANSLATE_REGISTRY (0x00000200)
  32. #include "sidcache.hpp"
  33. #include "EnumVols.hpp"
  34. #include "Common.hpp"
  35. #include "UString.hpp"
  36. class SecurityTranslatorArgs
  37. {
  38. WCHAR m_source[LEN_Computer];
  39. WCHAR m_target[LEN_Computer];
  40. WCHAR m_logfile[LEN_Path];
  41. DWORD m_verbnum;
  42. BOOL m_nochange;
  43. DWORD m_translationMode;
  44. DWORD m_whichObjects;
  45. TPathList m_pathlist;
  46. TSDRidCache m_cache;
  47. bool m_needtoverify;
  48. bool m_invalid;
  49. bool m_IsLocalSystem;
  50. bool m_bUseMapFile;
  51. BOOL m_bAllowToSwitchFromReplaceToAddModeInProfileTranslation;
  52. public:
  53. bool m_bUndo;
  54. SecurityTranslatorArgs() { Reset(); }
  55. WCHAR const * Source() const { return m_source; }
  56. WCHAR const * Target() const { return m_target; }
  57. WCHAR const * LogFile() const { return m_logfile; }
  58. TSDRidCache * Cache() { return &m_cache; }
  59. TPathList * PathList() { return &m_pathlist; }
  60. BOOL NoChange() const { return m_nochange;}
  61. BOOL Verified() const { return !m_needtoverify; }
  62. BOOL IsLocalSystem() const { return m_IsLocalSystem; }
  63. BOOL LogFileDetails() { return m_verbnum & FILESTATS; }
  64. BOOL LogVerbose() { return m_verbnum & MORESTATS; }
  65. BOOL LogMassive() { return m_verbnum & MASSIVEINFO; }
  66. BOOL LogSummary() { return m_verbnum & SUMMARYSTATS; }
  67. BOOL LogAccountDetails() { return m_verbnum & ACCOUNTSTATS; }
  68. BOOL LogPathDetails() { return m_verbnum & PATHSTATS; }
  69. DWORD LogSettings() { return m_verbnum; }
  70. DWORD TranslationMode() { return m_translationMode; }
  71. BOOL TranslateFiles() { return m_whichObjects & TRANSLATE_FILES; }
  72. BOOL TranslateShares() { return m_whichObjects & TRANSLATE_SHARES; }
  73. BOOL TranslateMailboxes() { return m_whichObjects & TRANSLATE_MAILBOXES; }
  74. BOOL TranslateContainers() { return m_whichObjects & TRANSLATE_CONTAINERS; }
  75. BOOL TranslateLocalGroups() { return m_whichObjects & TRANSLATE_LGROUPS; }
  76. BOOL TranslateUserRights() { return m_whichObjects & TRANSLATE_USERRIGHTS; }
  77. BOOL TranslateUserProfiles() { return m_whichObjects & TRANSLATE_USERPROFILES; }
  78. BOOL TranslatePrinters() { return m_whichObjects & TRANSLATE_PRINTERS; }
  79. BOOL TranslateRecycler() { return m_whichObjects & TRANSLATE_RECYCLER; }
  80. BOOL TranslateRegistry() { return m_whichObjects & TRANSLATE_REGISTRY; }
  81. BOOL UsingMapFile() const { return m_bUseMapFile; }
  82. BOOL AllowingToSwitchFromReplaceToAddModeInProfileTranslation() const { return m_bAllowToSwitchFromReplaceToAddModeInProfileTranslation; }
  83. void Source(WCHAR const * source) { safecopy(m_source,source); }
  84. void Target(WCHAR const * target) { safecopy(m_target,target); }
  85. void LogFile(WCHAR const * logfile) { safecopy(m_logfile,logfile); }
  86. void Verified(BOOL done) { m_needtoverify = !done; }
  87. void SetLogging(DWORD vn) { m_verbnum = vn; }
  88. void SetTranslationMode(DWORD mode) { m_translationMode = mode; }
  89. void SetWriteChanges(BOOL write) { m_nochange = !write; }
  90. void SetInvalid() { m_invalid = true; }
  91. void TranslateFiles(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_FILES : m_whichObjects &= ~TRANSLATE_FILES; }
  92. void TranslateShares(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_SHARES : m_whichObjects &= ~TRANSLATE_SHARES; }
  93. void TranslateMailboxes(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_MAILBOXES : m_whichObjects &= ~TRANSLATE_MAILBOXES; }
  94. void TranslateContainers(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_CONTAINERS : m_whichObjects &= ~TRANSLATE_CONTAINERS; }
  95. void TranslateLocalGroups(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_LGROUPS : m_whichObjects &= ~TRANSLATE_LGROUPS; }
  96. void TranslateUserRights(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_USERRIGHTS : m_whichObjects &= ~TRANSLATE_USERRIGHTS; }
  97. void TranslateUserProfiles(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_USERPROFILES : m_whichObjects &= ~TRANSLATE_USERPROFILES; }
  98. void TranslatePrinters(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_PRINTERS : m_whichObjects &= ~TRANSLATE_PRINTERS; }
  99. void TranslateRecycler(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_RECYCLER : m_whichObjects &= ~TRANSLATE_RECYCLER; }
  100. void TranslateRegistry(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_REGISTRY : m_whichObjects &= ~TRANSLATE_REGISTRY; }
  101. void SetLocalMode(BOOL bLocal) { m_IsLocalSystem = ( bLocal == TRUE); }
  102. void Reset() { m_invalid = FALSE; m_needtoverify = TRUE; m_source[0]=0; m_target[0]=0;
  103. m_IsLocalSystem = FALSE; m_logfile[0]=0; m_verbnum = SUMMARYSTATS | ACCOUNTSTATS | FILESTATS;
  104. m_nochange = FALSE; m_translationMode = REPLACE_SECURITY;
  105. m_whichObjects = TRANSLATE_FILES; m_pathlist.Clear(); m_cache.Clear();
  106. m_cache.TypeSetTree(); m_bUndo = false; m_bUseMapFile = false;
  107. m_bAllowToSwitchFromReplaceToAddModeInProfileTranslation = TRUE;
  108. }
  109. BOOL IsValid() { return (*m_source && *m_target && m_pathlist.Count() && !m_invalid) ; }
  110. void SetUsingMapFile(BOOL bUsing) { m_bUseMapFile = ( bUsing == TRUE); }
  111. void SetAllowingToSwitchFromReplaceToAddModeInProfileTranslation(BOOL bAllowing) { m_bAllowToSwitchFromReplaceToAddModeInProfileTranslation = bAllowing; }
  112. };
  113. #endif //__STARGS_HPP__