Imported Upstream version 5.20.0.180

Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-02-04 20:11:37 +00:00
parent 0e2d47d1c8
commit 0510252385
3360 changed files with 83827 additions and 39243 deletions

View File

@@ -53,6 +53,10 @@
<!-- Fail with descriptive error message for common mistake. -->
<Error Condition="'$(RuntimeIdentifier)' == ''" Text="RuntimeIdentifier is required for native compilation. Try running dotnet publish with the -r option value specified." />
<!-- Fail with descriptive error message for common unsupported case. -->
<Error Condition="'$(OS)' == 'Windows_NT' and !$(RuntimeIdentifier.StartsWith('win'))" Text="Cross-compilation is not supported yet. https://github.com/dotnet/corert/issues/5458" />
<Error Condition="'$(OS)' != 'Windows_NT' and $(RuntimeIdentifier.StartsWith('win'))" Text="Cross-compilation is not supported yet. https://github.com/dotnet/corert/issues/5458" />
<!-- CoreRT SDK and Framework Assemblies need to be defined to avoid CoreCLR implementations being set as compiler inputs -->
<Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
<Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
@@ -66,4 +70,10 @@
</Target>
<Target Name="CopyNativePdb" Condition="'$(DebugType)' != 'None' and '$(TargetOS)' == 'Windows_NT'" AfterTargets="Publish">
<!-- dotnet CLI produces managed debug symbols - substitute with those we generated during native compilation -->
<Delete Files="$(PublishDir)\$(TargetName).pdb"/>
<Copy SourceFiles="$(NativeOutputPath)$(TargetName).pdb" DestinationFolder="$(PublishDir)" />
</Target>
</Project>

View File

@@ -36,6 +36,8 @@ See the LICENSE file in the project root for more information.
<PropertyGroup>
<NativeLibraryExtension Condition="'$(NativeCodeGen)' != 'wasm'">.a</NativeLibraryExtension>
<NativeLibraryExtension Condition="'$(NativeCodeGen)' == 'wasm'">.bc</NativeLibraryExtension>
<FullRuntimeName>libRuntime</FullRuntimeName>
<FullRuntimeName Condition="'$(ServerGarbageCollection)' != ''">libRuntime.ServerGC</FullRuntimeName>
</PropertyGroup>
<ItemGroup>
@@ -50,7 +52,7 @@ See the LICENSE file in the project root for more information.
<NativeLibrary Condition="'$(IlcMultiModule)' == 'true' and $(NativeCodeGen) == ''" Include="$(SharedLibrary)" />
<NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) == ''" Include="$(IlcPath)/sdk/libbootstrapper.a" />
<NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) != ''" Include="$(IlcPath)/sdk/libbootstrapperdll.a" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/libRuntime.a" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/$(FullRuntimeName).a" />
<NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)/sdk/libbootstrappercpp.a" />
<NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)/sdk/libPortableRuntime.a" />
<NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)/sdk/libbootstrappercpp.bc" />
@@ -59,6 +61,7 @@ See the LICENSE file in the project root for more information.
<ItemGroup>
<NativeLibrary Include="$(IlcPath)/sdk/libSystem.Private.CoreLib.Native$(NativeLibraryExtension)" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)/sdk/libSystem.Private.TypeLoader.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.Globalization.Native$(NativeLibraryExtension)" />
<NativeLibrary Include="$(IlcPath)/framework/System.IO.Compression.Native$(NativeLibraryExtension)" />
@@ -71,26 +74,28 @@ See the LICENSE file in the project root for more information.
<ItemGroup Condition="'$(TargetOS)' == 'OSX'">
<NativeFramework Include="CoreFoundation" />
<NativeFramework Include="Security" />
<NativeFramework Include="GSS" />
</ItemGroup>
<ItemGroup>
<LinkerArg Include="@(NativeLibrary)" />
<LinkerArg Include="-g" />
<LinkerArg Include="-Wl,-rpath,'$ORIGIN'" />
<LinkerArg Include="-Wl,--as-needed" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-pthread" />
<LinkerArg Include="-lstdc++" />
<LinkerArg Include="-ldl" />
<LinkerArg Include="-lm" />
<LinkerArg Include="-lcurl" />
<LinkerArg Include="-lz" />
<LinkerArg Include="-luuid" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-lgssapi_krb5" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-lrt" Condition="'$(TargetOS)' != 'OSX'" />
<LinkerArg Include="-licucore" Condition="'$(TargetOS)' == 'OSX'" />
<LinkerArg Include="-dynamiclib" Condition="'$(TargetOS)' == 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="-shared" Condition="'$(TargetOS)' != 'OSX' and '$(NativeLib)' == 'Shared'" />
<LinkerArg Include="@(NativeFramework->'-framework %(Identity)')" Condition="'$(TargetOS)' == 'OSX'" />
</ItemGroup>
<Exec Command="command -v $(CppLinker)" IgnoreExitCode="true">
<Output TaskParameter="ExitCode" PropertyName="_WhereLinker"/>
</Exec>

