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.

71 lines
2.7 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: SpecialAccounts.h
  3. //
  4. // Copyright (c) 1999-2000, Microsoft Corporation
  5. //
  6. // Class that implements handling special account names for exclusion or
  7. // inclusion.
  8. //
  9. // History: 1999-10-30 vtan created
  10. // 1999-11-26 vtan moved from logonocx
  11. // 2000-01-31 vtan moved from Neptune to Whistler
  12. // --------------------------------------------------------------------------
  13. #ifndef _SpecialAccounts_
  14. #define _SpecialAccounts_
  15. // --------------------------------------------------------------------------
  16. // CSpecialAccounts
  17. //
  18. // Purpose: A class to handle special case accounts. This knows where to
  19. // go in the registry for the information and how to interpret
  20. // the information.
  21. //
  22. // The value name defines the string to compare to. The
  23. // enumeration in the class definition tells the iteration loop
  24. // how to perform the comparison and when the comparison is a
  25. // match whether to return a match result or not.
  26. //
  27. // History: 1999-10-30 vtan created
  28. // 1999-11-26 vtan moved from logonocx
  29. // 2000-01-31 vtan moved from Neptune to Whistler
  30. // --------------------------------------------------------------------------
  31. class CSpecialAccounts
  32. {
  33. public:
  34. enum
  35. {
  36. RESULT_EXCLUDE = 0x00000000,
  37. RESULT_INCLUDE = 0x00000001,
  38. RESULT_MASK = 0x0000FFFF,
  39. COMPARISON_EQUALS = 0x00000000,
  40. COMPARISON_STARTSWITH = 0x00010000,
  41. COMPARISON_MASK = 0xFFFF0000
  42. };
  43. private:
  44. typedef struct
  45. {
  46. DWORD dwAction;
  47. WCHAR wszUsername[UNLEN + sizeof('\0')];
  48. } SPECIAL_ACCOUNTS, *PSPECIAL_ACCOUNTS;
  49. public:
  50. CSpecialAccounts (void);
  51. ~CSpecialAccounts (void);
  52. bool AlwaysExclude (const WCHAR *pwszAccountName) const;
  53. bool AlwaysInclude (const WCHAR *pwszAccountName) const;
  54. static void Install (void);
  55. private:
  56. bool IterateAccounts (const WCHAR *pwszAccountName, DWORD dwResultType) const;
  57. private:
  58. DWORD _dwSpecialAccountsCount;
  59. PSPECIAL_ACCOUNTS _pSpecialAccounts;
  60. static const TCHAR s_szUserListKeyName[];
  61. };
  62. #endif /* _SpecialAccounts_ */