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.

55 lines
1.5 KiB

  1. //============================================================
  2. //
  3. // UserHive.h - Class to load/unload specified user's profile
  4. // hive from registry
  5. //
  6. // Copyright (c) 1997-2001 Microsoft Corporation, All Rights Reserved
  7. //
  8. // 01/03/97 a-jmoon created
  9. //
  10. //============================================================
  11. #ifndef __USERHIVE_INC__
  12. #define __USERHIVE_INC__
  13. class CRegistry;
  14. class CUserHive
  15. {
  16. public:
  17. CUserHive() ;
  18. ~CUserHive() ;
  19. DWORD Load(LPCWSTR pszUserName, LPWSTR pszKeyName, size_t PATHSIZE) ;
  20. DWORD LoadProfile( LPCWSTR pszProfile, CHString& strUserName );
  21. DWORD Unload(LPCWSTR pszKeyName) ;
  22. DWORD UserAccountFromProfile( CRegistry& reg, CHString& strUserName );
  23. private:
  24. OSVERSIONINFO OSInfo ;
  25. TOKEN_PRIVILEGES* m_pOriginalPriv ;
  26. HKEY m_hKey;
  27. DWORD m_dwSize;
  28. #ifdef NTONLY
  29. DWORD LoadNT(LPCWSTR pszUserName, LPWSTR pszKeyName, size_t PATHSIZE);
  30. DWORD AcquirePrivilege() ;
  31. void RestorePrivilege() ;
  32. #endif
  33. #ifdef WIN9XONLY
  34. DWORD Load95(LPCWSTR pszUserName, LPWSTR pszKeyName);
  35. #endif
  36. // using threadbase - that way we don't have to jump through any hoops
  37. // to make sure that the global critical section is initialized properly
  38. // this is mostly to serialize access to the NT User.dat file.
  39. static CThreadBase m_criticalSection;
  40. } ;
  41. #endif // file inclusion