View File

@@ -18,6 +18,8 @@ See the LICENSE file in the project root for more information.
<CppCompiler>cl</CppCompiler>
<CppLinker>link</CppLinker>
<CppLibCreator>lib</CppLibCreator>
<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 -->
@@ -36,7 +38,9 @@ See the LICENSE file in the project root for more information.
<ItemGroup>
<NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) == ''" Include="$(IlcPath)\sdk\bootstrapper.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == '' and $(NativeLib) != ''" Include="$(IlcPath)\sdk\bootstrapperdll.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\Runtime.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\$(FullRuntimeName).lib" />
<NativeLibrary Condition="$(NativeCodeGen) == ''" Include="$(IlcPath)\sdk\System.Private.TypeLoader.Native.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == '' and '$(ExperimentalJitSupport)' == 'true'" Include="$(IlcPath)\sdk\System.Private.Jit.Native.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\bootstrappercpp.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == 'cpp'" Include="$(IlcPath)\sdk\PortableRuntime.lib" />
<NativeLibrary Condition="$(NativeCodeGen) == 'wasm'" Include="$(IlcPath)\sdk\bootstrappercpp.lib" />
@@ -61,10 +65,11 @@ See the LICENSE file in the project root for more information.
<ItemGroup>
<LinkerArg Condition="$(NativeLib) == 'Shared'" Include="/DLL" />
<LinkerArg Include="@(NativeLibrary)" />
<LinkerArg Include="@(NativeLibrary->'&quot;%(Identity)&quot;')" />
<LinkerArg Include="/NOLOGO /DEBUG /MANIFEST:NO" />
<!-- The runtime is not compatible with jump stubs inserted by incremental linking. -->
<LinkerArg Include="/INCREMENTAL:NO" />
<LinkerArg Condition="'$(OutputType)' == 'WinExe'" Include="/SUBSYSTEM:WINDOWS /ENTRY:wmainCRTStartup" />
</ItemGroup>
<ItemGroup>

View File

