Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -1,80 +1,50 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Overlapped.Tests", "tests\System.Threading.Overlapped.Tests.csproj", "{861A3318-35AD-46AC-8257-8D5D2479BAD9}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Overlapped.Tests", "tests\System.Threading.Overlapped.Tests.csproj", "{861A3318-35AD-46ac-8257-8D5D2479BAD9}"
ProjectSection(ProjectDependencies) = postProject
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5} = {6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5} = {6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Overlapped", "src\System.Threading.Overlapped.csproj", "{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Overlapped", "src\System.Threading.Overlapped.csproj", "{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}"
ProjectSection(ProjectDependencies) = postProject
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E} = {F71467DF-30C1-44A0-A15A-163CB5DB4E6E}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Threading.Overlapped", "ref\System.Threading.Overlapped.csproj", "{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1A2F9F4A-A032-433E-B914-ADD5992BB178}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU = ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{861A3318-35AD-46AC-8257-8D5D2479BAD9}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Windows_NTnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.DebugNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Debug|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.ActiveCfg = netcoreapp-Unix-Release|Any CPU
{6A07CCB8-3E59-47E7-B3DD-DB1F6FC501D5}.ReleaseNETCoreAppnetcoreapp-Unixnetcoreapp-Windows_NT|AnyCPU.Build.0 = netcoreapp-Unix-Release|Any CPU
{861A3318-35AD-46ac-8257-8D5D2479BAD9}.Debug|Any CPU.ActiveCfg = netstandard-Windows_NT-Debug|Any CPU
{861A3318-35AD-46ac-8257-8D5D2479BAD9}.Debug|Any CPU.Build.0 = netstandard-Windows_NT-Debug|Any CPU
{861A3318-35AD-46ac-8257-8D5D2479BAD9}.Release|Any CPU.ActiveCfg = netstandard-Windows_NT-Release|Any CPU
{861A3318-35AD-46ac-8257-8D5D2479BAD9}.Release|Any CPU.Build.0 = netstandard-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{861A3318-35AD-46ac-8257-8D5D2479BAD9} = {1A2F9F4A-A032-433E-B914-ADD5992BB178}
{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
{F71467DF-30C1-44A0-A15A-163CB5DB4E6E} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
EndGlobalSection
EndGlobal

View File

@@ -4,5 +4,7 @@
<PropertyGroup>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
<IsDesktopFacade>true</IsDesktopFacade>
<IsUAP>true</IsUAP>
</PropertyGroup>
</Project>

View File

@@ -3,6 +3,7 @@
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
netfx;
uap;
</BuildConfigurations>
</PropertyGroup>

View File

@@ -3,15 +3,22 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn Condition="'$(TargetGroup)' == 'netfx'">$(NoWarn);0436</NoWarn>
<ProjectGuid>{F71467DF-30C1-44A0-A15A-163CB5DB4E6E}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.Threading.Overlapped.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
<Reference Include="mscorlib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />

View File

@@ -0,0 +1,3 @@
Compat issues with assembly System.Threading.Overlapped:
TypesMustExist : Type 'System.Threading.Overlapped' does not exist in the implementation but it does exist in the contract.
Total Issues: 1

View File

@@ -2,7 +2,9 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
net463-Windows_NT;
uap-Windows_NT;
uapaot-Windows_NT;
netfx-Windows_NT;
netcoreapp-Windows_NT;
netcoreapp-Unix;
</BuildConfigurations>

View File

@@ -1,64 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">

View File

@@ -6,65 +6,38 @@
<ProjectGuid>{6A07CCB8-3E59-47e7-B3DD-DB1F6FC501D5}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPartialFacadeAssembly Condition="'$(TargetsWindows)' == 'true'">true</IsPartialFacadeAssembly>
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsUnix)' == 'true'">true</GeneratePlatformNotSupportedAssembly>
<GeneratePlatformNotSupportedAssembly Condition="'$(TargetsWindows)' != 'true'">true</GeneratePlatformNotSupportedAssembly>
<GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='uapaot'">true</GenFacadesIgnoreMissingTypes>
</PropertyGroup>
<!-- Help VS understand available configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Unix-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' AND '$(TargetsWindows)' == 'true'">
<ProjectReference Include="..\..\System.Diagnostics.Debug\src\System.Diagnostics.Debug.csproj">
<Project>{E7E8DE8A-9EC1-46A8-A6EE-727DB32DBEB8}</Project>
<Name>System.Diagnostics.Debug</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetsUnix)' != 'true'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)'=='netfx'">
<Compile Include="System\Threading\DeferredDisposableLifetime.cs" />
<Compile Include="$(CommonPath)\System\HResults.cs">
<Link>Common\System\HResults.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="('$(TargetGroup)'=='netcoreapp' AND '$(TargetsWindows)' == 'true') OR '$(TargetGroup)'=='net463'">
<Compile Include="System\Threading\ClrThreadPoolBoundHandle.cs" />
<Compile Include="System\Threading\ClrThreadPoolBoundHandleOverlapped.cs" />
<Compile Include="System\Threading\ClrThreadPoolPreAllocatedOverlapped.cs" />
<Reference Include="mscorlib" />
<Reference Include="System" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='net463'">
<TargetingPackReference Include="mscorlib" />
<TargetingPackReference Include="System" />
<Compile Include="$(CommonPath)\System\NotImplemented.cs">
<Link>Common\NotImplemented.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' AND '$(TargetsWindows)' == 'true'">
<TargetingPackReference Include="System.Private.CoreLib" />
<ItemGroup Condition="'$(TargetGroup)' != 'netfx' and '$(TargetsWindows)' == 'true'">
<ReferenceFromRuntime Include="System.Private.CoreLib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' AND '$(TargetsWindows)' != 'true'">
<ItemGroup Condition="'$(TargetsWindows)' != 'true'">
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Handles" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcore50'">
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs">
<Link>Common\Interop\Interop.Libraries.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\kernel32\Interop.ThreadPoolIO.cs">
<Link>Common\Interop\Interop.ThreadPoolIO.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Microsoft\Win32\SafeHandles\SafeThreadPoolIOHandle.cs">
<Link>Microsoft\Win32\SafeHandles\SafeThreadPoolIOHandle.cs</Link>
</Compile>
<Compile Include="System\Threading\IOCompletionCallback.cs" />
<Compile Include="System\Threading\NativeOverlapped.cs" />
<Compile Include="System\Threading\Win32ThreadPoolBoundHandle.cs" />
<Compile Include="System\Threading\Win32ThreadPoolNativeOverlapped.ExecutionContextCallbackArgs.cs" />
<Compile Include="System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs" />
<Compile Include="System\Threading\Win32ThreadPoolNativeOverlapped.cs" />
<Compile Include="System\Threading\Win32ThreadPoolPreAllocatedOverlapped.cs" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -1,9 +0,0 @@
// 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.
namespace System.Threading
{
[CLSCompliant(false)]
public unsafe delegate void IOCompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP);
}

