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.

44 lines
1.5 KiB

  1. // --------------------------------------------------------------------------
  2. // Module Name: ProfileUtil.h
  3. //
  4. // Copyright (c) 2000, Microsoft Corporation
  5. //
  6. // Class to handle profile loading and unloading without a token.
  7. //
  8. // History: 2000-06-21 vtan created
  9. // --------------------------------------------------------------------------
  10. #ifndef _ProfileUtil_
  11. #define _ProfileUtil_
  12. // --------------------------------------------------------------------------
  13. // CUserProfile
  14. //
  15. // Purpose: This class handles loading and unloading of a profile based
  16. // on object scope.
  17. //
  18. // History: 2000-06-21 vtan created
  19. // --------------------------------------------------------------------------
  20. class CUserProfile
  21. {
  22. private:
  23. CUserProfile (void);
  24. public:
  25. CUserProfile (const TCHAR *pszUsername, const TCHAR *pszDomain);
  26. ~CUserProfile (void);
  27. operator HKEY (void) const;
  28. private:
  29. static PSID UsernameToSID (const TCHAR *pszUsername, const TCHAR *pszDomain);
  30. static bool SIDStringToProfilePath (const TCHAR *pszSIDString, TCHAR *pszProfilePath);
  31. private:
  32. HKEY _hKeyProfile;
  33. TCHAR* _pszSID;
  34. bool _fLoaded;
  35. static const TCHAR s_szUserHiveFilename[];
  36. };
  37. #endif /* _ProfileUtil_ */