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.

199 lines
9.5 KiB

  1. /******************************************************************************
  2. *
  3. * Copyright (c) 2000 Microsoft Corporation
  4. *
  5. * Module Name:
  6. * srdefs.h
  7. *
  8. * Abstract:
  9. * SR constants definitions.
  10. *
  11. * Revision History:
  12. * Brijesh Krishnaswami (brijeshk) 03/17/2000
  13. * created
  14. *
  15. *****************************************************************************/
  16. #ifndef _SRDEFS_H_
  17. #define _SRDEFS_H_
  18. // service names
  19. static LPCWSTR s_cszServiceName = L"SRService";
  20. static LPCWSTR s_cszFilterName = L"SR";
  21. static LPCWSTR s_cszServiceDispName = L"System Restore Service";
  22. // log file names
  23. static LPCWSTR s_cszRestorePointLogName = L"rp.log";
  24. static LPCWSTR s_cszCurrentChangeLog = L"change.log";
  25. static LPCWSTR s_cszChangeLogPrefix = L"change.log.";
  26. static LPCWSTR s_cszChangeLogSuffix = L"";
  27. static LPCWSTR s_cszFifoLog = L"fifo.log";
  28. // directories
  29. static LPCWSTR s_cszSysVolInfo = L"System Volume Information";
  30. static LPCWSTR s_cszRestoreDir = L"_restore";
  31. static LPCWSTR s_cszRPDir = L"RP";
  32. static LPCWSTR s_cszFifoedRpDir = L"Fifoed";
  33. //
  34. // patch constants
  35. //
  36. static LPCWSTR s_cszReferenceDir = L"RefRP";
  37. static LPCWSTR s_cszPatchWindow = L"PatchWindow";
  38. static LPCWSTR s_cszPatchCompleteMarker = L"patover";
  39. static LPCWSTR s_cszPatchExtension = L"._sr";
  40. // reg hives for snapshot
  41. static LPCWSTR s_cszSnapshotHardwareHive = L"Hardware";
  42. static LPCWSTR s_cszSnapshotUsersHive = L"USERS";
  43. static LPCWSTR s_cszSnapshotProfileList = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList";
  44. static LPCWSTR s_cszSnapshotProfileImagePath = L"ProfileImagePath";
  45. static LPCWSTR s_cszSnapshotNTUserDat = L"ntuser.dat";
  46. // sr regkey constants
  47. static LPCWSTR s_cszServiceRootRegKey = L"System\\CurrentControlSet\\Services\\SRService";
  48. static LPCWSTR s_cszServiceRegKey = L"System\\CurrentControlSet\\Services\\SRService\\Parameters";
  49. static LPCWSTR s_cszSRRegKey = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore";
  50. static LPCWSTR s_cszSRRegKey2 = L"Microsoft\\Windows NT\\CurrentVersion\\SystemRestore";
  51. static LPCWSTR s_cszSRSnapshotRegKey = L"FilesToSnapshot";
  52. static LPCWSTR s_cszSRCfgRegKey = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\\Cfg";
  53. static LPCWSTR s_cszRegHiveTmp = L"SystemRestoreSnapshot";
  54. static LPCWSTR s_cszSRMachineGuid = L"MachineGuid";
  55. static LPCWSTR s_cszFilterRegKey = L"System\\CurrentControlSet\\Services\\SR\\Parameters";
  56. static LPCWSTR s_cszGroupPolicy = L"Software\\Policies\\Microsoft\\Windows NT\\SystemRestore";
  57. static LPCWSTR s_cszDisableSR = L"DisableSR";
  58. static LPCWSTR s_cszDisableConfig = L"DisableConfig";
  59. static LPCWSTR s_cszDSMax = L"DSMax";
  60. static LPCWSTR s_cszDSMin = L"DSMin";
  61. static LPCWSTR s_cszRPSessionInterval = L"RPSessionInterval";
  62. static LPCWSTR s_cszRPGlobalInterval = L"RPGlobalInterval";
  63. static LPCWSTR s_cszRPLifeInterval = L"RPLifeInterval";
  64. static LPCWSTR s_cszTimerInterval = L"TimerInterval";
  65. static LPCWSTR s_cszCompressionBurst = L"CompressionBurst";
  66. static LPCWSTR s_cszSRStatus = L"SRStatus";
  67. static LPCWSTR s_cszFirstRun = L"FirstRun";
  68. static LPCWSTR s_cszDiskPercent = L"DiskPercent";
  69. static LPCWSTR s_cszThawInterval = L"ThawInterval";
  70. static LPCWSTR s_cszDebugBreak = L"DebugBreak";
  71. static LPCWSTR s_cszRestoreInProgress = L"RestoreInProgress";
  72. static LPCWSTR s_cszTestBroadcast = L"TestBroadcast";
  73. static LPCWSTR s_cszCreateFirstRunRp = L"CreateFirstRunRp";
  74. static LPCWSTR s_cszRestoreStatus = L"RestoreStatus";
  75. static LPCWSTR s_cszSRUnattendedSection = L"SystemRestore";
  76. static LPCWSTR s_cszRestoreDiskSpaceError = L"RestoreDiskSpaceError";
  77. static LPCWSTR s_cszRestoreSafeModeStatus = L"RestoreSafeModeStatus";
  78. static LPCWSTR s_cszRegLMSYSSessionMan = L"CurrentControlSet\\Control\\Session Manager";
  79. static LPCWSTR s_cszCallbacksRegKey = L"SnapshotCallbacks";
  80. // sync objects
  81. static LPCWSTR s_cszSRInitEvent = L"SRInitEvent";
  82. static LPCWSTR s_cszSRStopEvent = L"SRStopEvent";
  83. static LPCWSTR s_cszIdleRequestEvent = L"SRIdleReqEvent";
  84. static LPCWSTR s_cszDSMutex = L"SRDataStore";
  85. // rpc
  86. static LPWSTR s_cszRPCProtocol = L"ncalrpc";
  87. static LPWSTR s_cszRPCEndPoint = L"srrpc";
  88. // datastore files
  89. static const WCHAR s_cszRestorePointSize[] = L"\\RestorePointSize";
  90. static LPCWSTR s_cszFilelistDat = L"_filelst.cfg";
  91. static LPCWSTR s_cszWinRestDir = L"%SystemRoot%\\system32\\restore\\";
  92. static LPCWSTR s_cszFilelistXml = L"filelist.xml";
  93. static LPCWSTR s_cszMofFile = L"sr.mof";
  94. static const WCHAR s_cszDriveTable[] = L"drivetable.txt";
  95. // restore point names
  96. static LPCWSTR s_cszSystemCheckpointName = L"System Checkpoint";
  97. // default registry values
  98. // values in MB and seconds
  99. #define SR_DEFAULT_DSMIN 200 // system drive
  100. #define SR_DEFAULT_DSMIN_NONSYSTEM 50 // non-system drive
  101. #define SR_DEFAULT_DSMAX 400 // all drives
  102. #define SR_DEFAULT_RPSESSIONINTERVAL 0 // not configured
  103. #define SR_DEFAULT_RPGLOBALINTERVAL (24*60*60) // 24 hrs
  104. #define SR_DEFAULT_RPLIFEINTERVAL 7776000 // 90 days
  105. #define SR_DEFAULT_TIMERINTERVAL (2*60) // 2 minutes
  106. #define SR_DEFAULT_THAW_INTERVAL (15*60) // 15 minutes
  107. #define SR_DEFAULT_IDLEINTERVAL (60*60) // 1 hour
  108. #define SR_DEFAULT_COMPRESSIONBURST 60 // 60 seconds
  109. #define SR_STATUS_ENABLED 0
  110. #define SR_STATUS_DISABLED 1
  111. #define SR_STATUS_FROZEN 2
  112. #define SR_FIRSTRUN_YES 1
  113. #define SR_FIRSTRUN_NO 0
  114. #define SR_DEFAULT_DISK_PERCENT 12
  115. #define MAX_FREEZETHAW_LOG_MESSAGES 20
  116. static LPCWSTR s_cszSessionManagerRegKey = L"System\\CurrentControlSet\\Control\\Session Manager";
  117. static LPCWSTR s_cszMoveFileExRegValue = L"PendingFileRenameOperations";
  118. static LPCWSTR s_cszCOMDllName = L"catsrvut.dll";
  119. // other constants
  120. #define SR_IDLETIME 2 // 2 minutes
  121. // thresholds and targets
  122. #define THRESHOLD_FIFO_PERCENT 90
  123. #define TARGET_FIFO_PERCENT 75
  124. #define THRESHOLD_FIFO_DISKSPACE 80 // in MB
  125. #define THRESHOLD_FREEZE_DISKSPACE 50 // in MB
  126. #define THRESHOLD_RESTORE_DISKSPACE 60 // in MB
  127. #define THRESHOLD_UI_DISKSPACE 80 // in MB
  128. #define THRESHOLD_THAW_DISKSPACE 200 // in MB
  129. #define MEGABYTE (1024 * 1024)
  130. #define GUID_STRLEN 50
  131. #define MAX_MOUNTPOINT_PATH 100
  132. // test messages
  133. static LPCWSTR s_cszTM_Freeze = L"SRTMFreeze";
  134. static LPCWSTR s_cszTM_Thaw = L"SRTMThaw";
  135. static LPCWSTR s_cszTM_Fifo = L"SRTMFifo";
  136. static LPCWSTR s_cszTM_FifoStart = L"SRTMFifoStart";
  137. static LPCWSTR s_cszTM_FifoStop = L"SRTMFifoStop";
  138. static LPCWSTR s_cszTM_Enable = L"SRTMEnable";
  139. static LPCWSTR s_cszTM_Disable = L"SRTMDisable";
  140. static LPCWSTR s_cszTM_CompressStart = L"SRTMCompressStart";
  141. static LPCWSTR s_cszTM_CompressStop = L"SRTMCompressStop";
  142. static LPCWSTR s_cszUserPrefix = L"_REGISTRY_USER_";
  143. static LPCWSTR s_cszHKLMFilePrefix = L"_REGISTRY_MACHINE_";
  144. static LPCWSTR s_cszSystemHiveName = L"SYSTEM";
  145. static LPCWSTR s_cszSoftwareHiveName = L"SOFTWARE";
  146. static LPCWSTR s_cszSamHiveName = L"SAM";
  147. static LPCWSTR s_cszSecurityHiveName = L"SECURITY";
  148. static LPCWSTR s_cszRegHiveCopySuffix = L"_PerRestoreCopy";
  149. static LPCWSTR s_cszRegReplaceBackupSuffix = L"_RegReplaceBak";
  150. static LPCWSTR s_cszDRMKey1 = L"CLSID\\{8D8763AB-E93B-4812-964E-F04E0008FD50}";
  151. static LPCWSTR s_cszDRMKey2 = L"CLSID\\{3DA165B6-CC41-11d2-BDC6-00C04F79EC6B}";
  152. static LPCWSTR s_cszRemoteAssistanceKey = L"Microsoft\\Remote Desktop";
  153. static LPCWSTR s_cszPasswordHints = L"Microsoft\\Windows\\CurrentVersion\\Hints";
  154. static LPCWSTR s_cszContentAdvisor= L"Microsoft\\Windows\\CurrentVersion\\Policies\\Ratings";
  155. static LPCWSTR s_cszWPAKey = L"System\\WPA";
  156. static LPCWSTR s_cszWPAKeyRelative = L"WPA";
  157. static LPCWSTR s_cszDRMKeyBackupFile = L"DRMData";
  158. static LPCWSTR s_cszMachineSecret = L"$machine.acc";
  159. static LPCWSTR s_cszAutologonSecret = L"DefaultPassword";
  160. static LPCWSTR s_cszRestoreSAMHiveName = L"SAM_Restore";
  161. static LPCWSTR s_cszRestoreSYSTEMHiveName = L"SYSTEM_Restore";
  162. static LPCWSTR s_cszRestoreSECURITYHiveName = L"SECURITY_Restore";
  163. #define SNAPSHOT_DIR_NAME L"\\snapshot"
  164. #define SRREG_VAL_MOVEFILEEX L"PendingFileRenameOperations"
  165. #define SRREG_PATH_SHELL L"Software\\Microsoft\\Windows NT\\CurrentVersion\\SystemRestore\\Shell"
  166. #define SRREG_PATH_SESSIONMGR L"System\\CurrentControlSet\\Control\\Session Manager"
  167. #define SRREG_VAL_DEBUGTESTUNDO L"DebugTestUndo"
  168. #define VOLUMENAME_FORMAT L"\\\\?\\"
  169. #define CLSNAME_RSTRSHELL L"PCHShell Window"
  170. #endif