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.

286 lines
10 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. #define USER_REGISTRY_EXT_MUTEX TEXT("userenv: User Registry policy mutex")
  50. #define MACH_REGISTRY_EXT_MUTEX TEXT("Global\\userenv: Machine Registry policy mutex")
  51. //
  52. // This event needs to be set for user or machine forced refresh
  53. //
  54. #define USER_POLICY_FORCE_REFRESH_EVENT TEXT("userenv: user policy force refresh event")
  55. #define MACHINE_POLICY_FORCE_REFRESH_EVENT TEXT("Global\\userenv: machine policy force refresh event")
  56. //
  57. // This event is set by the core if a reboot is needed for the forced refresh to complete.
  58. //
  59. #define USER_POLICY_REFRESH_NEEDFG_EVENT TEXT("userenv: User Group Policy ForcedRefresh Needs Foreground Processing")
  60. #define MACHINE_POLICY_REFRESH_NEEDFG_EVENT TEXT("Global\\userenv: Machine Group Policy ForcedRefresh Needs Foreground Processing")
  61. #define USER_SHELL_FOLDERS TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders")
  62. #if defined(_WIN64)
  63. #define USER_SHELL_FOLDERS32 TEXT("Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders")
  64. #endif
  65. #define SHELL_FOLDERS TEXT("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders")
  66. #define PROFILE_LIST_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList")
  67. #define PROFILE_GUID_PATH TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileGuid")
  68. #define PROFILES_DIRECTORY TEXT("ProfilesDirectory")
  69. #define ALL_USERS_PROFILE TEXT("AllUsersProfile")
  70. #define DEFAULT_USER_PROFILE TEXT("DefaultUserProfile")
  71. #define PROFILE_FLAGS TEXT("Flags")
  72. #define PROFILE_GUID TEXT("Guid")
  73. #define PROFILE_STATE TEXT("State")
  74. #define PROFILE_IMAGE_VALUE_NAME TEXT("ProfileImagePath")
  75. #define PROFILE_CENTRAL_PROFILE TEXT("CentralProfile")
  76. #define PROFILE_REF_COUNT TEXT("RefCount")
  77. #define PREFERENCE_KEYNAME TEXT("Preference")
  78. #define USER_PREFERENCE TEXT("UserPreference")
  79. #define PROFILE_LOAD_TIME_LOW TEXT("ProfileLoadTimeLow")
  80. #define PROFILE_LOAD_TIME_HIGH TEXT("ProfileLoadTimeHigh")
  81. #define PROFILE_UNLOAD_TIME_LOW TEXT("ProfileUnloadTimeLow")
  82. #define PROFILE_UNLOAD_TIME_HIGH TEXT("ProfileUnloadTimeHigh")
  83. #define PROFILE_GENERAL_SECTION TEXT("General")
  84. #define PROFILE_EXCLUSION_LIST TEXT("ExclusionList")
  85. #define PROFILE_LOAD_TYPE TEXT("ProfileLoadType")
  86. #define PROFILE_LAST_UPLOAD_STATE TEXT("LastUploadState")
  87. #define COMPLETE_PROFILE TEXT("Complete")
  88. #define PARTIAL_PROFILE TEXT("Partial")
  89. #define PROFILE_BUILD_NUMBER TEXT("BuildNumber")
  90. #define PROFILE_SID_STRING TEXT("SidString")
  91. #define TEMP_PROFILE_NAME_BASE TEXT("TEMP")
  92. #define PROFILE_UNLOAD_TIMEOUT TEXT("ProfileUnloadTimeout")
  93. #define DISABLE_PROFILE_UNLOAD_MSG TEXT("DisableProfileUnloadMsg")
  94. #define DELETE_ROAMING_CACHE TEXT("DeleteRoamingCache")
  95. #define ADD_ADMIN_GROUP_TO_RUP TEXT("AddAdminGroupToRUP")
  96. #define READONLY_RUP TEXT("ReadOnlyProfile")
  97. #define PROFILE_LOCALONLY TEXT("LocalProfile")
  98. #define USER_PROFILE_SETUP_EVENT TEXT("Global\\userenv: User Profile setup event")
  99. #define USER_PROFILE_MUTEX TEXT("Global\\userenv: User Profile Mutex for ")
  100. #define SYSTEM_PROFILE_LOCATION TEXT("%systemroot%\\system32\\config\\systemprofile")
  101. //
  102. // Appmgmt stuff to nuke
  103. //
  104. #define APPMGMT_DIR_ROOT TEXT("%systemroot%\\system32\\appmgmt")
  105. #define APPMGMT_REG_MANAGED TEXT("Software\\Microsoft\\Windows\\Currentversion\\Installer\\Managed")
  106. //
  107. // IE cache key
  108. //
  109. #define IE4_CACHE_KEY TEXT("Software\\Microsoft\\Windows\\Currentversion\\Internet Settings\\Cache\\Extensible Cache")
  110. #define IE5_CACHE_KEY TEXT("Software\\Microsoft\\Windows\\Currentversion\\Internet Settings\\5.0\\Cache\\Extensible Cache")
  111. #define IE_CACHEKEY_PREFIX TEXT("MsHist")
  112. #ifdef __cplusplus
  113. extern "C" {
  114. #endif
  115. extern HINSTANCE g_hDllInstance;
  116. extern TCHAR c_szRegistryExtName[];
  117. extern const TCHAR c_szRegistryPol[];
  118. //
  119. // Group policy handles
  120. //
  121. extern HANDLE g_hPolicyCritMutexMach;
  122. extern HANDLE g_hPolicyCritMutexUser;
  123. extern HANDLE g_hRegistryPolicyCritMutexMach;
  124. extern HANDLE g_hRegistryPolicyCritMutexUser;
  125. extern HANDLE g_hPolicyNotifyEventMach;
  126. extern HANDLE g_hPolicyNotifyEventUser;
  127. extern HANDLE g_hPolicyNeedFGEventMach;
  128. extern HANDLE g_hPolicyNeedFGEventUser;
  129. extern HANDLE g_hPolicyDoneEventMach;
  130. extern HANDLE g_hPolicyDoneEventUser;
  131. extern DWORD g_dwBuildNumber;
  132. extern HANDLE g_hProfileSetup;
  133. extern HANDLE g_hPolicyForegroundDoneEventMach;
  134. extern HANDLE g_hPolicyForegroundDoneEventUser;
  135. extern const TCHAR c_szStarDotStar[];
  136. extern const TCHAR c_szSlash[];
  137. extern const TCHAR c_szDot[];
  138. extern const TCHAR c_szDotDot[];
  139. extern const TCHAR c_szMAN[];
  140. extern const TCHAR c_szUSR[];
  141. extern const TCHAR c_szLog[];
  142. extern const TCHAR c_szPDS[];
  143. extern const TCHAR c_szPDM[];
  144. extern const TCHAR c_szLNK[];
  145. extern const TCHAR c_szBAK[];
  146. extern const TCHAR c_szNTUserTmp[];
  147. extern const TCHAR c_szNTUserMan[];
  148. extern const TCHAR c_szNTUserDat[];
  149. extern const TCHAR c_szNTUserIni[];
  150. extern const TCHAR c_szNTUserStar[];
  151. extern const TCHAR c_szUserStar[];
  152. extern const TCHAR c_szSpace[];
  153. extern const TCHAR c_szDotPif[];
  154. extern const TCHAR c_szNULL[];
  155. extern const TCHAR c_szCommonGroupsLocation[];
  156. #if defined(__cplusplus)
  157. }
  158. #endif
  159. //
  160. // Timeouts
  161. //
  162. #define SLOW_LINK_TIMEOUT 120 // ticks
  163. #define SLOW_LINK_TRANSFER_RATE 500 // Kbps
  164. #define PROFILE_DLG_TIMEOUT 30 // seconds
  165. //
  166. // Folder sizes
  167. //
  168. #define MAX_FOLDER_SIZE 80
  169. #define MAX_COMMON_LEN 30
  170. #define MAX_DLL_NAME_LEN 13
  171. //
  172. // Personal / common profile folders
  173. //
  174. #if defined(__cplusplus)
  175. extern "C" {
  176. #endif
  177. extern DWORD g_dwNumShellFolders;
  178. extern DWORD g_dwNumCommonShellFolders;
  179. #if defined(__cplusplus)
  180. }
  181. #endif
  182. typedef struct _FOLDER_INFO {
  183. BOOL bHidden;
  184. BOOL bLocal;
  185. BOOL bAddCSIDL;
  186. BOOL bNewNT5;
  187. BOOL bLocalSettings;
  188. INT iFolderID;
  189. LPTSTR lpFolderName;
  190. TCHAR szFolderLocation[MAX_FOLDER_SIZE]; // must be at end of structure
  191. LPTSTR lpFolderResourceDLL;
  192. INT iFolderResourceID;
  193. } FOLDER_INFO;
  194. #if defined(__cplusplus)
  195. extern "C" {
  196. #endif
  197. extern FOLDER_INFO c_ShellFolders[];
  198. extern FOLDER_INFO c_CommonShellFolders[];
  199. #if defined(__cplusplus)
  200. }
  201. #endif
  202. //
  203. // Product type
  204. //
  205. typedef enum {
  206. PT_WORKSTATION = 0x0001, // Workstation
  207. PT_SERVER = 0x0002, // Server
  208. PT_DC = 0x0004, // Domain controller
  209. PT_WINDOWS = 0x0008 // Windows
  210. } NTPRODUCTTYPE;
  211. #if defined(__cplusplus)
  212. extern "C" {
  213. #endif
  214. extern NTPRODUCTTYPE g_ProductType;
  215. #if defined(__cplusplus)
  216. }
  217. #endif
  218. //
  219. // Function proto-types
  220. //
  221. #if defined(__cplusplus)
  222. extern "C" {
  223. #endif
  224. void InitializeGlobals (HINSTANCE hInstance);
  225. void PatchLocalAppData(HANDLE hToken);
  226. void InitializeSnapProv();
  227. #if defined(__cplusplus)
  228. }
  229. #endif
  230. //
  231. // Type of message
  232. //
  233. #define DLGTYPE_ERROR 0
  234. #define DLGTYPE_SLOWLINK 1