View File

@@ -1,18 +0,0 @@
// 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;
namespace System.Threading
{
[StructLayout(LayoutKind.Sequential)]
public struct NativeOverlapped
{
public IntPtr InternalLow;
public IntPtr InternalHigh;
public int OffsetLow;
public int OffsetHigh;
public IntPtr EventHandle;
}
}

View File

@@ -1,213 +0,0 @@
// 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.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
using Microsoft.Win32.SafeHandles;
namespace System.Threading
{
//
// Implementation of ThreadPoolBoundHandle that sits on top of the Win32 ThreadPool
//
public sealed class ThreadPoolBoundHandle : IDisposable, IDeferredDisposable
{
private static Interop.NativeIoCompletionCallback s_nativeIoCompletionCallback;
private readonly SafeHandle _handle;
private readonly SafeThreadPoolIOHandle _threadPoolHandle;
private DeferredDisposableLifetime<ThreadPoolBoundHandle> _lifetime;
private ThreadPoolBoundHandle(SafeHandle handle, SafeThreadPoolIOHandle threadPoolHandle)
{
_threadPoolHandle = threadPoolHandle;
_handle = handle;
}
public SafeHandle Handle
{
get { return _handle; }
}
public static ThreadPoolBoundHandle BindHandle(SafeHandle handle)
{
if (handle == null)
throw new ArgumentNullException(nameof(handle));
if (handle.IsClosed || handle.IsInvalid)
throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
// Make sure we use a statically-rooted completion callback,
// so it doesn't get collected while the I/O is in progress.
Interop.NativeIoCompletionCallback callback = s_nativeIoCompletionCallback;
if (callback == null)
s_nativeIoCompletionCallback = callback = new Interop.NativeIoCompletionCallback(OnNativeIOCompleted);
SafeThreadPoolIOHandle threadPoolHandle = Interop.Kernel32.CreateThreadpoolIo(handle, s_nativeIoCompletionCallback, IntPtr.Zero, IntPtr.Zero);
if (threadPoolHandle.IsInvalid)
{
int hr = Marshal.GetHRForLastWin32Error();
if (hr == System.HResults.E_HANDLE) // Bad handle
throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle));
if (hr == System.HResults.E_INVALIDARG) // Handle already bound or sync handle
throw new ArgumentException(SR.Argument_AlreadyBoundOrSyncHandle, nameof(handle));
throw Marshal.GetExceptionForHR(hr, new IntPtr(-1));
}
return new ThreadPoolBoundHandle(handle, threadPoolHandle);
}
[CLSCompliant(false)]
public unsafe NativeOverlapped* AllocateNativeOverlapped(IOCompletionCallback callback, object state, object pinData)
{
if (callback == null)
throw new ArgumentNullException(nameof(callback));
AddRef();
try
{
Win32ThreadPoolNativeOverlapped* overlapped = Win32ThreadPoolNativeOverlapped.Allocate(callback, state, pinData, preAllocated: null);
overlapped->Data._boundHandle = this;
Interop.Kernel32.StartThreadpoolIo(_threadPoolHandle);
return Win32ThreadPoolNativeOverlapped.ToNativeOverlapped(overlapped);
}
catch
{
Release();
throw;
}
}
[CLSCompliant(false)]
public unsafe NativeOverlapped* AllocateNativeOverlapped(PreAllocatedOverlapped preAllocated)
{
if (preAllocated == null)
throw new ArgumentNullException(nameof(preAllocated));
bool addedRefToThis = false;
bool addedRefToPreAllocated = false;
try
{
addedRefToThis = AddRef();
addedRefToPreAllocated = preAllocated.AddRef();
Win32ThreadPoolNativeOverlapped.OverlappedData data = preAllocated._overlapped->Data;
if (data._boundHandle != null)
throw new ArgumentException(SR.Argument_PreAllocatedAlreadyAllocated, nameof(preAllocated));
data._boundHandle = this;
Interop.Kernel32.StartThreadpoolIo(_threadPoolHandle);
return Win32ThreadPoolNativeOverlapped.ToNativeOverlapped(preAllocated._overlapped);
}
catch
{
if (addedRefToPreAllocated)
preAllocated.Release();
if (addedRefToThis)
Release();
throw;
}
}
[CLSCompliant(false)]
public unsafe void FreeNativeOverlapped(NativeOverlapped* overlapped)
{
if (overlapped == null)
throw new ArgumentNullException(nameof(overlapped));
Win32ThreadPoolNativeOverlapped* threadPoolOverlapped = Win32ThreadPoolNativeOverlapped.FromNativeOverlapped(overlapped);
Win32ThreadPoolNativeOverlapped.OverlappedData data = GetOverlappedData(threadPoolOverlapped, this);
if (!data._completed)
{
Interop.Kernel32.CancelThreadpoolIo(_threadPoolHandle);
Release();
}
data._boundHandle = null;
data._completed = false;
if (data._preAllocated != null)
data._preAllocated.Release();
else
Win32ThreadPoolNativeOverlapped.Free(threadPoolOverlapped);
}
[CLSCompliant(false)]
public static unsafe object GetNativeOverlappedState(NativeOverlapped* overlapped)
{
if (overlapped == null)
throw new ArgumentNullException(nameof(overlapped));
Win32ThreadPoolNativeOverlapped* threadPoolOverlapped = Win32ThreadPoolNativeOverlapped.FromNativeOverlapped(overlapped);
Win32ThreadPoolNativeOverlapped.OverlappedData data = GetOverlappedData(threadPoolOverlapped, null);
return threadPoolOverlapped->Data._state;
}
private static unsafe Win32ThreadPoolNativeOverlapped.OverlappedData GetOverlappedData(Win32ThreadPoolNativeOverlapped* overlapped, ThreadPoolBoundHandle expectedBoundHandle)
{
Win32ThreadPoolNativeOverlapped.OverlappedData data = overlapped->Data;
if (data._boundHandle == null)
throw new ArgumentException(SR.Argument_NativeOverlappedAlreadyFree, nameof(overlapped));
if (expectedBoundHandle != null && data._boundHandle != expectedBoundHandle)
throw new ArgumentException(SR.Argument_NativeOverlappedWrongBoundHandle, nameof(overlapped));
return data;
}
private static unsafe void OnNativeIOCompleted(IntPtr instance, IntPtr context, IntPtr overlappedPtr, uint ioResult, UIntPtr numberOfBytesTransferred, IntPtr ioPtr)
{
Win32ThreadPoolNativeOverlapped* overlapped = (Win32ThreadPoolNativeOverlapped*)overlappedPtr;
ThreadPoolBoundHandle boundHandle = overlapped->Data._boundHandle;
if (boundHandle == null)
throw new InvalidOperationException(SR.Argument_NativeOverlappedAlreadyFree);
boundHandle.Release();
Win32ThreadPoolNativeOverlapped.CompleteWithCallback(ioResult, (uint)numberOfBytesTransferred, overlapped);
}
private bool AddRef()
{
return _lifetime.AddRef(this);
}
private void Release()
{
_lifetime.Release(this);
}
public void Dispose()
{
_lifetime.Dispose(this);
GC.SuppressFinalize(this);
}
~ThreadPoolBoundHandle()
{
//
// During shutdown, don't automatically clean up, because this instance may still be
// reachable/usable by other code.
//
if (!Environment.HasShutdownStarted)
Dispose();
}
void IDeferredDisposable.OnFinalRelease(bool disposed)
{
if (disposed)
_threadPoolHandle.Dispose();
}
}
}

