Fix pragma warning restore (dotnet/coreclr#26389)
[mono-project.git] / netcore / System.Private.CoreLib / shared / System / DateTime.WinRT.cs
blob30a9a61aa3da4d04abe9431b4d0b4e4f9357384a
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;
8 namespace System
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,
23 &info,
24 sizeof(Interop.Kernel32.PROCESS_LEAP_SECOND_INFO)) != Interop.BOOL.FALSE;