@@ -39,14 +39,15 @@ See the LICENSE file in the project root for more information.
<IlcOutputFileExt Condition="$(NativeCodeGen) == 'cpp'">.cpp</IlcOutputFileExt>
<IlcOutputFileExt Condition="'$(NativeCodeGen)' == 'wasm'">.bc</IlcOutputFileExt>
<IsNativeExecutable Condition="'$(OutputType)' == 'Exe' or '$(OutputType)' == 'WinExe'">true</IsNativeExecutable>
<NativeBinaryExt Condition="'$(OutputType)' == 'Exe' and '$(TargetOS)' == 'Windows_NT'">.exe</NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' == 'Exe' and '$(TargetOS)' != 'Windows_NT'"></NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Shared'">.dll</NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'OSX' and $(NativeLib) == 'Shared'">.dylib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' != 'Windows_NT' and '$(TargetOS)' != 'OSX' and $(NativeLib) == 'Shared'">.so</NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' != 'Windows_NT' and $(NativeLib) == 'Static'">.a</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(TargetOS)' == 'Windows_NT'">.exe</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' == 'true' and '$(TargetOS)' != 'Windows_NT'"></NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Shared'">.dll</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'OSX' and $(NativeLib) == 'Shared'">.dylib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'Windows_NT' and '$(TargetOS)' != 'OSX' and $(NativeLib) == 'Shared'">.so</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' == 'Windows_NT' and $(NativeLib) == 'Static'">.lib</NativeBinaryExt>
<NativeBinaryExt Condition="'$(IsNativeExecutable)' != 'true' and '$(TargetOS)' != 'Windows_NT' and $(NativeLib) == 'Static'">.a</NativeBinaryExt>
<NativeBinaryExt Condition="'$(NativeCodeGen)' == 'wasm'">.html</NativeBinaryExt>
<ExportsFileExt Condition="'$(OutputType)' != 'Exe' and '$(TargetOS)' == 'Windows_NT' and '$(NativeLib)' == 'Shared'">.def</ExportsFileExt>
@@ -66,6 +67,8 @@ See the LICENSE file in the project root for more information.
<FrameworkLibPath Condition="'$(FrameworkLibPath)' == ''">$(NativeOutputPath)</FrameworkLibPath>
<FrameworkObjPath Condition="'$(FrameworkObjPath)' == ''">$(NativeIntermediateOutputPath)</FrameworkObjPath>
<ExperimentalDynamicCodeSupport Condition="'$(ExperimentalInterpreterSupport)' == 'true' or '$(ExperimentalJitSupport)' == 'true'">true</ExperimentalDynamicCodeSupport>
<SharedLibrary Condition="'$(OS)' == 'Windows_NT'">$(FrameworkLibPath)\Framework$(LibFileExt)</SharedLibrary>
<SharedLibrary Condition="'$(OS)' != 'Windows_NT'">$(FrameworkLibPath)\libframework$(LibFileExt)</SharedLibrary>
<IlcDynamicBuildPropertyDependencies Condition="'$(IlcCalledViaPackage)' == 'true'">SetupProperties</IlcDynamicBuildPropertyDependencies>
@@ -77,11 +80,33 @@ See the LICENSE file in the project root for more information.
<IlcCompileDependsOn>$(IlcCompileDependsOn);SetupOSSpecificProps</IlcCompileDependsOn>
</PropertyGroup>
<ItemGroup>
<AutoInitializedAssemblies Include="System.Private.CoreLib" />
<AutoInitializedAssemblies Include="System.Private.DeveloperExperience.Console" />
<AutoInitializedAssemblies Condition="'$(ExperimentalInterpreterSupport)' == 'true'" Include="System.Private.Interpreter" />
<AutoInitializedAssemblies Condition="'$(ExperimentalJitSupport)' == 'true'" Include="System.Private.Jit" />
</ItemGroup>
<ItemGroup Condition="'$(ExperimentalDynamicCodeSupport)' != 'true'">
<AutoInitializedAssemblies Include="System.Private.StackTraceMetadata" />
<AutoInitializedAssemblies Include="System.Private.TypeLoader" />
<AutoInitializedAssemblies Include="System.Private.Reflection.Execution" />
<AutoInitializedAssemblies Include="System.Private.Interop" />
</ItemGroup>
<ItemGroup Condition="'$(ExperimentalDynamicCodeSupport)' == 'true'">
<AutoInitializedAssemblies Include="System.Private.StackTraceMetadata.Experimental" />
<AutoInitializedAssemblies Include="System.Private.TypeLoader.Experimental" />
<AutoInitializedAssemblies Include="System.Private.Reflection.Execution.Experimental" />
<AutoInitializedAssemblies Include="System.Private.Interop.Experimental" />
</ItemGroup>
<ItemGroup>
<PrivateSdkAssemblies Include="$(IlcPath)\sdk\*.dll" />
</ItemGroup>
<ItemGroup>
<FrameworkAssemblies Include="$(IlcPath)\framework\*.dll" />
<!-- Exclude clrcompression.dll for now https://github.com/dotnet/corert/issues/5496 -->
<FrameworkAssemblies Include="$(IlcPath)\framework\*.dll" Exclude="$(IlcPath)\framework\clrcompression.dll" />
</ItemGroup>
<ItemGroup>
@@ -159,6 +184,10 @@ See the LICENSE file in the project root for more information.
<IlcArg Condition="$(OutputType) == 'Library' and $(NativeLib) != ''" Include="--nativelib" />
<IlcArg Condition="$(ExportsFile) != ''" Include="--exportsfile:$(ExportsFile)" />
<ILcArg Condition="'$(Platform)' == 'wasm'" Include="--wasm" />
<ILcArg Condition="'$(ExperimentalDynamicCodeSupport)' == 'true'" Include="--nometadatablocking" />
<IlcArg Include="@(AutoInitializedAssemblies->'--initassembly:%(Identity)')" />
<IlcArg Include="@(AppContextSwitchOverrides->'--appcontextswitch:%(Identity)')" />
<IlcArg Condition="$(ServerGarbageCollection) != ''" Include="--runtimeopt:RH_UseServerGC=1" />
</ItemGroup>
<MakeDir Directories="$(NativeIntermediateOutputPath)" />
@@ -180,9 +209,9 @@ See the LICENSE file in the project root for more information.
DependsOnTargets="IlcCompile">
<ItemGroup>
<CompilerArg Include="$(IlcCompileOutput)" />
<CompilerArg Include="/Fo$(NativeObject)" Condition="'$(OS)' == 'Windows_NT'" />
<CompilerArg Include="-o $(NativeObject)" Condition="'$(OS)' != 'Windows_NT'" />
<CompilerArg Include="&quot;$(IlcCompileOutput)&quot;" />
<CompilerArg Include="/Fo&quot;$(NativeObject)&quot;" Condition="'$(OS)' == 'Windows_NT'" />
<CompilerArg Include="-o &quot;$(NativeObject)&quot;" Condition="'$(OS)' != 'Windows_NT'" />
<CompilerArg Include="@(CppCompilerAndLinkerArg)" />
</ItemGroup>
@@ -198,19 +227,19 @@ See the LICENSE file in the project root for more information.
DependsOnTargets="$(LinkNativeDependsOn)">
<ItemGroup>
<CustomLinkerArg Include="$(NativeObject)" />
<CustomLinkerArg Include="-o $(NativeBinary)" Condition="'$(OS)' != 'Windows_NT'" />
<CustomLinkerArg Include="/OUT:$(NativeBinary)" Condition="'$(OS)' == 'Windows_NT'" />
<CustomLinkerArg Include="/DEF:$(ExportsFile)" Condition="'$(OS)' == 'Windows_NT' and $(ExportsFile) != ''" />
<CustomLinkerArg Include="&quot;$(NativeObject)&quot;" />
<CustomLinkerArg Include="-o &quot;$(NativeBinary)&quot;" Condition="'$(OS)' != 'Windows_NT'" />
<CustomLinkerArg Include="/OUT:&quot;$(NativeBinary)&quot;" Condition="'$(OS)' == 'Windows_NT'" />
<CustomLinkerArg Include="/DEF:&quot;$(ExportsFile)&quot;" Condition="'$(OS)' == 'Windows_NT' and $(ExportsFile) != ''" />
<CustomLinkerArg Include="/LIBPATH:&quot;%(AdditionalNativeLibraryDirectories.Identity)&quot;" Condition="'$(OS)' == 'Windows_NT' and '@(AdditionalNativeLibraryDirectories->Count())' &gt; 0" />
<CustomLinkerArg Include="-exported_symbols_list $(ExportsFile)" Condition="'$(OS)' != 'Windows_NT' and $(ExportsFile) != ''" />
<CustomLinkerArg Include="-exported_symbols_list &quot;$(ExportsFile)&quot;" Condition="'$(OS)' != 'Windows_NT' and $(ExportsFile) != ''" />
<CustomLinkerArg Include="@(LinkerArg)" />
</ItemGroup>
<ItemGroup>
<CustomLibArg Include="-crs $(NativeBinary)" Condition="'$(OS)' != 'Windows_NT'" />
<CustomLibArg Include="/OUT:$(NativeBinary)" Condition="'$(OS)' == 'Windows_NT'" />
<CustomLibArg Include="$(NativeObject)" />
<CustomLibArg Include="-crs &quot;$(NativeBinary)&quot;" Condition="'$(OS)' != 'Windows_NT'" />
<CustomLibArg Include="/OUT:&quot;$(NativeBinary)&quot;" Condition="'$(OS)' == 'Windows_NT'" />
<CustomLibArg Include="&quot;$(NativeObject)&quot;" />
</ItemGroup>
<MakeDir Directories="$([System.IO.Path]::GetDirectoryName($(NativeBinary)))" />
@@ -224,8 +253,8 @@ See the LICENSE file in the project root for more information.
<Exec Command="$(CppLibCreator) @&quot;$(NativeIntermediateOutputPath)lib.rsp&quot;" Condition="'$(OS)' == 'Windows_NT' and '$(NativeLib)' == 'Static' and '$(NativeCodeGen)' != 'wasm'" />
<PropertyGroup>
<EmccArgs>&quot;$(NativeObject)&quot; -o &quot;$(NativeBinary)&quot; -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 </EmccArgs>
<EmccArgs Condition="'$(Platform)'=='wasm'">$(EmccArgs) &quot;$(IlcPath)/sdk/libPortableRuntime.bc&quot; &quot;$(IlcPath)/sdk/libbootstrappercpp.bc&quot; </EmccArgs>
<EmccArgs>&quot;$(NativeObject)&quot; -o &quot;$(NativeBinary)&quot; -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 --emrun </EmccArgs>
<EmccArgs Condition="'$(Platform)'=='wasm'">$(EmccArgs) &quot;$(IlcPath)/sdk/libPortableRuntime.bc&quot; &quot;$(IlcPath)/sdk/libbootstrappercpp.bc&quot; &quot;$(IlcPath)/sdk/libSystem.Private.CoreLib.Native.bc&quot; </EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Release'">$(EmccArgs) -O2 --llvm-lto 2</EmccArgs>
<EmccArgs Condition="'$(Configuration)'=='Debug'">$(EmccArgs) -g3</EmccArgs>
</PropertyGroup>