View File

@@ -1,17 +0,0 @@
// 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.
namespace System.Threading
{
partial struct Win32ThreadPoolNativeOverlapped
{
private unsafe class ExecutionContextCallbackArgs
{
internal uint _errorCode;
internal uint _bytesWritten;
internal Win32ThreadPoolNativeOverlapped* _overlapped;
internal OverlappedData _data;
}
}
}

View File

@@ -1,43 +0,0 @@
// 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.Diagnostics;
using System.Runtime.InteropServices;
namespace System.Threading
{
partial struct Win32ThreadPoolNativeOverlapped
{
internal class OverlappedData
{
internal GCHandle[] _pinnedData;
internal IOCompletionCallback _callback;
internal object _state;
internal ExecutionContext _executionContext;
internal ThreadPoolBoundHandle _boundHandle;
internal PreAllocatedOverlapped _preAllocated;
internal bool _completed;
internal void Reset()
{
Debug.Assert(_boundHandle == null); //not in use
if (_pinnedData != null)
{
for (int i = 0; i < _pinnedData.Length; i++)
{
if (_pinnedData[i].IsAllocated && _pinnedData[i].Target != null)
_pinnedData[i].Target = null;
}
}
_callback = null;
_state = null;
_executionContext = null;
_completed = false;
_preAllocated = null;
}
}
}
}

