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.

120 lines
3.8 KiB

  1. //*************************************************************
  2. //
  3. // Header file for Profile.cpp
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) Microsoft Corporation 1995
  7. // All rights reserved
  8. //
  9. //*************************************************************
  10. //
  11. // Internal flags
  12. //
  13. #define PROFILE_MANDATORY 0x00000001
  14. #define PROFILE_USE_CACHE 0x00000002
  15. #define PROFILE_NEW_LOCAL 0x00000004
  16. #define PROFILE_NEW_CENTRAL 0x00000008
  17. #define PROFILE_UPDATE_CENTRAL 0x00000010
  18. #define PROFILE_DELETE_CACHE 0x00000020
  19. // do not define bit 40 because NT4 has this defined as Run_SyncApps.
  20. #define PROFILE_GUEST_USER 0x00000080
  21. #define PROFILE_ADMIN_USER 0x00000100
  22. #define DEFAULT_NET_READY 0x00000200
  23. #define PROFILE_SLOW_LINK 0x00000400
  24. #define PROFILE_TEMP_ASSIGNED 0x00000800
  25. // do not define bit 1000, this was used briefly 2009, 2010 before
  26. #define PROFILE_PARTLY_LOADED 0x00002000
  27. #define PROFILE_BACKUP_EXISTS 0x00004000
  28. #define PROFILE_THIS_IS_BAK 0x00008000
  29. #define PROFILE_READONLY 0x00010000
  30. #define PROFILE_LOCALMANDATORY 0x00020000
  31. //
  32. // Registry key names
  33. //
  34. #define USER_CLASSES_HIVE_SUFFIX TEXT("_Classes")
  35. #define USER_KEY_PREFIX TEXT("\\Registry\\User\\")
  36. //
  37. // Local system name
  38. //
  39. #define LOCAL_SYSTEM_NAME L"NT AUTHORITY\\SYSTEM"
  40. //
  41. // User Preference values
  42. //
  43. #define USERINFO_LOCAL 0
  44. #define USERINFO_FLOATING 1
  45. #define USERINFO_MANDATORY 2
  46. #define USERINFO_BACKUP 3
  47. #define USERINFO_TEMP 4
  48. #define USERINFO_UNDEFINED 99
  49. #define PROFILEERRORACTION_TEMP 0
  50. #define PROFILEERRORACTION_LOGOFF 1
  51. typedef struct _PROFILE {
  52. DWORD dwFlags;
  53. DWORD dwInternalFlags;
  54. DWORD dwUserPreference;
  55. HANDLE hTokenUser;
  56. HANDLE hTokenClient;
  57. LPTSTR lpUserName;
  58. LPTSTR lpProfilePath;
  59. LPTSTR lpRoamingProfile;
  60. LPTSTR lpDefaultProfile;
  61. LPTSTR lpLocalProfile;
  62. LPTSTR lpPolicyPath;
  63. LPTSTR lpServerName;
  64. HKEY hKeyCurrentUser;
  65. FILETIME ftProfileLoad;
  66. FILETIME ftProfileUnload;
  67. LPTSTR lpExclusionList;
  68. } USERPROFILE, *LPPROFILE;
  69. typedef struct _SLOWLINKDLGINFO {
  70. DWORD dwTimeout;
  71. BOOL bSyncDefault;
  72. } SLOWLINKDLGINFO, FAR *LPSLOWLINKDLGINFO;
  73. static LPWSTR cszRPCProtocol = L"ncalrpc";
  74. static LPWSTR cszRPCEndPoint = L"IUserProfile";
  75. static DWORD cdwMaxRpcCalls = 1000000;
  76. // structure used to store client context
  77. typedef struct _CLIENTINFO
  78. {
  79. HANDLE hClientToken;
  80. LPPROFILEINFO pProfileInfo;
  81. }CLIENTINFO, *PCLIENTINFO;
  82. #if defined(__cplusplus)
  83. extern "C"{
  84. #endif
  85. LONG MyRegLoadKey(HKEY hKey, LPTSTR lpSubKey, LPTSTR lpFile);
  86. BOOL MyRegUnLoadKey(HKEY hKey, LPTSTR lpSubKey);
  87. BOOL SetupNewHive(LPPROFILE lpProfile, LPTSTR lpSidString, PSID pSid);
  88. BOOL DeleteProfileEx (LPCTSTR lpSidString, LPTSTR lpLocalProfile, DWORD dwDeleteFlags, HKEY hKeyLM, LPCTSTR szComputerName);
  89. BOOL ComputeLocalProfileName (LPPROFILE lpProfile, LPCTSTR lpUserName,
  90. LPTSTR lpProfileImage, DWORD cchMaxProfileImage,
  91. LPTSTR lpExpProfileImage, DWORD cchMaxExpProfileImage,
  92. PSID pSid, BOOL bWin9xUpg);
  93. BOOL SetDefaultUserHiveSecurity(LPPROFILE lpProfile, PSID pSid, HKEY RootKey);
  94. LONG LoadUserClasses( LPPROFILE lpProfile, LPTSTR SidString, BOOL bNewlyIssued);
  95. BOOL UnloadClasses(LPTSTR lpSidString);
  96. BOOL CreateSecureDirectory (LPPROFILE lpProfile, LPTSTR lpDirectory, PSID pSid, BOOL fRestricted);
  97. #if defined(__cplusplus)
  98. }
  99. #endif
  100. #define DP_BACKUP 1
  101. #define DP_BACKUPEXISTS 2
  102. #define DP_DELBACKUP 4
  103. BOOL MoveUserProfiles (LPCTSTR lpSrcDir, LPCTSTR lpDestDir);
  104. LPTSTR GetProfileSidString(HANDLE hToken);