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.

74 lines
1.3 KiB

  1. #pragma once
  2. #include "VarSetBase.h"
  3. //---------------------------------------------------------------------------
  4. // VarSet Servers Class
  5. //---------------------------------------------------------------------------
  6. class CVarSetServers : public CVarSet
  7. {
  8. public:
  9. CVarSetServers(const CVarSet& rVarSet) :
  10. CVarSet(rVarSet),
  11. m_lIndex(0)
  12. {
  13. }
  14. long GetCount()
  15. {
  16. return m_lIndex;
  17. }
  18. void AddServer(_bstr_t strServer, bool bMigrateOnly, bool bMoveToTarget, bool bReboot, long lRebootDelay)
  19. {
  20. _TCHAR szValueBase[64];
  21. _TCHAR szValueName[128];
  22. _stprintf(szValueBase, _T("Servers.%ld"), m_lIndex);
  23. // ADsPath
  24. // ADMT expects computer name to be prefixed with '\\'
  25. Put(szValueBase, _T("\\\\") + strServer);
  26. // migrate only
  27. _tcscpy(szValueName, szValueBase);
  28. _tcscat(szValueName, _T(".MigrateOnly"));
  29. Put(szValueName, bMigrateOnly);
  30. // move to target
  31. _tcscpy(szValueName, szValueBase);
  32. _tcscat(szValueName, _T(".MoveToTarget"));
  33. Put(szValueName, bMoveToTarget);
  34. // reboot
  35. _tcscpy(szValueName, szValueBase);
  36. _tcscat(szValueName, _T(".Reboot"));
  37. Put(szValueName, bReboot);
  38. // reboot delay
  39. _tcscpy(szValueName, szValueBase);
  40. _tcscat(szValueName, _T(".RebootDelay"));
  41. Put(szValueName, lRebootDelay * 60L);
  42. //
  43. Put(DCTVS_Servers_NumItems, ++m_lIndex);
  44. }
  45. protected:
  46. long m_lIndex;
  47. };