View File

@@ -1,230 +0,0 @@
// 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.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace System.Threading
{
[StructLayout(LayoutKind.Sequential)]
internal partial struct Win32ThreadPoolNativeOverlapped
{
// Per-thread cache of the args object, so we don't have to allocate a new one each time.
[ThreadStatic]
private static ExecutionContextCallbackArgs t_executionContextCallbackArgs;
private static ContextCallback s_executionContextCallback;
private static OverlappedData[] s_dataArray;
private static int s_dataCount; // Current number of valid entries in _dataArray
private static IntPtr s_freeList; // Lock-free linked stack of free ThreadPoolNativeOverlapped instances.
private NativeOverlapped _overlapped; // must be first, so we can cast to and from NativeOverlapped.
private IntPtr _nextFree; // if this instance if free, points to the next free instance.
private int _dataIndex; // Index in _dataArray of this instance's OverlappedData.
internal OverlappedData Data
{
get { return s_dataArray[_dataIndex]; }
}
internal static unsafe Win32ThreadPoolNativeOverlapped* Allocate(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated)
{
Win32ThreadPoolNativeOverlapped* overlapped = AllocateNew();
try
{
overlapped->SetData(callback, state, pinData, preAllocated);
}
catch
{
Free(overlapped);
throw;
}
return overlapped;
}
private static unsafe Win32ThreadPoolNativeOverlapped* AllocateNew()
{
IntPtr freePtr;
Win32ThreadPoolNativeOverlapped* overlapped;
OverlappedData data;
// Find a free Overlapped
while ((freePtr = Volatile.Read(ref s_freeList)) != IntPtr.Zero)
{
overlapped = (Win32ThreadPoolNativeOverlapped*)freePtr;
if (Interlocked.CompareExchange(ref s_freeList, overlapped->_nextFree, freePtr) != freePtr)
continue;
overlapped->_nextFree = IntPtr.Zero;
return overlapped;
}
// None are free; allocate a new one.
overlapped = (Win32ThreadPoolNativeOverlapped*)Marshal.AllocHGlobal(sizeof(Win32ThreadPoolNativeOverlapped));
*overlapped = default(Win32ThreadPoolNativeOverlapped);
// Allocate a OverlappedData object, and an index at which to store it in _dataArray.
data = new OverlappedData();
int dataIndex = Interlocked.Increment(ref s_dataCount) - 1;
// Make sure we didn't wrap around.
if (dataIndex < 0)
Environment.FailFast("Too many outstanding Win32ThreadPoolNativeOverlapped instances");
while (true)
{
OverlappedData[] dataArray = Volatile.Read(ref s_dataArray);
int currentLength = dataArray == null ? 0 : dataArray.Length;
// If the current array is too small, create a new, larger one.
if (currentLength <= dataIndex)
{
int newLength = currentLength;
if (newLength == 0)
newLength = 128;
while (newLength <= dataIndex)
newLength = (newLength * 3) / 2;
OverlappedData[] newDataArray = dataArray;
Array.Resize(ref newDataArray, newLength);
if (Interlocked.CompareExchange(ref s_dataArray, newDataArray, dataArray) != dataArray)
continue; // Someone else got the free one, try again
dataArray = newDataArray;
}
// If we haven't stored this object in the array yet, do so now. Then we need to make another pass through
// the loop, in case another thread resized the array before we made this update.
if (s_dataArray[dataIndex] == null)
{
// Full fence so this write can't move past subsequent reads.
Interlocked.Exchange(ref dataArray[dataIndex], data);
continue;
}
// We're already in the array, so we're done.
Debug.Assert(dataArray[dataIndex] == data);
overlapped->_dataIndex = dataIndex;
return overlapped;
}
}
private void SetData(IOCompletionCallback callback, object state, object pinData, PreAllocatedOverlapped preAllocated)
{
Debug.Assert(callback != null);
OverlappedData data = Data;
data._callback = callback;
data._state = state;
data._executionContext = ExecutionContext.Capture();
data._preAllocated = preAllocated;
//
// pinData can be any blittable type to be pinned, *or* an instance of object[] each element of which refers to
// an instance of a blittable type to be pinned.
//
if (pinData != null)
{
object[] objArray = pinData as object[];
if (objArray != null && objArray.GetType() == typeof(object[]))
{
if (data._pinnedData == null || data._pinnedData.Length < objArray.Length)
Array.Resize(ref data._pinnedData, objArray.Length);
for (int i = 0; i < objArray.Length; i++)
{
if (!data._pinnedData[i].IsAllocated)
data._pinnedData[i] = GCHandle.Alloc(objArray[i], GCHandleType.Pinned);
else
data._pinnedData[i].Target = objArray[i];
}
}
else
{
if (data._pinnedData == null)
data._pinnedData = new GCHandle[1];
if (!data._pinnedData[0].IsAllocated)
data._pinnedData[0] = GCHandle.Alloc(pinData, GCHandleType.Pinned);
else
data._pinnedData[0].Target = pinData;
}
}
}
internal static unsafe void Free(Win32ThreadPoolNativeOverlapped* overlapped)
{
// Reset all data.
overlapped->Data.Reset();
overlapped->_overlapped = default(NativeOverlapped);
// Add to the free list.
while (true)
{
IntPtr freePtr = Volatile.Read(ref s_freeList);
overlapped->_nextFree = freePtr;
if (Interlocked.CompareExchange(ref s_freeList, (IntPtr)overlapped, freePtr) == freePtr)
break;
}
}
internal static unsafe NativeOverlapped* ToNativeOverlapped(Win32ThreadPoolNativeOverlapped* overlapped)
{
return (NativeOverlapped*)overlapped;
}
internal static unsafe Win32ThreadPoolNativeOverlapped* FromNativeOverlapped(NativeOverlapped* overlapped)
{
return (Win32ThreadPoolNativeOverlapped*)overlapped;
}
internal static unsafe void CompleteWithCallback(uint errorCode, uint bytesWritten, Win32ThreadPoolNativeOverlapped* overlapped)
{
OverlappedData data = overlapped->Data;
Debug.Assert(!data._completed);
data._completed = true;
ContextCallback callback = s_executionContextCallback;
if (callback == null)
s_executionContextCallback = callback = OnExecutionContextCallback;
// Get an args object from the per-thread cache.
ExecutionContextCallbackArgs args = t_executionContextCallbackArgs;
if (args == null)
args = new ExecutionContextCallbackArgs();
t_executionContextCallbackArgs = null;
args._errorCode = errorCode;
args._bytesWritten = bytesWritten;
args._overlapped = overlapped;
args._data = data;
ExecutionContext.Run(data._executionContext, callback, args);
}
private static unsafe void OnExecutionContextCallback(object state)
{
ExecutionContextCallbackArgs args = (ExecutionContextCallbackArgs)state;
uint errorCode = args._errorCode;
uint bytesWritten = args._bytesWritten;
Win32ThreadPoolNativeOverlapped* overlapped = args._overlapped;
OverlappedData data = args._data;
// Put the args object back in the per-thread cache, now that we're done with it.
args._data = null;
t_executionContextCallbackArgs = args;
data._callback(errorCode, bytesWritten, ToNativeOverlapped(overlapped));
}
}
}

