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

#pragma once
#include "VarSetBase.h"
//---------------------------------------------------------------------------
// VarSet Servers Class
//---------------------------------------------------------------------------
class CVarSetServers : public CVarSet
{
public:
CVarSetServers(const CVarSet& rVarSet) :
CVarSet(rVarSet),
m_lIndex(0)
{
}
long GetCount()
{
return m_lIndex;
}
void AddServer(_bstr_t strServer, _bstr_t strServerDns, bool bMigrateOnly, bool bMoveToTarget, bool bReboot, long lRebootDelay)
{
_TCHAR szValueBase[64];
_TCHAR szValueName[128];
_stprintf(szValueBase, _T("Servers.%ld"), m_lIndex);
// ADsPath
// ADMT expects computer name to be prefixed with '\\'
Put(szValueBase, _T("\\\\") + strServer);
// DNS name
if (strServerDns.length())
{
_tcscpy(szValueName, szValueBase);
_tcscat(szValueName, _T(".DnsName"));
Put(szValueName, _T("\\\\") + strServerDns);
}
// migrate only
_tcscpy(szValueName, szValueBase);
_tcscat(szValueName, _T(".MigrateOnly"));
Put(szValueName, bMigrateOnly);
// move to target
_tcscpy(szValueName, szValueBase);
_tcscat(szValueName, _T(".MoveToTarget"));
Put(szValueName, bMoveToTarget);
// reboot
_tcscpy(szValueName, szValueBase);
_tcscat(szValueName, _T(".Reboot"));
Put(szValueName, bReboot);
// reboot delay
_tcscpy(szValueName, szValueBase);
_tcscat(szValueName, _T(".RebootDelay"));
Put(szValueName, lRebootDelay * 60L);
//
Put(DCTVS_Servers_NumItems, ++m_lIndex);
}
protected:
long m_lIndex;
};