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.

137 lines
3.1 KiB

  1. #pragma once
  2. #include <Validation.h>
  3. #include "VarSetBase.h"
  4. //---------------------------------------------------------------------------
  5. // VarSet Options Class
  6. //---------------------------------------------------------------------------
  7. class CVarSetOptions : public CVarSet
  8. {
  9. public:
  10. CVarSetOptions(const CVarSet& rVarSet) :
  11. CVarSet(rVarSet)
  12. {
  13. // Put(DCTVS_Options_MaxThreads, 20L);
  14. // TODO: these credentials are used during security translation?
  15. // Put(DCTVS_Options_Credentials_Domain, (LPCTSTR)NULL);
  16. // Put(DCTVS_Options_Credentials_UserName, (LPCTSTR)NULL);
  17. // Put(DCTVS_Options_Credentials_Password, (LPCTSTR)NULL);
  18. _bstr_t strLogFolder = GetLogFolder();
  19. Put(DCTVS_Options_DontBeginNewLog, true);
  20. Put(DCTVS_Options_AppendToLogs, true);
  21. Put(DCTVS_Options_Logfile, strLogFolder + _T("Migration.log"));
  22. Put(DCTVS_Options_DispatchLog, strLogFolder + _T("Dispatch.log"));
  23. Put(DCTVS_Options_AutoCloseHideDialogs, 2L);
  24. }
  25. //
  26. void SetTest(bool bTest)
  27. {
  28. Put(DCTVS_Options_NoChange, bTest);
  29. }
  30. void SetUndo(bool bUndo)
  31. {
  32. Put(DCTVS_Options_Undo, bUndo);
  33. }
  34. void SetWizard(LPCTSTR pszWizard)
  35. {
  36. Put(DCTVS_Options_Wizard, pszWizard);
  37. }
  38. void SetIntraForest(bool bIntraForest)
  39. {
  40. Put(DCTVS_Options_IsIntraforest, bIntraForest);
  41. }
  42. void SetSourceDomain(LPCTSTR pszNameFlat, LPCTSTR pszNameDns, LPCTSTR pszSid = NULL)
  43. {
  44. Put(DCTVS_Options_SourceDomain, pszNameFlat);
  45. Put(DCTVS_Options_SourceDomainDns, (pszNameDns && pszNameDns[0]) ? pszNameDns : pszNameFlat);
  46. if (pszSid)
  47. {
  48. Put(DCTVS_Options_SourceDomainSid, pszSid);
  49. }
  50. }
  51. void SetTargetDomain(LPCTSTR pszNameFlat, LPCTSTR pszNameDns)
  52. {
  53. Put(DCTVS_Options_TargetDomain, pszNameFlat);
  54. Put(DCTVS_Options_TargetDomainDns, pszNameDns);
  55. }
  56. void SetTargetOu(LPCTSTR pszOu)
  57. {
  58. Put(DCTVS_Options_OuPath, pszOu);
  59. }
  60. // only set if copying passwords
  61. void SetTargetServer(LPCTSTR pszServer)
  62. {
  63. Put(DCTVS_Options_TargetServerOverride, pszServer);
  64. }
  65. void SetRenameOptions(long lOption, LPCTSTR pszPrefixOrSuffix)
  66. {
  67. switch (lOption)
  68. {
  69. case admtRenameWithPrefix:
  70. {
  71. if (pszPrefixOrSuffix && (_tcslen(pszPrefixOrSuffix) > 0))
  72. {
  73. if (IsValidPrefixOrSuffix(pszPrefixOrSuffix))
  74. {
  75. Put(DCTVS_Options_Prefix, pszPrefixOrSuffix);
  76. Put(DCTVS_Options_Suffix, (LPCTSTR)NULL);
  77. }
  78. else
  79. {
  80. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_INVALID_RENAME_PREFIX_SUFFIX);
  81. }
  82. }
  83. else
  84. {
  85. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_NO_RENAME_PREFIX);
  86. }
  87. break;
  88. }
  89. case admtRenameWithSuffix:
  90. {
  91. if (pszPrefixOrSuffix && (_tcslen(pszPrefixOrSuffix) > 0))
  92. {
  93. if (IsValidPrefixOrSuffix(pszPrefixOrSuffix))
  94. {
  95. Put(DCTVS_Options_Prefix, (LPCTSTR)NULL);
  96. Put(DCTVS_Options_Suffix, pszPrefixOrSuffix);
  97. }
  98. else
  99. {
  100. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_INVALID_RENAME_PREFIX_SUFFIX);
  101. }
  102. }
  103. else
  104. {
  105. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_RENAME_NO_SUFFIX);
  106. }
  107. break;
  108. }
  109. }
  110. }
  111. void SetRestartDelay(long lTime)
  112. {
  113. Put(DCTVS_Options_GuiOnlyRebootSaver, lTime);
  114. }
  115. };