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.

77 lines
1.3 KiB

  1. #pragma once
  2. #include "VarSetBase.h"
  3. //---------------------------------------------------------------------------
  4. // VarSet Accounts Class
  5. //---------------------------------------------------------------------------
  6. class CVarSetAccounts : public CVarSet
  7. {
  8. public:
  9. CVarSetAccounts(const CVarSet& rVarSet) :
  10. CVarSet(rVarSet),
  11. m_lIndex(0)
  12. {
  13. }
  14. long GetCount()
  15. {
  16. return m_lIndex;
  17. }
  18. void AddAccount(LPCTSTR pszType, LPCTSTR pszPath, LPCTSTR pszName = NULL, LPCTSTR pszUPName = NULL)
  19. {
  20. _TCHAR szValueBase[64];
  21. _TCHAR szValueName[128];
  22. _stprintf(szValueBase, _T("Accounts.%ld"), m_lIndex);
  23. // ADsPath
  24. Put(szValueBase, pszPath);
  25. // type
  26. _tcscpy(szValueName, szValueBase);
  27. _tcscat(szValueName, _T(".Type"));
  28. Put(szValueName, pszType);
  29. // name
  30. if (pszName)
  31. {
  32. _tcscpy(szValueName, szValueBase);
  33. _tcscat(szValueName, _T(".Name"));
  34. Put(szValueName, pszName);
  35. }
  36. // user principal name
  37. if (pszUPName)
  38. {
  39. _tcscpy(szValueName, szValueBase);
  40. _tcscat(szValueName, _T(".UPNName"));
  41. Put(szValueName, pszUPName);
  42. }
  43. // target name
  44. // _tcscpy(szValueName, szValueBase);
  45. // _tcscat(szValueName, _T(".TargetName"));
  46. // Put(szValueName, (LPCTSTR)NULL);
  47. Put(DCTVS_Accounts_NumItems, ++m_lIndex);
  48. }
  49. protected:
  50. long m_lIndex;
  51. };