-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,9 @@ See the LICENSE file in the project root for more information. | |
<FullRuntimeName>Runtime</FullRuntimeName> | ||
<FullRuntimeName Condition="'$(ServerGarbageCollection)' != ''">Runtime.ServerGC</FullRuntimeName> | ||
</PropertyGroup> | ||
|
||
<!-- Part of workaround for lack of secondary build artifact import - https://github.com/Microsoft/msbuild/issues/2807 --> | ||
<!-- Ensure that runtime-specific paths have already been set --> | ||
<!-- Ensure that runtime-specific paths have already been set --> | ||
<Target Name="SetupOSSpecificProps" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)"> | ||
<ItemGroup> | ||
<CppCompilerAndLinkerArg Include="/I$(IlcPath)\inc" /> | ||
|
@@ -47,9 +47,10 @@ See the LICENSE file in the project root for more information. | |
<NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)\sdk\PortableRuntime.lib" /> | ||
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true' and $(NativeCodeGen) == ''" Include="$(SharedLibrary)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<NativeLibrary Include="kernel32.lib" /> | ||
<NativeLibrary Include="ntdll.lib" /> | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
tarekgh
Author
Owner
|
||
<NativeLibrary Include="user32.lib" /> | ||
<NativeLibrary Include="gdi32.lib" /> | ||
<NativeLibrary Include="winspool.lib" /> | ||
|
@@ -62,7 +63,7 @@ See the LICENSE file in the project root for more information. | |
<NativeLibrary Include="bcrypt.lib" /> | ||
<NativeLibrary Include="normaliz.lib" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<LinkerArg Condition="$(NativeLib) == 'Shared'" Include="/DLL" /> | ||
<LinkerArg Include="@(NativeLibrary->'"%(Identity)"')" /> | ||
|
@@ -71,11 +72,11 @@ See the LICENSE file in the project root for more information. | |
<LinkerArg Include="/INCREMENTAL:NO" /> | ||
<LinkerArg Condition="'$(OutputType)' == 'WinExe'" Include="/SUBSYSTEM:WINDOWS /ENTRY:wmainCRTStartup" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<!-- TODO <LinkerArg Include="/MACHINE:X64" /> --> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(Configuration)' != 'Debug'"> | ||
<LinkerArg Include="/OPT:REF" /> | ||
<LinkerArg Include="/OPT:ICF" /> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class NtDll | ||
{ | ||
[DllImport(Libraries.NtDll, SetLastError = true)] | ||
This comment has been minimized.
Sorry, something went wrong.
jkotas
|
||
internal static unsafe extern int NtQuerySystemInformation(int SystemInformationClass, void* SystemInformation, int SystemInformationLength, IntPtr ReturnLength); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct SYSTEM_LEAP_SECOND_INFORMATION | ||
{ | ||
public bool Enabled; | ||
public uint Flags; | ||
} | ||
|
||
internal const int SystemLeapSecondInformation = 206; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
[DllImport(Libraries.Kernel32, SetLastError = true)] | ||
This comment has been minimized.
Sorry, something went wrong.
jkotas
|
||
internal static unsafe extern bool FileTimeToSystemTime(ref long lpFileTime, ref FullSystemTime lpSystemTime); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
// FullSystemTime struct matches Windows SYSTEMTIME struct, except we added the extra nanoSeconds field to store | ||
// more precise time. | ||
[StructLayout(LayoutKind.Sequential)] | ||
internal struct FullSystemTime | ||
{ | ||
internal FullSystemTime(int year, int month, DayOfWeek dayOfWeek, int day, int hour, int minute, int second) | ||
{ | ||
wYear = (ushort) year; | ||
wMonth = (ushort) month; | ||
wDayOfWeek = (ushort) dayOfWeek; | ||
wDay = (ushort) day; | ||
wHour = (ushort) hour; | ||
wMinute = (ushort) minute; | ||
wSecond = (ushort) second; | ||
wMillisecond = 0; | ||
hundredNanoSecond = 0; | ||
} | ||
|
||
internal FullSystemTime(long ticks) | ||
{ | ||
DateTime dt = new DateTime(ticks); | ||
|
||
int year, month, day; | ||
dt.GetDatePart(out year, out month, out day); | ||
|
||
wYear = (ushort) year; | ||
wMonth = (ushort) month; | ||
wDayOfWeek = (ushort) dt.DayOfWeek; | ||
wDay = (ushort) day; | ||
wHour = (ushort) dt.Hour; | ||
wMinute = (ushort) dt.Minute; | ||
wSecond = (ushort) dt.Second; | ||
wMillisecond = (ushort) dt.Millisecond; | ||
hundredNanoSecond = 0; | ||
} | ||
|
||
internal ushort wYear; | ||
internal ushort wMonth; | ||
internal ushort wDayOfWeek; | ||
internal ushort wDay; | ||
internal ushort wHour; | ||
internal ushort wMinute; | ||
internal ushort wSecond; | ||
internal ushort wMillisecond; | ||
internal long hundredNanoSecond; | ||
}; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
internal const int ProcessLeapSecondInfo = 8; | ||
|
||
[DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true)] | ||
internal static extern bool GetProcessInformation(IntPtr hProcess, int ProcessInformationClass, ref long processInformation, int ProcessInformationSize); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
[DllImport(Libraries.Kernel32, SetLastError = true)] | ||
internal static unsafe extern void GetSystemTime(ref FullSystemTime lpSystemTime); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
// api-ms-win-core-timezone-l1-1-0.dll | ||
[DllImport(Libraries.Kernel32, SetLastError = true)] | ||
internal static extern bool SystemTimeToFileTime(ref FullSystemTime lpSystemTime, out long lpFileTime); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Runtime.InteropServices; | ||
|
||
internal partial class Interop | ||
{ | ||
internal partial class Kernel32 | ||
{ | ||
[DllImport(Libraries.Kernel32, SetLastError = true)] | ||
internal static extern bool TzSpecificLocalTimeToSystemTime(IntPtr lpTimeZoneInformation, ref FullSystemTime lpLocalTime, ref FullSystemTime lpUniversalTime); | ||
} | ||
} |
Does this actually work?
The docs for https://docs.microsoft.com/en-us/windows/desktop/api/winternl/nf-winternl-ntquerysysteminformation say "This function has no associated import library.".