Source code of Windows XP (NT5)
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.

133 lines
6.6 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. public:
  52. bool m_bUndo;
  53. SecurityTranslatorArgs() { Reset(); }
  54. WCHAR const * Source() const { return m_source; }
  55. WCHAR const * Target() const { return m_target; }
  56. WCHAR const * LogFile() const { return m_logfile; }
  57. TSDRidCache * Cache() { return &m_cache; }
  58. TPathList * PathList() { return &m_pathlist; }
  59. BOOL NoChange() const { return m_nochange;}
  60. BOOL Verified() const { return !m_needtoverify; }
  61. BOOL IsLocalSystem() const { return m_IsLocalSystem; }
  62. BOOL LogFileDetails() { return m_verbnum & FILESTATS; }
  63. BOOL LogVerbose() { return m_verbnum & MORESTATS; }
  64. BOOL LogMassive() { return m_verbnum & MASSIVEINFO; }
  65. BOOL LogSummary() { return m_verbnum & SUMMARYSTATS; }
  66. BOOL LogAccountDetails() { return m_verbnum & ACCOUNTSTATS; }
  67. BOOL LogPathDetails() { return m_verbnum & PATHSTATS; }
  68. DWORD LogSettings() { return m_verbnum; }
  69. DWORD TranslationMode() { return m_translationMode; }
  70. BOOL TranslateFiles() { return m_whichObjects & TRANSLATE_FILES; }
  71. BOOL TranslateShares() { return m_whichObjects & TRANSLATE_SHARES; }
  72. BOOL TranslateMailboxes() { return m_whichObjects & TRANSLATE_MAILBOXES; }
  73. BOOL TranslateContainers() { return m_whichObjects & TRANSLATE_CONTAINERS; }
  74. BOOL TranslateLocalGroups() { return m_whichObjects & TRANSLATE_LGROUPS; }
  75. BOOL TranslateUserRights() { return m_whichObjects & TRANSLATE_USERRIGHTS; }
  76. BOOL TranslateUserProfiles() { return m_whichObjects & TRANSLATE_USERPROFILES; }
  77. BOOL TranslatePrinters() { return m_whichObjects & TRANSLATE_PRINTERS; }
  78. BOOL TranslateRecycler() { return m_whichObjects & TRANSLATE_RECYCLER; }
  79. BOOL TranslateRegistry() { return m_whichObjects & TRANSLATE_REGISTRY; }
  80. BOOL UsingMapFile() const { return m_bUseMapFile; }
  81. void Source(WCHAR const * source) { safecopy(m_source,source); }
  82. void Target(WCHAR const * target) { safecopy(m_target,target); }
  83. void LogFile(WCHAR const * logfile) { safecopy(m_logfile,logfile); }
  84. void Verified(BOOL done) { m_needtoverify = !done; }
  85. void SetLogging(DWORD vn) { m_verbnum = vn; }
  86. void SetTranslationMode(DWORD mode) { m_translationMode = mode; }
  87. void SetWriteChanges(BOOL write) { m_nochange = !write; }
  88. void SetInvalid() { m_invalid = true; }
  89. void TranslateFiles(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_FILES : m_whichObjects &= ~TRANSLATE_FILES; }
  90. void TranslateShares(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_SHARES : m_whichObjects &= ~TRANSLATE_SHARES; }
  91. void TranslateMailboxes(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_MAILBOXES : m_whichObjects &= ~TRANSLATE_MAILBOXES; }
  92. void TranslateContainers(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_CONTAINERS : m_whichObjects &= ~TRANSLATE_CONTAINERS; }
  93. void TranslateLocalGroups(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_LGROUPS : m_whichObjects &= ~TRANSLATE_LGROUPS; }
  94. void TranslateUserRights(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_USERRIGHTS : m_whichObjects &= ~TRANSLATE_USERRIGHTS; }
  95. void TranslateUserProfiles(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_USERPROFILES : m_whichObjects &= ~TRANSLATE_USERPROFILES; }
  96. void TranslatePrinters(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_PRINTERS : m_whichObjects &= ~TRANSLATE_PRINTERS; }
  97. void TranslateRecycler(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_RECYCLER : m_whichObjects &= ~TRANSLATE_RECYCLER; }
  98. void TranslateRegistry(BOOL bTranslate) { bTranslate ? m_whichObjects |= TRANSLATE_REGISTRY : m_whichObjects &= ~TRANSLATE_REGISTRY; }
  99. void SetLocalMode(BOOL bLocal) { m_IsLocalSystem = ( bLocal == TRUE); }
  100. void Reset() { m_invalid = FALSE; m_needtoverify = TRUE; m_source[0]=0; m_target[0]=0;
  101. m_IsLocalSystem = FALSE; m_logfile[0]=0; m_verbnum = SUMMARYSTATS | ACCOUNTSTATS | FILESTATS;
  102. m_nochange = FALSE; m_translationMode = REPLACE_SECURITY;
  103. m_whichObjects = TRANSLATE_FILES; m_pathlist.Clear(); m_cache.Clear();
  104. m_cache.TypeSetTree(); m_bUndo = false; m_bUseMapFile = false;
  105. }
  106. BOOL IsValid() { return (*m_source && *m_target && m_pathlist.Count() && !m_invalid) ; }
  107. void SetUsingMapFile(BOOL bUsing) { m_bUseMapFile = ( bUsing == TRUE); }
  108. };
  109. #endif //__STARGS_HPP__