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.

200 lines
9.5 KiB

  1. //--------------------------------------------------------------------
  2. // W32TmConsts - header
  3. // Copyright (C) Microsoft Corporation, 2000
  4. //
  5. // Created by: Louis Thomas (louisth), 6-15-00
  6. //
  7. // Numeric and string semi-public constants
  8. //
  9. #ifndef W32TMCONSTS_H
  10. #define W32TMCONSTS_H
  11. //--------------------------------------------------------------------
  12. // useful common definitions
  13. //#define MODULEPRIVATE static // so statics show up in VC
  14. #define MODULEPRIVATE // statics don't show up in ntsd either!
  15. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  16. //--------------------------------------------------------------------
  17. // registry entries for the time service
  18. #define wszW32TimeRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\Config"
  19. #define wszW32TimeRegKeyPolicyConfig L"Software\\Policies\\Microsoft\\W32Time\\Config"
  20. #define wszW32TimeRegValuePhaseCorrectRate L"PhaseCorrectRate"
  21. #define wszW32TimeRegValueUpdateInterval L"UpdateInterval"
  22. #define wszW32TimeRegValueLastClockRate L"LastClockRate"
  23. #define wszW32TimeRegValueFrequencyCorrectRate L"FrequencyCorrectRate"
  24. #define wszW32TimeRegValuePollAdjustFactor L"PollAdjustFactor"
  25. #define wszW32TimeRegValueLargePhaseOffset L"LargePhaseOffset"
  26. #define wszW32TimeRegValueSpikeWatchPeriod L"SpikeWatchPeriod"
  27. #define wszW32TimeRegValueHoldPeriod L"HoldPeriod"
  28. #define wszW32TimeRegValueMinPollInterval L"MinPollInterval"
  29. #define wszW32TimeRegValueMaxPollInterval L"MaxPollInterval"
  30. #define wszW32TimeRegValueMinClockRate L"MinClockRate"
  31. #define wszW32TimeRegValueMaxClockRate L"MaxClockRate"
  32. #define wszW32TimeRegValueAnnounceFlags L"AnnounceFlags"
  33. #define wszW32TimeRegValueLocalClockDispersion L"LocalClockDispersion"
  34. #define wszW32TimeRegValueMaxNegPhaseCorrection L"MaxNegPhaseCorrection"
  35. #define wszW32TimeRegValueMaxPosPhaseCorrection L"MaxPosPhaseCorrection"
  36. #define wszW32TimeRegValueEventLogFlags L"EventLogFlags"
  37. #define wszW32TimeRegValueMaxAllowedPhaseOffset L"MaxAllowedPhaseOffset"
  38. //--------------------------------------------------------------------------------
  39. // W2K registry entries
  40. #define wszW2KRegValueAdj L"Adj"
  41. #define wszW2KRegValueAvoidTimeSyncOnWan L"AvoidTimeSyncOnWan"
  42. #define wszW2KRegValueGetDcMaxBackoffTimes L"GetDcMaxBackoffTimes"
  43. #define wszW2KRegValueGetDcBackoffMinutes L"DcBackoffMinutes"
  44. #define wszW2KRegValueLocalNTP L"LocalNTP"
  45. #define wszW2KRegValueMsSkewPerDay L"MsSkewPerDay"
  46. #define wszW2KRegValuePeriod L"Period"
  47. #define wszW2KRegValueReliableTimeSource L"ReliableTimeSource"
  48. // announce flags
  49. #define Timeserv_Announce_No 0x00
  50. #define Timeserv_Announce_Yes 0x01
  51. #define Timeserv_Announce_Auto 0x02
  52. #define Timeserv_Announce_Mask 0x03
  53. #define Reliable_Timeserv_Announce_No 0x00
  54. #define Reliable_Timeserv_Announce_Yes 0x04
  55. #define Reliable_Timeserv_Announce_Auto 0x08
  56. #define Reliable_Timeserv_Announce_Mask 0x0C
  57. // event log flags
  58. #define EvtLog_TimeJump 0x01
  59. #define EvtLog_SourceChange 0x02
  60. #define EvtLog_SourceNone 0x03
  61. // phase correction constants:
  62. #define PhaseCorrect_ANY 0xFFFFFFFF
  63. //--------------------------------------------------------------------
  64. // RPC constants
  65. // Note that \pipe\ntsvcs and \pipe\w32time used to be
  66. // aliased in HKLM\Services\CurrentControlSet\Services\Npfs\Aliases
  67. // serivces.exe owned these. Now, we own it and live in svchost.
  68. #define wszW32TimeSharedProcRpcEndpointName L"W32TIME"
  69. #define wszW32TimeOwnProcRpcEndpointName L"W32TIME_ALT"
  70. //--------------------------------------------------------------------
  71. // service and dll constants
  72. #define wszDLLNAME L"w32time"
  73. #define wszSERVICENAME L"w32time"
  74. #define wszSERVICECOMMAND L"%SystemRoot%\\system32\\svchost.exe -k netsvcs" //L"w32tm.exe -service"
  75. #define wszSERVICEDISPLAYNAME L"Windows Time"
  76. #define wszSERVICEDESCRIPTION L"Maintains date and time synchronization on all clients and servers in the network. If this service is stopped, date and time synchronization will be unavailable. If this service is disabled, any services that explicitly depend on it will fail to start."
  77. #define wszSERVICEACCOUNTNAME L"LocalSystem"
  78. // registry entries for the service
  79. #define wszW32TimeRegKeyEventlog L"System\\CurrentControlSet\\Services\\Eventlog\\System\\W32Time"
  80. #define wszW32TimeRegKeyRoot L"System\\CurrentControlSet\\Services\\W32Time"
  81. #define wszW32TimeRegKeyParameters L"System\\CurrentControlSet\\Services\\W32Time\\Parameters"
  82. #define wszW32TimeRegKeyPolicyParameters L"Software\\Policies\\Microsoft\\W32Time\\Parameters"
  83. #define wszW32TimeRegValueServiceDll L"ServiceDll"
  84. // parameters for the time service:
  85. #define wszW32TimeRegValueSpecialType L"SpecialType"
  86. #define wszW32TimeRegValueType L"Type"
  87. #define wszW32TimeRegValueNtpServer L"NtpServer"
  88. // Possible values for "Type"
  89. #define W32TM_Type_NT5DS L"NT5DS"
  90. #define W32TM_Type_NTP L"NTP"
  91. #define W32TM_Type_NoSync L"NoSync"
  92. #define W32TM_Type_AllSync L"AllSync"
  93. // Default value for "NtpServer"
  94. #define W32TM_NtpServer_Default L"time.windows.com,0x1"
  95. // defined in timeprov.h:
  96. // wszW32TimeRegKeyTimeProviders
  97. // wszW32TimeRegValueInputProvider
  98. // wszW32TimeRegValueDllName
  99. // wszW32TimeRegValueEnabled
  100. //--------------------------------------------------------------------
  101. // values for ProvDispatch
  102. #define wszNTPCLIENTPROVIDERNAME L"NtpClient"
  103. #define wszNTPSERVERPROVIDERNAME L"NtpServer"
  104. //--------------------------------------------------------------------
  105. // registry entries for NtpClient
  106. #define wszNtpClientRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\TimeProviders\\NtpClient"
  107. #define wszNtpClientRegKeyPolicyConfig L"Software\\Policies\\Microsoft\\W32Time\\TimeProviders\\NtpClient"
  108. #define wszNtpClientRegValueSyncFromFlags L"SyncFromFlags"
  109. #define wszNtpClientRegValueManualPeerList L"ManualPeerList"
  110. #define wszNtpClientRegValueCrossSiteSyncFlags L"CrossSiteSyncFlags"
  111. #define wszNtpClientRegValueAllowNonstandardModeCombinations L"AllowNonstandardModeCombinations"
  112. #define wszNtpClientRegValueResolvePeerBackoffMinutes L"ResolvePeerBackoffMinutes"
  113. #define wszNtpClientRegValueResolvePeerBackoffMaxTimes L"ResolvePeerBackoffMaxTimes"
  114. #define wszNtpClientRegValueCompatibilityFlags L"CompatibilityFlags"
  115. #define wszNtpClientRegValueSpecialPollInterval L"SpecialPollInterval"
  116. #define wszNtpClientRegValueEventLogFlags L"EventLogFlags"
  117. #define wszNtpClientRegValueSpecialPollTimeRemaining L"SpecialPollTimeRemaining"
  118. #define wszNtpClientRegValueLargeSampleSkew L"LargeSampleSkew"
  119. // registry entries for NtpServer
  120. #define wszNtpServerRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\TimeProviders\\NtpServer"
  121. #define wszNtpServerRegKeyPolicyConfig L"Software\\Policies\\Microsoft\\W32Time\\TimeProviders\\NtpServer"
  122. #define wszNtpServerRegValueAllowNonstandardModeCombinations L"AllowNonstandardModeCombinations"
  123. // sync sources - NtpClientSourceFlag
  124. #define NCSF_NoSync 0x00
  125. #define NCSF_ManualPeerList 0x01
  126. #define NCSF_DomainHierarchy 0x02
  127. #define NCSF_ManualAndDomhier 0x03
  128. #define NCSF_DynamicPeers 0x04
  129. #define NCSF_BroadcastPeers 0x08
  130. // cross site sync flags
  131. #define NCCSS_None 0x00
  132. #define NCCSS_PdcOnly 0x01
  133. #define NCCSS_All 0x02
  134. // compatibility flags
  135. #define NCCF_DispersionInvalid 0x00000001
  136. #define NCCF_IgnoreFutureRefTimeStamp 0x00000002
  137. #define NCCF_AutodetectWin2K 0x80000000
  138. #define NCCF_AutodetectWin2KStage2 0x40000000
  139. // Manual flags
  140. #define NCMF_UseSpecialPollInterval 0x00000001
  141. #define NCMF_UseAsFallbackOnly 0x00000002
  142. #define NCMF_SymmetricActive 0x00000004
  143. #define NCMF_Client 0x00000008
  144. #define NCMF_BroadcastClient 0x00000010 // NYI
  145. #define NCMF_AssociationModeMask 0x0000000c // NOTE: broadcast NYI
  146. // event log flags
  147. #define NCELF_LogReachabilityChanges 0x00000001
  148. #define NCELF_LogIfSampleHasLargeSkew 0x00000002
  149. //--------------------------------------------------------------------
  150. // registry entries for the file log
  151. #define wszFileLogRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\Config"
  152. #define wszFileLogRegValueFileLogEntries L"FileLogEntries"
  153. #define wszFileLogRegValueFileLogName L"FileLogName"
  154. #define wszFileLogRegValueFileLogFlags L"FileLogFlags"
  155. #define wszFileLogRegValueFileLogSize L"FileLogSize"
  156. // format flags
  157. #define FL_HumanReadableTimestamps 0x00000000
  158. #define FL_NTTimeEpochTimestamps 0x00000001
  159. //--------------------------------------------------------------------
  160. // flags passed to W32TimeDcPromo
  161. #define W32TIME_PROMOTE 0x00000001
  162. #define W32TIME_DEMOTE 0x00000002
  163. #define W32TIME_PROMOTE_FIRST_DC_IN_TREE 0x00000004
  164. #define W32TIME_DEMOTE_LAST_DC_IN_DOMAIN 0x00000008
  165. //--------------------------------------------------------------------
  166. //
  167. #define wszW32TimeAuthType L"NT5 Digest"
  168. #endif //W32TMCONSTS_H