View File

@@ -644,7 +644,7 @@ class SchemaDef
new MemberDef("Flags", "GenericParameterAttributes"),
new MemberDef("Kind", "GenericParameterKind"),
new MemberDef("Name", "ConstantStringValue", MemberDefFlags.RecordRef | MemberDefFlags.Child),
new MemberDef("Constraints", TypeDefOrRefOrSpec, MemberDefFlags.List | MemberDefFlags.RecordRef | MemberDefFlags.EnumerateForHashCode),
new MemberDef("Constraints", TypeDefOrRefOrSpecOrMod, MemberDefFlags.List | MemberDefFlags.RecordRef | MemberDefFlags.EnumerateForHashCode),
new MemberDef("CustomAttributes", "CustomAttribute", MemberDefFlags.List | MemberDefFlags.RecordRef | MemberDefFlags.Child),
}
),

View File

@@ -1 +1 @@
f068f31f9511fd44c80c628a2a5951841d2da89c
9ade719703f737fcba7dd96fbbe06ff28d6363ac

View File

@@ -223,7 +223,7 @@ namespace Internal.NativeFormat
public NativeReader(byte* base_, uint size)
{
// Limit the maximum blob size to prevent buffer overruns triggered by boundary integer overflows
if (size >= UInt32.MaxValue / 4)
if (size >= uint.MaxValue / 4)
ThrowBadImageFormatException();
Debug.Assert(base_ <= base_ + size);

View File

@@ -121,7 +121,10 @@ namespace Internal.Runtime.CompilerHelpers
for (int i = 0; i < count; i++)
{
if (pModuleHeaders[i] != IntPtr.Zero)
modules[moduleIndex++] = RuntimeImports.RhpCreateTypeManager(osModule, pModuleHeaders[i], pClasslibFunctions, nClasslibFunctions);
{
modules[moduleIndex] = RuntimeImports.RhpCreateTypeManager(osModule, pModuleHeaders[i], pClasslibFunctions, nClasslibFunctions);
moduleIndex++;
}
}
return modules;
@@ -301,6 +304,6 @@ namespace Internal.Runtime.CompilerHelpers
internal unsafe struct TypeManagerSlot
{
public TypeManagerHandle TypeManager;
public Int32 ModuleIndex;
public int ModuleIndex;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -22,15 +22,15 @@ namespace Internal.Runtime
#pragma warning disable 0169
internal struct ReadyToRunHeader
{
private UInt32 Signature; // ReadyToRunHeaderConstants.Signature
private UInt16 MajorVersion;
private UInt16 MinorVersion;
private uint Signature; // ReadyToRunHeaderConstants.Signature
private ushort MajorVersion;
private ushort MinorVersion;
private UInt32 Flags;
private uint Flags;
private UInt16 NumberOfSections;
private Byte EntrySize;
private Byte EntryType;
private ushort NumberOfSections;
private byte EntrySize;
private byte EntryType;
// Array of sections follows.
};

View File

@@ -3,14 +3,13 @@
// See the LICENSE file in the project root for more information.
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal unsafe partial class Sys
{
[DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_CreateGuid")]
internal static extern void CreateGuid(out Guid guid);
[DllImport(Interop.Libraries.CoreLibNative, EntryPoint = "CoreLibNative_GetEnviron")]
internal static extern unsafe IntPtr GetEnviron();
}
}

View File

@@ -6,9 +6,6 @@ internal static partial class Interop
{
internal static partial class Libraries
{
internal const string CoreFile_L1 = "api-ms-win-core-file-l1-1-0.dll";
internal const string CoreFile_L1_2 = "api-ms-win-core-file-l1-2-0.dll";
internal const string CoreFile_L2 = "api-ms-win-core-file-l2-1-0.dll";
internal const string ErrorHandling = "api-ms-win-core-errorhandling-l1-1-0.dll";
internal const string Handle = "api-ms-win-core-handle-l1-1-0.dll";
internal const string IO = "api-ms-win-core-io-l1-1-0.dll";
@@ -17,7 +14,6 @@ internal static partial class Interop
internal const string ProcessThreads = "api-ms-win-core-processthreads-l1-1-0.dll";
internal const string RealTime = "api-ms-win-core-realtime-l1-1-0.dll";
internal const string SysInfo = "api-ms-win-core-sysinfo-l1-2-0.dll";
internal const string Registry_L1 = "api-ms-win-core-registry-l1-1-0.dll";
internal const string ThreadPool = "api-ms-win-core-threadpool-l1-2-0.dll";
internal const string Localization = "api-ms-win-core-localization-l1-2-1.dll";
}

View File

@@ -17,7 +17,7 @@ internal static partial class Interop
internal static extern IntPtr HeapAlloc(IntPtr hHeap, uint dwFlags, UIntPtr dwBytes);
[DllImport("api-ms-win-core-heap-l1-1-0.dll")]
internal static extern int HeapFree(IntPtr hHeap, UInt32 dwFlags, IntPtr lpMem);
internal static extern int HeapFree(IntPtr hHeap, uint dwFlags, IntPtr lpMem);
}
#if MULTIPLEX_OS

View File

@@ -11,7 +11,7 @@ internal static partial class Interop
internal static unsafe partial class mincore
{
[DllImport("api-ms-win-core-heap-l1-1-0.dll")]
internal static extern unsafe IntPtr HeapReAlloc(IntPtr hHeap, UInt32 dwFlags, IntPtr lpMem, UIntPtr dwBytes);
internal static extern unsafe IntPtr HeapReAlloc(IntPtr hHeap, uint dwFlags, IntPtr lpMem, UIntPtr dwBytes);
}
internal static unsafe IntPtr MemReAlloc(IntPtr ptr, UIntPtr newSize)

View File

@@ -10,39 +10,6 @@ internal static partial class Interop
{
internal static partial class mincore
{
[DllImport(Libraries.Kernel32, EntryPoint = "CreateEventExW", SetLastError = true, CharSet = CharSet.Unicode)]
internal extern static SafeWaitHandle CreateEventEx(IntPtr lpEventAttributes, string lpName, uint dwFlags, uint dwDesiredAccess);
[DllImport(Libraries.Kernel32, EntryPoint = "CreateSemaphoreExW", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern SafeWaitHandle CreateSemaphoreEx(IntPtr lpSemaphoreAttributes, int lInitialCount, int lMaximumCount, string lpName, uint dwFlags, uint dwDesiredAccess);
[DllImport(Libraries.Kernel32, EntryPoint = "CreateMutexExW", SetLastError = true, CharSet = CharSet.Unicode)]
internal extern static SafeWaitHandle CreateMutexEx(IntPtr lpMutexAttributes, string lpName, uint dwFlags, uint dwDesiredAccess);
[DllImport(Libraries.Kernel32, EntryPoint = "OpenEventW", SetLastError = true, CharSet = CharSet.Unicode)]
internal extern static SafeWaitHandle OpenEvent(uint dwDesiredAccess, bool bInheritHandle, string lpName);
[DllImport(Libraries.Kernel32, EntryPoint = "OpenSemaphoreW", SetLastError = true, CharSet = CharSet.Unicode)]
internal extern static SafeWaitHandle OpenSemaphore(uint dwDesiredAccess, bool bInheritHandle, string lpName);
[DllImport(Libraries.Kernel32, EntryPoint = "OpenMutexW", SetLastError = true, CharSet = CharSet.Unicode)]
internal extern static SafeWaitHandle OpenMutex(uint dwDesiredAccess, bool bInheritHandle, string lpName);
[DllImport(Libraries.Kernel32)]
internal extern static bool ResetEvent(IntPtr hEvent);
[DllImport(Libraries.Kernel32)]
internal extern static bool SetEvent(IntPtr hEvent);
[DllImport(Libraries.Kernel32)]
internal extern static bool SetEvent(SafeWaitHandle hEvent);
[DllImport(Libraries.Kernel32)]
internal extern static bool ReleaseSemaphore(IntPtr hSemaphore, int lReleaseCount, out int lpPreviousCount);
[DllImport(Libraries.Kernel32)]
internal extern static bool ReleaseMutex(IntPtr hMutex);
[DllImport(Libraries.Kernel32)]
internal extern static uint WaitForMultipleObjectsEx(uint nCount, IntPtr lpHandles, bool bWaitAll, uint dwMilliseconds, bool bAlertable);

View File

@@ -0,0 +1,36 @@
// 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.CompilerServices;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal enum APTTYPE : uint
{
APTTYPE_STA = 0x0u,
APTTYPE_MTA = 0x1u,
APTTYPE_NA = 0x2u,
APTTYPE_MAINSTA = 0x3u,
APTTYPE_CURRENT = 0xFFFFFFFFu,
}
internal enum APTTYPEQUALIFIER : uint
{
APTTYPEQUALIFIER_NONE = 0x0u,
APTTYPEQUALIFIER_IMPLICIT_MTA = 0x1u,
APTTYPEQUALIFIER_NA_ON_MTA = 0x2u,
APTTYPEQUALIFIER_NA_ON_STA = 0x3u,
APTTYPEQUALIFIER_NA_ON_IMPLICIT_MTA = 0x4u,
APTTYPEQUALIFIER_NA_ON_MAINSTA = 0x5u,
APTTYPEQUALIFIER_APPLICATION_STA = 0x6u,
}
internal static partial class Ole32
{
[DllImport(Interop.Libraries.Ole32, ExactSpelling = true)]
internal extern static int CoGetApartmentType(out APTTYPE pAptType, out APTTYPEQUALIFIER pAptQualifier);
}
}

View File

@@ -0,0 +1,19 @@
// 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.CompilerServices;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class Ole32
{
internal const uint COINIT_APARTMENTTHREADED = 2;
internal const uint COINIT_MULTITHREADED = 0;
[DllImport(Interop.Libraries.Ole32, ExactSpelling = true)]
internal extern static int CoInitializeEx(IntPtr reserved, uint dwCoInit);
}
}

View File

@@ -0,0 +1,16 @@
// 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.CompilerServices;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class Ole32
{
[DllImport(Interop.Libraries.Ole32, ExactSpelling = true)]
internal extern static int CoUninitialize();
}
}

View File

@@ -102,7 +102,7 @@ namespace System.Collections.Concurrent
// State of a key must never go from found to not found, and only one value may exist per key.
Debug.Assert(checkedFound);
if (default(V) == null) // No good way to do the "only one value" check for value types.
Debug.Assert(Object.ReferenceEquals(checkedValue, value));
Debug.Assert(object.ReferenceEquals(checkedValue, value));
}
}
#endif //DEBUG

View File

@@ -112,7 +112,7 @@ namespace System.Collections.Concurrent
// Since this DEBUG code is holding a strong reference to "value", state of a key must never go from found to not found,
// and only one value may exist per key.
Debug.Assert(checkedFound);
Debug.Assert(Object.ReferenceEquals(checkedValue, value));
Debug.Assert(object.ReferenceEquals(checkedValue, value));
GC.KeepAlive(value);
}
}

Some files were not shown because too many files have changed in this diff Show More