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.

186 lines
8.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. // announce flags
  39. #define Timeserv_Announce_No 0x00
  40. #define Timeserv_Announce_Yes 0x01
  41. #define Timeserv_Announce_Auto 0x02
  42. #define Timeserv_Announce_Mask 0x03
  43. #define Reliable_Timeserv_Announce_No 0x00
  44. #define Reliable_Timeserv_Announce_Yes 0x04
  45. #define Reliable_Timeserv_Announce_Auto 0x08
  46. #define Reliable_Timeserv_Announce_Mask 0x0C
  47. // event log flags
  48. #define EvtLog_TimeJump 0x01
  49. #define EvtLog_SourceChange 0x02
  50. #define EvtLog_SourceNone 0x03
  51. // phase correction constants:
  52. #define PhaseCorrect_ANY 0xFFFFFFFF
  53. //--------------------------------------------------------------------
  54. // RPC constants
  55. // Note that \pipe\ntsvcs and \pipe\w32time used to be
  56. // aliased in HKLM\Services\CurrentControlSet\Services\Npfs\Aliases
  57. // serivces.exe owned these. Now, we own it and live in svchost.
  58. #define wszW32TimeSharedProcRpcEndpointName L"W32TIME"
  59. #define wszW32TimeOwnProcRpcEndpointName L"W32TIME_ALT"
  60. //--------------------------------------------------------------------
  61. // service and dll constants
  62. #define wszDLLNAME L"w32time"
  63. #define wszSERVICENAME L"w32time"
  64. #define wszSERVICECOMMAND L"%SystemRoot%\\system32\\svchost.exe -k netsvcs" //L"w32tm.exe -service"
  65. #define wszSERVICEDISPLAYNAME L"Windows Time"
  66. #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."
  67. #define wszSERVICEACCOUNTNAME L"LocalSystem"
  68. // registry entries for the service
  69. #define wszW32TimeRegKeyEventlog L"System\\CurrentControlSet\\Services\\Eventlog\\System\\W32Time"
  70. #define wszW32TimeRegKeyRoot L"System\\CurrentControlSet\\Services\\W32Time"
  71. #define wszW32TimeRegKeyParameters L"System\\CurrentControlSet\\Services\\W32Time\\Parameters"
  72. #define wszW32TimeRegKeyPolicyParameters L"Software\\Policies\\Microsoft\\W32Time\\Parameters"
  73. #define wszW32TimeRegValueServiceDll L"ServiceDll"
  74. // parameters for the time service:
  75. #define wszW32TimeRegValueSpecialType L"SpecialType"
  76. #define wszW32TimeRegValueType L"Type"
  77. #define wszW32TimeRegValueNtpServer L"NtpServer"
  78. // Possible values for "Type"
  79. #define W32TM_Type_NT5DS L"NT5DS"
  80. #define W32TM_Type_NTP L"NTP"
  81. #define W32TM_Type_NoSync L"NoSync"
  82. #define W32TM_Type_AllSync L"AllSync"
  83. // Default value for "NtpServer"
  84. #define W32TM_NtpServer_Default L"time.windows.com,0x1"
  85. // defined in timeprov.h:
  86. // wszW32TimeRegKeyTimeProviders
  87. // wszW32TimeRegValueInputProvider
  88. // wszW32TimeRegValueDllName
  89. // wszW32TimeRegValueEnabled
  90. //--------------------------------------------------------------------
  91. // values for ProvDispatch
  92. #define wszNTPCLIENTPROVIDERNAME L"NtpClient"
  93. #define wszNTPSERVERPROVIDERNAME L"NtpServer"
  94. //--------------------------------------------------------------------
  95. // registry entries for NtpClient
  96. #define wszNtpClientRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\TimeProviders\\NtpClient"
  97. #define wszNtpClientRegKeyPolicyConfig L"Software\\Policies\\Microsoft\\W32Time\\TimeProviders\\NtpClient"
  98. #define wszNtpClientRegValueSyncFromFlags L"SyncFromFlags"
  99. #define wszNtpClientRegValueManualPeerList L"ManualPeerList"
  100. #define wszNtpClientRegValueCrossSiteSyncFlags L"CrossSiteSyncFlags"
  101. #define wszNtpClientRegValueAllowNonstandardModeCombinations L"AllowNonstandardModeCombinations"
  102. #define wszNtpClientRegValueResolvePeerBackoffMinutes L"ResolvePeerBackoffMinutes"
  103. #define wszNtpClientRegValueResolvePeerBackoffMaxTimes L"ResolvePeerBackoffMaxTimes"
  104. #define wszNtpClientRegValueCompatibilityFlags L"CompatibilityFlags"
  105. #define wszNtpClientRegValueSpecialPollInterval L"SpecialPollInterval"
  106. #define wszNtpClientRegValueEventLogFlags L"EventLogFlags"
  107. #define wszNtpClientRegValueSpecialPollTimeRemaining L"SpecialPollTimeRemaining"
  108. // registry entries for NtpServer
  109. #define wszNtpServerRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\TimeProviders\\NtpServer"
  110. #define wszNtpServerRegKeyPolicyConfig L"Software\\Policies\\Microsoft\\W32Time\\TimeProviders\\NtpServer"
  111. #define wszNtpServerRegValueAllowNonstandardModeCombinations L"AllowNonstandardModeCombinations"
  112. // sync sources - NtpClientSourceFlag
  113. #define NCSF_NoSync 0x00
  114. #define NCSF_ManualPeerList 0x01
  115. #define NCSF_DomainHierarchy 0x02
  116. #define NCSF_ManualAndDomhier 0x03
  117. #define NCSF_DynamicPeers 0x04
  118. #define NCSF_BroadcastPeers 0x08
  119. // cross site sync flags
  120. #define NCCSS_None 0x00
  121. #define NCCSS_PdcOnly 0x01
  122. #define NCCSS_All 0x02
  123. // compatibility flags
  124. #define NCCF_DispersionInvalid 0x00000001
  125. #define NCCF_IgnoreFutureRefTimeStamp 0x00000002
  126. #define NCCF_AutodetectWin2K 0x80000000
  127. #define NCCF_AutodetectWin2KStage2 0x40000000
  128. // Manual flags
  129. #define NCMF_UseSpecialPollInterval 0x00000001
  130. #define NCMF_UseAsFallbackOnly 0x00000002
  131. #define NCMF_SymmetricActive 0x00000004
  132. #define NCMF_Client 0x00000008
  133. #define NCMF_BroadcastClient 0x00000010 // NYI
  134. #define NCMF_AssociationModeMask 0x0000000c // NOTE: broadcast NYI
  135. // event log flags
  136. #define NCELF_LogReachabilityChanges 0x00000001
  137. //--------------------------------------------------------------------
  138. // registry entries for the file log
  139. #define wszFileLogRegKeyConfig L"System\\CurrentControlSet\\Services\\W32Time\\Config"
  140. #define wszFileLogRegValueFileLogEntries L"FileLogEntries"
  141. #define wszFileLogRegValueFileLogName L"FileLogName"
  142. #define wszFileLogRegValueFileLogFlags L"FileLogFlags"
  143. #define wszFileLogRegValueFileLogSize L"FileLogSize"
  144. // format flags
  145. #define FL_HumanReadableTimestamps 0x00000000
  146. #define FL_NTTimeEpochTimestamps 0x00000001
  147. //--------------------------------------------------------------------
  148. // flags passed to W32TimeDcPromo
  149. #define W32TIME_PROMOTE 0x00000001
  150. #define W32TIME_DEMOTE 0x00000002
  151. #define W32TIME_PROMOTE_FIRST_DC_IN_TREE 0x00000004
  152. //--------------------------------------------------------------------
  153. //
  154. #define wszW32TimeAuthType L"NT5 Digest"
  155. #endif //W32TMCONSTS_H