View File

@@ -1,60 +0,0 @@
// 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.Diagnostics;
namespace System.Threading
{
public sealed class PreAllocatedOverlapped : IDisposable, IDeferredDisposable
{
internal unsafe readonly Win32ThreadPoolNativeOverlapped* _overlapped;
private DeferredDisposableLifetime<PreAllocatedOverlapped> _lifetime;
[CLSCompliant(false)]
public unsafe PreAllocatedOverlapped(IOCompletionCallback callback, object state, object pinData)
{
if (callback == null)
throw new ArgumentNullException(nameof(callback));
_overlapped = Win32ThreadPoolNativeOverlapped.Allocate(callback, state, pinData, this);
}
internal bool AddRef()
{
return _lifetime.AddRef(this);
}
internal void Release()
{
_lifetime.Release(this);
}
public void Dispose()
{
_lifetime.Dispose(this);
GC.SuppressFinalize(this);
}
~PreAllocatedOverlapped()
{
//
// During shutdown, don't automatically clean up, because this instance may still be
// reachable/usable by other code.
//
if (!Environment.HasShutdownStarted)
Dispose();
}
unsafe void IDeferredDisposable.OnFinalRelease(bool disposed)
{
if (_overlapped != null)
{
if (disposed)
Win32ThreadPoolNativeOverlapped.Free(_overlapped);
else
*Win32ThreadPoolNativeOverlapped.ToNativeOverlapped(_overlapped) = default(NativeOverlapped);
}
}
}
}

