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.

278 lines
9.7 KiB

  1. //*************************************************************
  2. //
  3. // Global Variable Extern's
  4. //
  5. // Microsoft Confidential
  6. // Copyright (c) Microsoft Corporation 1995
  7. // All rights reserved
  8. //
  9. //*************************************************************
  10. #define WINLOGON_KEY TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon")
  11. #define WINDOWS_POLICIES_KEY TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Policies")
  12. #define ROOT_POLICIES_KEY TEXT("Software\\Policies")
  13. #define SYSTEM_POLICIES_KEY TEXT("Software\\Policies\\Microsoft\\Windows\\System")
  14. #define DIAGNOSTICS_KEY TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\Diagnostics")
  15. #define DIAGNOSTICS_GLOBAL_VALUE TEXT("RunDiagnosticLoggingGlobal")
  16. #define DIAGNOSTICS_POLICY_VALUE TEXT("RunDiagnosticLoggingGroupPolicy")
  17. #define LOCAL_GPO_DIRECTORY TEXT("%SystemRoot%\\System32\\GroupPolicy")
  18. #define LONG_UNC_PATH_PREFIX TEXT("\\\\?\\UNC")
  19. //ds
  20. //
  21. // When the time to change the profiles directory to the root,
  22. // these things need to be done / checked:
  23. //
  24. // 1) Search for //ds everywhere in this directory
  25. // 2) Change the default profiles directory in
  26. // windows\setup\inf\win4\inf\usa\hivesft.txt
  27. // note: the new name is "Documents and Settings"
  28. // 3) In hivedef.inx, remove the TEMP and TMP environment variable entries
  29. // 4) Remove all of the special folder entries
  30. // 5) In usa\hivedef.txt, remove TEMP, TMP, and special folder entries
  31. // 6) Review MoveUserProfile() function to make sure it will handle
  32. // name collision (dual boot) case for All Users and Default User
  33. //
  34. #define NT4_PROFILES_DIRECTORY TEXT("%SystemRoot%\\Profiles")
  35. #define DEFAULT_USER TEXT("Default User")
  36. #define DEFAULT_USER_NETWORK TEXT("Default User (Network)")
  37. #define ALL_USERS TEXT("All Users")
  38. #define GUIMODE_SETUP_MUTEX TEXT("Global\\userenv: GUI mode setup running")
  39. #define USER_POLICY_MUTEX TEXT("userenv: user policy mutex")
  40. #define MACHINE_POLICY_MUTEX TEXT("Global\\userenv: machine policy mutex")
  41. #define USER_POLICY_REFRESH_EVENT TEXT("userenv: user policy refresh event")
  42. #define MACHINE_POLICY_REFRESH_EVENT TEXT("Global\\userenv: machine policy refresh event")
  43. #define USER_POLICY_APPLIED_EVENT TEXT("userenv: User Group Policy has been applied")
  44. #define MACHINE_POLICY_APPLIED_EVENT TEXT("Global\\userenv: Machine Group Policy has been applied")
  45. #define USER_POLICY_DONE_EVENT TEXT("userenv: User Group Policy Processing is done")
  46. #define MACHINE_POLICY_DONE_EVENT TEXT("Global\\userenv: Machine Group Policy Processing is done")
  47. #define MACH_POLICY_FOREGROUND_DONE_EVENT TEXT("Global\\userenv: Machine Policy Foreground Done Event")
  48. #define USER_POLICY_FOREGROUND_DONE_EVENT TEXT("userenv: User Policy Foreground Done Event")
  49. //
  50. // This event needs to be set for user or machine forced refresh
  51. //
  52. #define USER_POLICY_FORCE_REFRESH_EVENT TEXT("userenv: user policy force refresh event")
  53. #define MACHINE_POLICY_FORCE_REFRESH_EVENT TEXT("Global\\userenv: machine policy force refresh event")
  54. //
  55. // This event is set by the core if a reboot is needed for the forced refresh to complete.
  56. //
  57. #define USER_POLICY_REFRESH_NEEDFG_EVENT TEXT("userenv: User Group Policy ForcedRefresh Needs Foreground Processing")
  58. #define MACHINE_POLICY_REFRESH_NEEDFG_EVENT TEXT("Global\\userenv: Machine Group Policy ForcedRefresh Needs Foreground Processing")
  59. #define USER_SHELL_FOLDERS TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders")
  60. #if defined(_WIN64)
  61. #define USER_SHELL_FOLDERS32 TEXT("Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders")
  62. #endif
  63. #define SHELL_FOLDERS TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")
  64. #define PROFILE_LIST_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList")
  65. #define PROFILE_GUID_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileGuid")
  66. #define PROFILES_DIRECTORY TEXT("ProfilesDirectory")
  67. #define ALL_USERS_PROFILE TEXT("AllUsersProfile")
  68. #define DEFAULT_USER_PROFILE TEXT("DefaultUserProfile")
  69. #define PROFILE_FLAGS TEXT("Flags")
  70. #define PROFILE_GUID TEXT("Guid")
  71. #define PROFILE_STATE TEXT("State")
  72. #define PROFILE_IMAGE_VALUE_NAME TEXT("ProfileImagePath")
  73. #define PROFILE_CENTRAL_PROFILE TEXT("CentralProfile")
  74. #define PROFILE_REF_COUNT TEXT("RefCount")
  75. #define USER_PREFERENCE TEXT("UserPreference")
  76. #define PROFILE_LOAD_TIME_LOW TEXT("ProfileLoadTimeLow")
  77. #define PROFILE_LOAD_TIME_HIGH TEXT("ProfileLoadTimeHigh")
  78. #define PROFILE_UNLOAD_TIME_LOW TEXT("ProfileUnloadTimeLow")
  79. #define PROFILE_UNLOAD_TIME_HIGH TEXT("ProfileUnloadTimeHigh")
  80. #define PROFILE_GENERAL_SECTION TEXT("General")
  81. #define PROFILE_EXCLUSION_LIST TEXT("ExclusionList")
  82. #define PROFILE_LOAD_TYPE TEXT("ProfileLoadType")
  83. #define PROFILE_LAST_UPLOAD_STATE TEXT("LastUploadState")
  84. #define COMPLETE_PROFILE TEXT("Complete")
  85. #define PARTIAL_PROFILE TEXT("Partial")
  86. #define PROFILE_BUILD_NUMBER TEXT("BuildNumber")
  87. #define PROFILE_SID_STRING TEXT("SidString")
  88. #define TEMP_PROFILE_NAME_BASE TEXT("TEMP")
  89. #define PROFILE_UNLOAD_TIMEOUT TEXT("ProfileUnloadTimeout")
  90. #define DISABLE_PROFILE_UNLOAD_MSG TEXT("DisableProfileUnloadMsg")
  91. #define DELETE_ROAMING_CACHE TEXT("DeleteRoamingCache")
  92. #define ADD_ADMIN_GROUP_TO_RUP TEXT("AddAdminGroupToRUP")
  93. #define READONLY_RUP TEXT("ReadOnlyProfile")
  94. #define PROFILE_LOCALONLY TEXT("LocalProfile")
  95. #define USER_PROFILE_SETUP_EVENT TEXT("Global\\userenv: User Profile setup event")
  96. #define USER_PROFILE_MUTEX TEXT("Global\\userenv: User Profile Mutex for ")
  97. #define SYSTEM_PROFILE_LOCATION TEXT("%systemroot%\\system32\\config\\systemprofile")
  98. //
  99. // Appmgmt stuff to nuke
  100. //
  101. #define APPMGMT_DIR_ROOT TEXT("%systemroot%\\system32\\appmgmt")
  102. #define APPMGMT_REG_MANAGED TEXT("Software\\Microsoft\\Windows\\Currentversion\\Installer\\Managed")
  103. //
  104. // IE cache key
  105. //
  106. #define IE4_CACHE_KEY TEXT("Software\\Microsoft\\Windows\\Currentversion\\Internet Settings\\Cache\\Extensible Cache")
  107. #define IE5_CACHE_KEY TEXT("Software\\Microsoft\\Windows\\Currentversion\\Internet Settings\\5.0\\Cache\\Extensible Cache")
  108. #define IE_CACHEKEY_PREFIX TEXT("MsHist")
  109. #ifdef __cplusplus
  110. extern "C" {
  111. #endif
  112. extern HINSTANCE g_hDllInstance;
  113. extern TCHAR c_szRegistryExtName[];
  114. extern const TCHAR c_szRegistryPol[];
  115. //
  116. // Group policy handles
  117. //
  118. extern HANDLE g_hPolicyCritMutexMach;
  119. extern HANDLE g_hPolicyCritMutexUser;
  120. extern HANDLE g_hPolicyNotifyEventMach;
  121. extern HANDLE g_hPolicyNotifyEventUser;
  122. extern HANDLE g_hPolicyNeedFGEventMach;
  123. extern HANDLE g_hPolicyNeedFGEventUser;
  124. extern HANDLE g_hPolicyDoneEventMach;
  125. extern HANDLE g_hPolicyDoneEventUser;
  126. extern DWORD g_dwBuildNumber;
  127. extern HANDLE g_hProfileSetup;
  128. extern HANDLE g_hPolicyForegroundDoneEventMach;
  129. extern HANDLE g_hPolicyForegroundDoneEventUser;
  130. extern const TCHAR c_szStarDotStar[];
  131. extern const TCHAR c_szSlash[];
  132. extern const TCHAR c_szDot[];
  133. extern const TCHAR c_szDotDot[];
  134. extern const TCHAR c_szMAN[];
  135. extern const TCHAR c_szUSR[];
  136. extern const TCHAR c_szLog[];
  137. extern const TCHAR c_szPDS[];
  138. extern const TCHAR c_szPDM[];
  139. extern const TCHAR c_szLNK[];
  140. extern const TCHAR c_szBAK[];
  141. extern const TCHAR c_szNTUserTmp[];
  142. extern const TCHAR c_szNTUserMan[];
  143. extern const TCHAR c_szNTUserDat[];
  144. extern const TCHAR c_szNTUserIni[];
  145. extern const TCHAR c_szNTUserStar[];
  146. extern const TCHAR c_szUserStar[];
  147. extern const TCHAR c_szSpace[];
  148. extern const TCHAR c_szDotPif[];
  149. extern const TCHAR c_szNULL[];
  150. extern const TCHAR c_szCommonGroupsLocation[];
  151. #if defined(__cplusplus)
  152. }
  153. #endif
  154. //
  155. // Timeouts
  156. //
  157. #define SLOW_LINK_TIMEOUT 120 // ticks
  158. #define SLOW_LINK_TRANSFER_RATE 500 // Kbps
  159. #define PROFILE_DLG_TIMEOUT 30 // seconds
  160. //
  161. // Folder sizes
  162. //
  163. #define MAX_FOLDER_SIZE 80
  164. #define MAX_COMMON_LEN 30
  165. #define MAX_DLL_NAME_LEN 13
  166. //
  167. // Personal / common profile folders
  168. //
  169. #if defined(__cplusplus)
  170. extern "C" {
  171. #endif
  172. extern DWORD g_dwNumShellFolders;
  173. extern DWORD g_dwNumCommonShellFolders;
  174. #if defined(__cplusplus)
  175. }
  176. #endif
  177. typedef struct _FOLDER_INFO {
  178. BOOL bHidden;
  179. BOOL bLocal;
  180. BOOL bAddCSIDL;
  181. BOOL bNewNT5;
  182. BOOL bLocalSettings;
  183. INT iFolderID;
  184. LPTSTR lpFolderName;
  185. TCHAR szFolderLocation[MAX_FOLDER_SIZE]; // must be at end of structure
  186. LPTSTR lpFolderResourceDLL;
  187. INT iFolderResourceID;
  188. } FOLDER_INFO;
  189. #if defined(__cplusplus)
  190. extern "C" {
  191. #endif
  192. extern FOLDER_INFO c_ShellFolders[];
  193. extern FOLDER_INFO c_CommonShellFolders[];
  194. #if defined(__cplusplus)
  195. }
  196. #endif
  197. //
  198. // Product type
  199. //
  200. typedef enum {
  201. PT_WORKSTATION = 0x0001, // Workstation
  202. PT_SERVER = 0x0002, // Server
  203. PT_DC = 0x0004, // Domain controller
  204. PT_WINDOWS = 0x0008 // Windows
  205. } NTPRODUCTTYPE;
  206. #if defined(__cplusplus)
  207. extern "C" {
  208. #endif
  209. extern NTPRODUCTTYPE g_ProductType;
  210. #if defined(__cplusplus)
  211. }
  212. #endif
  213. //
  214. // Function proto-types
  215. //
  216. #if defined(__cplusplus)
  217. extern "C" {
  218. #endif
  219. void InitializeGlobals (HINSTANCE hInstance);
  220. void PatchLocalAppData(HANDLE hToken);
  221. void InitializeSnapProv();
  222. #if defined(__cplusplus)
  223. }
  224. #endif
  225. //
  226. // Type of message
  227. //
  228. #define DLGTYPE_ERROR 0
  229. #define DLGTYPE_SLOWLINK 1