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.

125 lines
2.1 KiB

  1. #pragma once
  2. #include <set>
  3. //---------------------------------------------------------------------------
  4. // Domain Account Class
  5. //---------------------------------------------------------------------------
  6. class CDomainAccount
  7. {
  8. public:
  9. CDomainAccount() :
  10. m_lUserAccountControl(0)
  11. {
  12. }
  13. CDomainAccount(const CDomainAccount& r) :
  14. m_strADsPath(r.m_strADsPath),
  15. m_strName(r.m_strName),
  16. m_strUserPrincipalName(r.m_strUserPrincipalName),
  17. m_strSamAccountName(r.m_strSamAccountName),
  18. m_strDnsHostName(r.m_strDnsHostName),
  19. m_lUserAccountControl(r.m_lUserAccountControl)
  20. {
  21. }
  22. ~CDomainAccount()
  23. {
  24. }
  25. //
  26. _bstr_t GetADsPath() const
  27. {
  28. return m_strADsPath;
  29. }
  30. void SetADsPath(_bstr_t strPath)
  31. {
  32. m_strADsPath = strPath;
  33. }
  34. _bstr_t GetName() const
  35. {
  36. return m_strName;
  37. }
  38. void SetName(_bstr_t strName)
  39. {
  40. m_strName = strName;
  41. }
  42. _bstr_t GetUserPrincipalName() const
  43. {
  44. return m_strUserPrincipalName;
  45. }
  46. void SetUserPrincipalName(_bstr_t strName)
  47. {
  48. m_strUserPrincipalName = strName;
  49. }
  50. _bstr_t GetSamAccountName() const
  51. {
  52. return m_strSamAccountName;
  53. }
  54. void SetSamAccountName(_bstr_t strName)
  55. {
  56. m_strSamAccountName = strName;
  57. }
  58. _bstr_t GetDnsHostName() const
  59. {
  60. return m_strDnsHostName;
  61. }
  62. void SetDnsHostName(_bstr_t strName)
  63. {
  64. m_strDnsHostName = strName;
  65. }
  66. long GetUserAccountControl() const
  67. {
  68. return m_lUserAccountControl;
  69. }
  70. void SetUserAccountControl(long lUserAccountControl)
  71. {
  72. m_lUserAccountControl = lUserAccountControl;
  73. }
  74. //
  75. bool operator <(const CDomainAccount& r) const
  76. {
  77. return (m_strADsPath < r.m_strADsPath);
  78. }
  79. protected:
  80. _bstr_t m_strADsPath;
  81. _bstr_t m_strName;
  82. _bstr_t m_strUserPrincipalName;
  83. _bstr_t m_strSamAccountName;
  84. _bstr_t m_strDnsHostName;
  85. long m_lUserAccountControl;
  86. };
  87. //---------------------------------------------------------------------------
  88. // Domain Accounts Class
  89. //---------------------------------------------------------------------------
  90. class CDomainAccounts :
  91. public std::set<CDomainAccount>
  92. {
  93. public:
  94. CDomainAccounts() {}
  95. };