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.

129 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_AppendToLogs, true);
  14. Put(DCTVS_Options_DontBeginNewLog, true);
  15. Put(DCTVS_Options_Logfile, GetMigrationLogPath());
  16. Put(DCTVS_Options_DispatchLog, GetDispatchLogPath());
  17. Put(DCTVS_Options_AutoCloseHideDialogs, 2L);
  18. }
  19. //
  20. void SetTest(bool bTest)
  21. {
  22. Put(DCTVS_Options_NoChange, bTest);
  23. }
  24. void SetUndo(bool bUndo)
  25. {
  26. Put(DCTVS_Options_Undo, bUndo);
  27. }
  28. void SetWizard(LPCTSTR pszWizard)
  29. {
  30. Put(DCTVS_Options_Wizard, pszWizard);
  31. }
  32. void SetIntraForest(bool bIntraForest)
  33. {
  34. Put(DCTVS_Options_IsIntraforest, bIntraForest);
  35. }
  36. void SetSourceDomain(LPCTSTR pszNameFlat, LPCTSTR pszNameDns, LPCTSTR pszSid = NULL)
  37. {
  38. Put(DCTVS_Options_SourceDomain, (pszNameDns && pszNameDns[0]) ? pszNameDns : pszNameFlat);
  39. Put(DCTVS_Options_SourceDomainDns, (pszNameDns && pszNameDns[0]) ? pszNameDns : (LPCTSTR)NULL);
  40. Put(DCTVS_Options_SourceDomainFlat, pszNameFlat);
  41. if (pszSid)
  42. {
  43. Put(DCTVS_Options_SourceDomainSid, pszSid);
  44. }
  45. }
  46. void SetTargetDomain(LPCTSTR pszNameFlat, LPCTSTR pszNameDns)
  47. {
  48. Put(DCTVS_Options_TargetDomain, pszNameDns);
  49. Put(DCTVS_Options_TargetDomainDns, pszNameDns);
  50. Put(DCTVS_Options_TargetDomainFlat, pszNameFlat);
  51. }
  52. void SetTargetOu(LPCTSTR pszOu)
  53. {
  54. Put(DCTVS_Options_OuPath, pszOu);
  55. }
  56. void SetTargetServer(LPCTSTR pszServerFlat, LPCTSTR pszServerDns)
  57. {
  58. Put(DCTVS_Options_TargetServerOverride, pszServerFlat);
  59. Put(DCTVS_Options_TargetServerOverrideDns, pszServerDns);
  60. }
  61. void SetRenameOptions(long lOption, LPCTSTR pszPrefixOrSuffix)
  62. {
  63. switch (lOption)
  64. {
  65. case admtRenameWithPrefix:
  66. {
  67. if (pszPrefixOrSuffix && (_tcslen(pszPrefixOrSuffix) > 0))
  68. {
  69. if (IsValidPrefixOrSuffix(pszPrefixOrSuffix))
  70. {
  71. Put(DCTVS_Options_Prefix, pszPrefixOrSuffix);
  72. Put(DCTVS_Options_Suffix, (LPCTSTR)NULL);
  73. }
  74. else
  75. {
  76. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_INVALID_RENAME_PREFIX_SUFFIX);
  77. }
  78. }
  79. else
  80. {
  81. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_NO_RENAME_PREFIX);
  82. }
  83. break;
  84. }
  85. case admtRenameWithSuffix:
  86. {
  87. if (pszPrefixOrSuffix && (_tcslen(pszPrefixOrSuffix) > 0))
  88. {
  89. if (IsValidPrefixOrSuffix(pszPrefixOrSuffix))
  90. {
  91. Put(DCTVS_Options_Prefix, (LPCTSTR)NULL);
  92. Put(DCTVS_Options_Suffix, pszPrefixOrSuffix);
  93. }
  94. else
  95. {
  96. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_INVALID_RENAME_PREFIX_SUFFIX);
  97. }
  98. }
  99. else
  100. {
  101. AdmtThrowError(GUID_NULL, GUID_NULL, E_INVALIDARG, IDS_E_RENAME_NO_SUFFIX);
  102. }
  103. break;
  104. }
  105. }
  106. }
  107. void SetRestartDelay(long lTime)
  108. {
  109. Put(DCTVS_Options_GuiOnlyRebootSaver, lTime);
  110. }
  111. };