View File

@@ -2,7 +2,6 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netstandard1.3-Windows_NT;
netstandard-Windows_NT;
</BuildConfigurations>
</PropertyGroup>

View File

@@ -19,26 +19,28 @@ public static partial class OverlappedTests
Assert.Null(obj.AsyncResult);
obj.AsyncResult = asyncResult;
Assert.Same(obj.AsyncResult, asyncResult);
Assert.Same(asyncResult, obj.AsyncResult);
#pragma warning disable 618
Assert.Equal(obj.EventHandle, 0);
Assert.Equal(0, obj.EventHandle);
obj.EventHandle = 3;
Assert.Equal(obj.EventHandle, 3);
Assert.Equal(3, obj.EventHandle);
#pragma warning restore 618
var _handle = new ManualResetEvent(false).SafeWaitHandle;
Assert.NotSame(obj.EventHandleIntPtr, IntPtr.Zero);
Assert.NotSame(IntPtr.Zero, obj.EventHandleIntPtr);
obj.EventHandleIntPtr = _handle.DangerousGetHandle();
Assert.Equal(obj.EventHandleIntPtr, _handle.DangerousGetHandle());
Assert.Equal(_handle.DangerousGetHandle(), obj.EventHandleIntPtr);
Assert.Equal(obj.OffsetHigh, 0);
obj.OffsetHigh = 3;
Assert.Equal(obj.OffsetHigh, 3);
Assert.Equal(3, obj.OffsetHigh);
obj.OffsetHigh = 0;
Assert.Equal(0, obj.OffsetHigh);
Assert.Equal(obj.OffsetLow, 0);
obj.OffsetLow = 1;
Assert.Equal(obj.OffsetLow, 1);
Assert.Equal(1, obj.OffsetLow);
obj.OffsetLow = 0;
Assert.Equal(0, obj.OffsetLow);
}
[Fact]
@@ -50,13 +52,13 @@ public static partial class OverlappedTests
#pragma warning disable 618
var obj = new Overlapped(1, 3, _event.Handle.ToInt32(), asyncResult);
Assert.Equal(obj.EventHandle, _event.Handle.ToInt32());
Assert.Equal(_event.Handle.ToInt32(), obj.EventHandle);
#pragma warning restore 618
Assert.Same(obj.AsyncResult, asyncResult);
Assert.Equal(obj.EventHandleIntPtr, _handle.DangerousGetHandle());
Assert.Equal(obj.OffsetHigh, 3);
Assert.Equal(obj.OffsetLow, 1);
Assert.Same(asyncResult, obj.AsyncResult);
Assert.Equal(_handle.DangerousGetHandle(), obj.EventHandleIntPtr);
Assert.Equal(3, obj.OffsetHigh);
Assert.Equal(1, obj.OffsetLow);
}
[Fact]
@@ -66,15 +68,15 @@ public static partial class OverlappedTests
var _event = new ManualResetEvent(false);
var _handle = _event.SafeWaitHandle;
var obj = new Overlapped(1, 3, _handle.DangerousGetHandle(), asyncResult);
Assert.Same(obj.AsyncResult, asyncResult);
Assert.Same(asyncResult, obj.AsyncResult);
#pragma warning disable 618
Assert.Equal(obj.EventHandle, _event.Handle.ToInt32());
Assert.Equal(_event.Handle.ToInt32(), obj.EventHandle);
#pragma warning restore 618
Assert.Equal(obj.EventHandleIntPtr, _handle.DangerousGetHandle());
Assert.Equal(obj.OffsetHigh, 3);
Assert.Equal(obj.OffsetLow, 1);
Assert.Equal(_handle.DangerousGetHandle(), obj.EventHandleIntPtr);
Assert.Equal(3, obj.OffsetHigh);
Assert.Equal(1, obj.OffsetLow);
}
[Fact]
public static unsafe void PackNegTest()
@@ -82,9 +84,8 @@ public static partial class OverlappedTests
var helper = new AsyncHelper();
IOCompletionCallback callback = MyCallback(helper);
NativeOverlapped* nativeOverlapped;
Overlapped ov = new Overlapped();
nativeOverlapped = ov.Pack(new IOCompletionCallback(callback), null);
NativeOverlapped* nativeOverlapped = ov.Pack(new IOCompletionCallback(callback), null);
try
{
@@ -135,7 +136,7 @@ public static partial class OverlappedTests
Assert.True(null != nativeOverlapped);
Overlapped ov1 = Overlapped.Unpack(nativeOverlapped);
Assert.Same(ov1, ov);
Assert.Same(ov, ov1);
}
finally
{

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<Project Include="System.Threading.Overlapped.Tests.csproj">
<OSGroup>Windows_NT</OSGroup>
</Project>
<Project Include="System.Threading.Overlapped.Tests.csproj">
<TargetGroup>netstandard1.3</TargetGroup>
<OSGroup>Windows_NT</OSGroup>
<TestTFMs>netcore50;netcoreapp1.0;net46</TestTFMs>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
@@ -6,10 +6,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard1.3-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard1.3-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="DllImport.cs" />
<Compile Include="ThreadPoolBoundHandle_PreAllocatedOverlappedTests.cs" />
@@ -24,9 +22,7 @@
<Compile Include="ThreadPoolBoundHandle_AllocateNativeOverlappedTests.cs" />
<Compile Include="ThreadPoolBoundHandle_DisposeTests.cs" />
<Compile Include="ThreadPoolBoundHandle_BindHandleTests.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netstandard'">
<Compile Include="OverlappedTests.cs" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>