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.

58 lines
2.7 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: UserList.h
  3. //
  4. // Copyright (c) 1999-2000, Microsoft Corporation
  5. //
  6. // Class that implements the user list filtering algorithm shared by winlogon
  7. // calling into msgina and shgina (the logonocx) calling into msgina.
  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. // 2000-05-30 vtan moved IsUserLoggedOn to this file
  13. // --------------------------------------------------------------------------
  14. #ifndef _UserList_
  15. #define _UserList_
  16. #include "GinaIPC.h"
  17. // --------------------------------------------------------------------------
  18. // CUserList
  19. //
  20. // Purpose: A class that knows how to filter the user list from the net
  21. // APIs using a common algorithm. This allows a focal point for
  22. // the filter where a change here can affect all components.
  23. //
  24. // History: 1999-11-26 vtan created
  25. // 2000-01-31 vtan moved from Neptune to Whistler
  26. // --------------------------------------------------------------------------
  27. class CUserList
  28. {
  29. public:
  30. static LONG Get (bool fRemoveGuest, DWORD *pdwReturnedEntryCount, GINA_USER_INFORMATION* *pReturnedUserList);
  31. static bool IsUserLoggedOn (const WCHAR *pszUsername, const WCHAR *pszDomain);
  32. static int IsInteractiveLogonAllowed (const WCHAR *pszUserame);
  33. private:
  34. static PSID ConvertNameToSID (const WCHAR *pszUsername);
  35. static bool IsUserMemberOfLocalAdministrators (const WCHAR *pszName);
  36. static bool IsUserMemberOfLocalKnownGroup (const WCHAR *pszName);
  37. static void DeleteEnumerateUsers (NET_DISPLAY_USER *pNDU, DWORD& dwEntriesRead, int iIndex);
  38. static void DetermineWellKnownAccountNames (void);
  39. static bool ParseDisplayInformation (NET_DISPLAY_USER *pNDU, DWORD dwEntriesRead, GINA_USER_INFORMATION*& pUserList, DWORD& dwEntryCount);
  40. static void Sort (GINA_USER_INFORMATION *pUserList, DWORD dwEntryCount);
  41. static unsigned char s_SIDAdministrator[];
  42. static unsigned char s_SIDGuest[];
  43. static WCHAR s_szAdministratorsGroupName[];
  44. static WCHAR s_szPowerUsersGroupName[];
  45. static WCHAR s_szUsersGroupName[];
  46. static WCHAR s_szGuestsGroupName[];
  47. static const int s_iMaximumUserCount = 100;
  48. };
  49. #endif /* _UserList_ */