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.

113 lines
1.8 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_lUserAccountControl(r.m_lUserAccountControl)
  19. {
  20. }
  21. ~CDomainAccount()
  22. {
  23. }
  24. //
  25. _bstr_t GetADsPath() const
  26. {
  27. return m_strADsPath;
  28. }
  29. void SetADsPath(_bstr_t strPath)
  30. {
  31. m_strADsPath = strPath;
  32. }
  33. _bstr_t GetName() const
  34. {
  35. return m_strName;
  36. }
  37. void SetName(_bstr_t strName)
  38. {
  39. m_strName = strName;
  40. }
  41. _bstr_t GetUserPrincipalName() const
  42. {
  43. return m_strUserPrincipalName;
  44. }
  45. void SetUserPrincipalName(_bstr_t strName)
  46. {
  47. m_strUserPrincipalName = strName;
  48. }
  49. _bstr_t GetSamAccountName() const
  50. {
  51. return m_strSamAccountName;
  52. }
  53. void SetSamAccountName(_bstr_t strName)
  54. {
  55. m_strSamAccountName = strName;
  56. }
  57. long GetUserAccountControl() const
  58. {
  59. return m_lUserAccountControl;
  60. }
  61. void SetUserAccountControl(long lUserAccountControl)
  62. {
  63. m_lUserAccountControl = lUserAccountControl;
  64. }
  65. //
  66. bool operator <(const CDomainAccount& r) const
  67. {
  68. return (m_strADsPath < r.m_strADsPath);
  69. }
  70. protected:
  71. _bstr_t m_strADsPath;
  72. _bstr_t m_strName;
  73. _bstr_t m_strUserPrincipalName;
  74. _bstr_t m_strSamAccountName;
  75. long m_lUserAccountControl;
  76. };
  77. //---------------------------------------------------------------------------
  78. // Domain Accounts Class
  79. //---------------------------------------------------------------------------
  80. class CDomainAccounts :
  81. public std::set<CDomainAccount>
  82. {
  83. public:
  84. CDomainAccounts() {}
  85. };