1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
5 using System
.Runtime
.CompilerServices
;
6 using System
.Runtime
.InteropServices
;
10 public readonly partial struct DateTime
12 private static unsafe bool SystemSupportsLeapSeconds()
14 Interop
.Kernel32
.PROCESS_LEAP_SECOND_INFO info
;
16 // Store apps don't have access to an API that would let us find out whether leap seconds have been
17 // disabled by policy: this implementation will produce slightly different results from what
18 // we have for Win32. If GetProcessInformation succeeds, we have to act as if leap seconds existed.
19 // They could still have been disabled by policy, but we have no way to check for that.
20 return Interop
.Kernel32
.GetProcessInformation(
21 Interop
.Kernel32
.GetCurrentProcess(),
22 Interop
.Kernel32
.ProcessLeapSecondInfo
,
24 sizeof(Interop
.Kernel32
.PROCESS_LEAP_SECOND_INFO
)) != Interop
.BOOL
.FALSE
;