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.

84 lines
1.8 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, _bstr_t strServerDns, 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. // DNS name
  27. if (strServerDns.length())
  28. {
  29. _tcscpy(szValueName, szValueBase);
  30. _tcscat(szValueName, _T(".DnsName"));
  31. Put(szValueName, _T("\\\\") + strServerDns);
  32. }
  33. // migrate only
  34. _tcscpy(szValueName, szValueBase);
  35. _tcscat(szValueName, _T(".MigrateOnly"));
  36. Put(szValueName, bMigrateOnly);
  37. // move to target
  38. _tcscpy(szValueName, szValueBase);
  39. _tcscat(szValueName, _T(".MoveToTarget"));
  40. Put(szValueName, bMoveToTarget);
  41. // reboot
  42. _tcscpy(szValueName, szValueBase);
  43. _tcscat(szValueName, _T(".Reboot"));
  44. Put(szValueName, bReboot);
  45. // reboot delay
  46. _tcscpy(szValueName, szValueBase);
  47. _tcscat(szValueName, _T(".RebootDelay"));
  48. Put(szValueName, lRebootDelay * 60L);
  49. //
  50. Put(DCTVS_Servers_NumItems, ++m_lIndex);
  51. }
  52. protected:
  53. long m_lIndex;
  54. };