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

@@ -0,0 +1,38 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.WindowsRuntime", "src\System.Runtime.WindowsRuntime.csproj", "{844A2A0B-4169-49C3-B367-AFDC4894E487}"
ProjectSection(ProjectDependencies) = postProject
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA} = {FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.WindowsRuntime", "ref\System.Runtime.WindowsRuntime.csproj", "{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}"
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
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{844A2A0B-4169-49C3-B367-AFDC4894E487}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{844A2A0B-4169-49C3-B367-AFDC4894E487}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{844A2A0B-4169-49C3-B367-AFDC4894E487}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{844A2A0B-4169-49C3-B367-AFDC4894E487}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{844A2A0B-4169-49C3-B367-AFDC4894E487} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
EndGlobalSection
EndGlobal

View File

@@ -3,5 +3,6 @@
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.13.0</AssemblyVersion>
<IsUAP>true</IsUAP>
</PropertyGroup>
</Project>

View File

@@ -1,8 +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.Runtime.WindowsRuntime.pkgproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

View File

@@ -5,7 +5,7 @@
<ProjectReference Include="..\ref\System.Runtime.WindowsRuntime.csproj">
<SupportedFramework>netcore451;wpa81</SupportedFramework>
</ProjectReference>
<ProjectReference Include="..\src\System.Runtime.WindowsRuntime.builds" />
<ProjectReference Include="..\src\System.Runtime.WindowsRuntime.csproj" />
<!-- Not supported for desktop -->
<InboxOnTargetFramework Include="win8" />
<InboxOnTargetFramework Include="wp80" />
@@ -17,6 +17,10 @@
<ValidatePackageSuppression Include="PermitImplementation">
<Value>.NETCoreApp,Version=v1.1/win10-arm64;.NETCoreApp,Version=v2.0/win10-arm64</Value>
</ValidatePackageSuppression>
<!-- this package is part of the implementation closure of NETStandard.Library
therefore it cannot reference NETStandard.Library -->
<SuppressMetaPackage Include="NETStandard.Library" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -13,6 +13,7 @@
match the output assembly name 'System.Runtime.WindowsRuntime, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
-->
<NoWarn>1698</NoWarn>
<ProjectGuid>{FDDA3E4A-B182-4CD1-B624-EBD72D8A05DA}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
@@ -23,7 +24,7 @@
<Compile Include="System.Runtime.WindowsRuntime.Manual.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Microsoft.TargetingPack.Private.WinRT\ref\Microsoft.TargetingPack.Private.WinRT.depproj" />
<ProjectReference Include="..\..\..\external\winrt\winrt.depproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.IO\ref\System.IO.csproj" />

View File

@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp-Windows_NT;
uap-Windows_NT;
uapaot-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project>

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">
@@ -151,7 +92,7 @@
<value>The specified object cannot be converted to a System.IO.Stream instance because it is not a Windows Runtime stream. In order to convert an object to a Stream instance it must implement at least one of the following 3 Windows Runtime stream interfaces: IInputStream, IOutputStream, IRandomAccessStream.</value>
</data>
<data name="Argument_RelativePathMayNotBeWhitespaceOnly" xml:space="preserve">
<value>The specified relative path may not consist of white spaces only</value>
<value>The specified relative path may not consist of whitespace only</value>
</data>
<data name="Argument_StreamPositionBeyondEOS" xml:space="preserve">
<value>The specified stream position is beyond the end of the stream.</value>
@@ -171,6 +112,9 @@
<data name="ArgumentOutOfRange_InvalidInputStreamOptionsEnumValue" xml:space="preserve">
<value>The specified value is not a valid member of the InputStreamOptions enumeration.</value>
</data>
<data name="ArgumentOutOfRange_NeedNonNegNum" xml:space="preserve">
<value>Non-negative number required.</value>
</data>
<data name="ArgumentOutOfRange_WinRtAdapterBufferSizeMayNotBeNegative" xml:space="preserve">
<value>The buffer size for a Windows Runtime stream adapter may not be negative. Use a positive buffer size or 0 to disable buffering.</value>
</data>
@@ -267,9 +211,6 @@
<data name="WinRtCOM_Error" xml:space="preserve">
<value>An error has occurred.</value>
</data>
<data name="ArgumentOutOfRange_MustBePositive" xml:space="preserve">
<value>'{0}' must be greater than zero.</value>
</data>
<data name="ObjectDisposed_StreamClosed" xml:space="preserve">
<value>Cannot access a closed Stream.</value>
</data>
@@ -282,60 +223,9 @@
<data name="NotSupported_UnwritableStream" xml:space="preserve">
<value>Stream does not support writing.</value>
</data>
<data name="ArgumentNull_Buffer" xml:space="preserve">
<value>Buffer cannot be null.</value>
</data>
<data name="ArgumentOutOfRange_NegFileSize" xml:space="preserve">
<value>Length must be non-negative.</value>
</data>
<data name="NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed" xml:space="preserve">
<value>Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.</value>
</data>
<data name="Argument_InvalidSafeBufferOffLen" xml:space="preserve">
<value>Offset and length were greater than the size of the SafeBuffer.</value>
</data>
<data name="InvalidOperation_CalledTwice" xml:space="preserve">
<value>The method cannot be called twice on the same instance.</value>
</data>
<data name="ArgumentOutOfRange_LengthGreaterThanCapacity" xml:space="preserve">
<value>The length cannot be greater than the capacity.</value>
</data>
<data name="ArgumentOutOfRange_UnmanagedMemStreamWrapAround" xml:space="preserve">
<value>The UnmanagedMemoryStream capacity would wrap around the high end of the address space.</value>
</data>
<data name="ArgumentOutOfRange_Enum" xml:space="preserve">
<value>Enum value was out of legal range.</value>
</data>
<data name="NotSupported_UmsSafeBuffer" xml:space="preserve">
<value>This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer.</value>
</data>
<data name="IndexOutOfRange_UMSPosition" xml:space="preserve">
<value>Unmanaged memory stream position was beyond the capacity of the stream.</value>
</data>
<data name="IO_SeekBeforeBegin" xml:space="preserve">
<value>An attempt was made to move the position before the beginning of the stream.</value>
</data>
<data name="Argument_InvalidSeekOrigin" xml:space="preserve">
<value>Invalid seek origin.</value>
</data>
<data name="IO_FixedCapacity" xml:space="preserve">
<value>Unable to expand length of this stream beyond its capacity.</value>
</data>
<data name="IO_StreamTooLong" xml:space="preserve">
<value>Stream was too long.</value>
</data>
<data name="Arg_BufferTooSmall" xml:space="preserve">
<value>Not enough space available in the buffer.</value>
</data>
<data name="ArgumentOutOfRange_NeedNonNegNum" xml:space="preserve">
<value>Non-negative number required.</value>
</data>
<data name="Argument_InvalidOffLen" xml:space="preserve">
<value>Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.</value>
</data>
<data name="ArgumentOutOfRange_StreamLength" xml:space="preserve">
<value>Stream length must be non-negative and less than 2^31 - 1 - origin.</value>
</data>
<data name="DirectUI_Empty" xml:space="preserve">
<value>Empty.</value>
</data>
@@ -345,4 +235,4 @@
<data name="UnauthorizedAccess_InternalBuffer" xml:space="preserve">
<value>MemoryStream's internal buffer cannot be accessed.</value>
</data>
</root>
</root>

View File

@@ -1,14 +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.Runtime.WindowsRuntime.csproj">
<OSGroup>Windows_NT</OSGroup>
</Project>
<Project Include="System.Runtime.WindowsRuntime.csproj">
<OSGroup>Windows_NT</OSGroup>
<TargetGroup>uap101aot</TargetGroup>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>

View File

@@ -1,49 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'==''">Windows_Debug</Configuration>
</PropertyGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<UseECMAKey>true</UseECMAKey>
<AssemblyName>System.Runtime.WindowsRuntime</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ClsCompliant>true</ClsCompliant>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'uap101aot'">true</IsPartialFacadeAssembly>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'uapaot'">true</IsPartialFacadeAssembly>
<!-- CS1698 - Disable warning about reference to 4.0.0.0 System.Runtime.WindowsRuntime having same simple name as target assembly -->
<!-- CS0436 - System.Private.CoreLib has internals visible to System.Runtime.WindowsRuntime and is colliding internals on common shared code -->
<NoWarn>$(NoWarn);1698;0436</NoWarn>
<ProjectGuid>{844A2A0B-4169-49C3-B367-AFDC4894E487}</ProjectGuid>
<PackageTargetRuntime>win8</PackageTargetRuntime>
<PackageTargetRuntime Condition="'$(TargetGroup)' == 'uap101aot'">win8-aot</PackageTargetRuntime>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.7</NuGetTargetMoniker>
<PackageTargetRuntime Condition="'$(TargetGroup)' == 'uapaot'">win8-aot</PackageTargetRuntime>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetGroup)'==''">
<PropertyGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
<DefineConstants>$(DefineConstants);netstandard;FEATURE_APPX</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap101aot_Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap101aot_Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)'==''">
<TargetingPackReference Include="System.Private.CoreLib" />
<ProjectReference Include="$(SourceDir)\mscorlib.WinRT-Facade\mscorlib.WinRT-Facade.csproj" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-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)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
<ReferenceFromRuntime Include="System.Private.CoreLib" />
<Reference Include="mscorlib" />
<Reference Include="Windows" />
<!-- Needed for the compiler to resolve IObservableMap.MapChanged. -->
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj">
<UndefineProperties>OSGroup;TargetGroup</UndefineProperties>
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj">
<Aliases>System_Runtime_Extensions</Aliases>
</ProjectReference>
<ProjectReference Include="..\..\System.Diagnostics.Debug\src\System.Diagnostics.Debug.csproj" />
</ProjectReference> <ProjectReference Include="..\..\System.Diagnostics.Debug\src\System.Diagnostics.Debug.csproj" />
<ProjectReference Include="..\..\System.Diagnostics.Tools\src\System.Diagnostics.Tools.csproj" />
<ProjectReference Include="..\..\System.Runtime.InteropServices.WindowsRuntime\src\System.Runtime.InteropServices.WindowsRuntime.csproj">
<UndefineProperties>OSGroup</UndefineProperties>
</ProjectReference>
<ProjectReference Include="..\..\System.ObjectModel\src\System.ObjectModel.csproj">
<UndefineProperties>OSGroup</UndefineProperties>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uap101aot'">
<ProjectReference Include="..\..\System.Runtime.InteropServices.WindowsRuntime\src\System.Runtime.InteropServices.WindowsRuntime.csproj" />
<ProjectReference Include="..\..\System.ObjectModel\src\System.ObjectModel.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uapaot'">
<!-- We need to add this for now because these three types exist in System.Private.Interop.dll and Windows.winmd. -->
<SeedTypePreference Include="Windows.Foundation.Point">
<Assembly>System.Private.Interop</Assembly>
@@ -55,25 +47,21 @@
<Assembly>System.Private.Interop</Assembly>
</SeedTypePreference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'uap101aot'">
<TargetingPackReference Include="System.Private.Interop" />
<TargetingPackReference Include="System.Private.Corelib" />
<TargetingPackReference Include="System.Private.Threading" />
<TargetingPackReference Include="Windows" />
<ProjectReference Include="$(SourceDir)\mscorlib.WinRT-Facade\mscorlib.WinRT-Facade.csproj" />
<TargetingPackReference Include="System.Private.CoreLib.WinRTInterop" />
<ItemGroup Condition="'$(TargetGroup)' == 'uapaot'">
<ReferenceFromRuntime Include="System.Private.Interop" />
<ReferenceFromRuntime Include="System.Private.Corelib" />
<ReferenceFromRuntime Include="System.Private.Threading" />
<Reference Include="Windows" />
<Reference Include="mscorlib" />
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj">
<TargetGroup>uap101aot</TargetGroup>
<TargetGroup>uapaot</TargetGroup>
</ProjectReference>
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj">
<UndefineProperties>OSGroup;TargetGroup</UndefineProperties>
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj">
<Aliases>System_Runtime_Extensions</Aliases>
</ProjectReference>
<ProjectReference Include="..\..\System.Resources.ResourceManager\src\System.Resources.ResourceManager.csproj">
<TargetGroup>uap101aot</TargetGroup>
<TargetGroup>uapaot</TargetGroup>
</ProjectReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'==''">
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)'=='uap'">
<Compile Include="System\IO\StreamOperationAsyncResult.CoreCLR.cs" />
<Compile Include="System\Runtime\InteropServices\WindowsRuntime\MarshalingHelpers.cs" />
<Compile Include="System\Runtime\InteropServices\WindowsRuntime\RestrictedErrorInfoHelper.cs" />
@@ -87,9 +75,8 @@
<Compile Include="System\Windows\Rect.cs" />
<Compile Include="System\Windows\Size.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='uap101aot'">
<ItemGroup Condition="'$(TargetGroup)'=='uapaot'">
<Compile Include="System\IO\StreamOperationAsyncResult.CoreRT.cs" />
<Compile Include="System\IO\UnmanagedMemoryStreamInternal.cs" />
<Compile Include="System\Threading\Tasks\AsyncInfoToTaskBridge.CoreRT.cs" />
<Compile Include="System\WindowsRuntimeSystemExtensions.CoreRT.cs" />
</ItemGroup>
@@ -130,8 +117,5 @@
<Compile Include="System\Windows\TokenizerHelper.cs" />
<Compile Include="System\Windows\UI\Color.cs" />
</ItemGroup>
<ItemGroup>
<None Include="project.json" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>
</Project>

View File

@@ -2,10 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
extern alias System_Runtime_Extensions;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Runtime.InteropServices;
using System.Runtime.WindowsRuntime.Internal;
@@ -14,8 +13,6 @@ using System.Threading;
using Windows.Foundation;
using Windows.Storage.Streams;
using MemoryStream = System_Runtime_Extensions::System.IO.MemoryStream;
namespace System.IO
{
/// <summary>

View File

@@ -2,10 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
extern alias System_Runtime_Extensions;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.IO;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
@@ -13,10 +12,6 @@ using System.Threading;
using Windows.Foundation;
using Windows.Storage.Streams;
// Type aliases cannot match existing typenames. In this file our code is in System.IO, which would
// create two MemoryStream definitions that are in scope if we defined as MemoryStream.
using SREMemoryStream = System_Runtime_Extensions::System.IO.MemoryStream;
namespace System.IO
{
/// <summary>Depending on the concrete type of the stream managed by a <c>NetFxToWinRtStreamAdapter</c>,
@@ -33,7 +28,7 @@ namespace System.IO
internal static IAsyncOperationWithProgress<IBuffer, UInt32> ReadAsync_MemoryStream(Stream stream, IBuffer buffer, UInt32 count)
{
Debug.Assert(stream != null);
Debug.Assert(stream is SREMemoryStream);
Debug.Assert(stream is MemoryStream);
Debug.Assert(stream.CanRead);
Debug.Assert(stream.CanSeek);
Debug.Assert(buffer != null);
@@ -48,7 +43,7 @@ namespace System.IO
// The user specified buffer will not have any data put into it:
buffer.Length = 0;
SREMemoryStream memStream = stream as SREMemoryStream;
MemoryStream memStream = stream as MemoryStream;
Debug.Assert(memStream != null);
try

View File

@@ -1,450 +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;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.WindowsRuntime.Internal;
using System.Runtime;
using System.Security;
using System.Threading;
namespace System.IO
{
[Flags]
internal enum FileAccess
{
// Specifies read access to the file. Data can be read from the file and
// the file pointer can be moved. Combine with WRITE for read-write access.
Read = 1,
// Specifies write access to the file. Data can be written to the file and
// the file pointer can be moved. Combine with READ for read-write access.
Write = 2,
// Specifies read and write access to the file. Data can be written to the
// file and the file pointer can be moved. Data can also be read from the
// file.
ReadWrite = 3,
}
/*
* This class is used to access a contiguous block of memory, likely outside
* the GC heap (or pinned in place in the GC heap, but a MemoryStream may
* make more sense in those cases). It's great if you have a pointer and
* a length for a section of memory mapped in by someone else and you don't
* want to copy this into the GC heap. UnmanagedMemoryStream assumes these
* two things:
*
* 1) All the memory in the specified block is readable or writable,
* depending on the values you pass to the constructor.
* 2) The lifetime of the block of memory is at least as long as the lifetime
* of the UnmanagedMemoryStream.
* 3) You clean up the memory when appropriate. The UnmanagedMemoryStream
* currently will do NOTHING to free this memory.
* 4) All calls to Write and WriteByte may not be threadsafe currently.
*
* It may become necessary to add in some sort of
* DeallocationMode enum, specifying whether we unmap a section of memory,
* call free, run a user-provided delegate to free the memory, etc etc.
* We'll suggest user write a subclass of UnmanagedMemoryStream that uses
* a SafeHandle subclass to hold onto the memory.
* Check for problems when using this in the negative parts of a
* process's address space. We may need to use unsigned longs internally
* and change the overflow detection logic.
*/
internal class UnmanagedMemoryStream : Stream
{
private unsafe byte* _mem;
private long _length;
private long _capacity;
private long _position;
private FileAccess _access;
internal bool _isOpen;
// Needed for subclasses that need to map a file, etc.
protected UnmanagedMemoryStream()
{
unsafe
{
_mem = null;
}
_isOpen = false;
}
public unsafe UnmanagedMemoryStream(byte* pointer, long length)
{
Initialize(pointer, length, length, FileAccess.Read, false);
}
public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access)
{
Initialize(pointer, length, capacity, access, false);
}
// We must create one of these without doing a security check. This
// class is created while security is trying to start up. Plus, doing
// a Demand from Assembly.GetManifestResourceStream isn't useful.
internal unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access, bool skipSecurityCheck)
{
Initialize(pointer, length, capacity, access, skipSecurityCheck);
}
protected unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access)
{
Initialize(pointer, length, capacity, access, false);
}
internal unsafe void Initialize(byte* pointer, long length, long capacity, FileAccess access, bool skipSecurityCheck)
{
if (pointer == null)
throw new ArgumentNullException(nameof(pointer));
if (length < 0 || capacity < 0)
throw new ArgumentOutOfRangeException((length < 0) ? nameof(length): nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum);
if (length > capacity)
throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_LengthGreaterThanCapacity);
Contract.EndContractBlock();
// Check for wraparound.
if (((byte*)((long)pointer + capacity)) < pointer)
throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_UnmanagedMemStreamWrapAround);
if (access < FileAccess.Read || access > FileAccess.ReadWrite)
throw new ArgumentOutOfRangeException(nameof(access), SR.ArgumentOutOfRange_Enum);
if (_isOpen)
throw new InvalidOperationException(SR.InvalidOperation_CalledTwice);
_mem = pointer;
_length = length;
_capacity = capacity;
_access = access;
_isOpen = true;
}
public override bool CanRead
{
[Pure]
get
{ return _isOpen && (_access & FileAccess.Read) != 0; }
}
public override bool CanSeek
{
[Pure]
get
{ return _isOpen; }
}
public override bool CanWrite
{
[Pure]
get
{ return _isOpen && (_access & FileAccess.Write) != 0; }
}
[System.Security.SecuritySafeCritical] // auto-generated
protected override void Dispose(bool disposing)
{
_isOpen = false;
unsafe { _mem = null; }
// Stream allocates WaitHandles for async calls. So for correctness
// call base.Dispose(disposing) for better perf, avoiding waiting
// for the finalizers to run on those types.
base.Dispose(disposing);
}
public override void Flush()
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
}
public override long Length
{
get
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
return Interlocked.Read(ref _length);
}
}
public long Capacity
{
get
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
return _capacity;
}
}
public override long Position
{
get
{
if (!CanSeek) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
Contract.EndContractBlock();
return Interlocked.Read(ref _position);
}
[System.Security.SecuritySafeCritical] // auto-generated
set
{
if (value < 0)
throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (!CanSeek) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
#if WIN32
unsafe
{
// On 32 bit machines, ensure we don't wrap around.
if (value > (long)Int32.MaxValue || _mem + value < _mem)
throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength);
}
#endif
Interlocked.Exchange(ref _position, value);
}
}
public unsafe byte* PositionPointer
{
get
{
// Use a temp to avoid a race
long pos = Interlocked.Read(ref _position);
if (pos > _capacity)
throw new IndexOutOfRangeException(SR.IndexOutOfRange_UMSPosition);
byte* ptr = _mem + pos;
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
return ptr;
}
set
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (value < _mem)
throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, value - _mem);
}
}
internal unsafe byte* Pointer
{
get
{
return _mem;
}
}
[System.Security.SecuritySafeCritical] // auto-generated
public override int Read([In, Out] byte[] buffer, int offset, int count)
{
if (buffer == null)
throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!CanRead) throw new NotSupportedException(SR.NotSupported_UnreadableStream);
// Use a local variable to avoid a race where another thread
// changes our position after we decide we can read some bytes.
long pos = Interlocked.Read(ref _position);
long len = Interlocked.Read(ref _length);
long n = len - pos;
if (n > count)
n = count;
if (n <= 0)
return 0;
int nInt = (int)n; // Safe because n <= count, which is an Int32
Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1.
unsafe
{
Marshal.Copy((IntPtr)(_mem + pos), buffer, offset, nInt);
}
Interlocked.Exchange(ref _position, pos + n);
return nInt;
}
[System.Security.SecuritySafeCritical] // auto-generated
public override int ReadByte()
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!CanRead) throw new NotSupportedException(SR.NotSupported_UnreadableStream);
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
if (pos >= len)
return -1;
Interlocked.Exchange(ref _position, pos + 1);
int result;
unsafe
{
result = _mem[pos];
}
return result;
}
public override long Seek(long offset, SeekOrigin loc)
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
switch (loc)
{
case SeekOrigin.Begin:
if (offset < 0)
throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, offset);
break;
case SeekOrigin.Current:
long pos = Interlocked.Read(ref _position);
if (offset + pos < 0)
throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, offset + pos);
break;
case SeekOrigin.End:
long len = Interlocked.Read(ref _length);
if (len + offset < 0)
throw new IOException(SR.IO_SeekBeforeBegin);
Interlocked.Exchange(ref _position, len + offset);
break;
default:
throw new ArgumentException(SR.Argument_InvalidSeekOrigin);
}
long finalPos = Interlocked.Read(ref _position);
Debug.Assert(finalPos >= 0, "_position >= 0");
return finalPos;
}
[System.Security.SecuritySafeCritical] // auto-generated
public override void SetLength(long value)
{
if (value < 0)
throw new ArgumentOutOfRangeException("length", SR.ArgumentOutOfRange_NeedNonNegNum);
Contract.EndContractBlock();
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!CanWrite) throw new NotSupportedException(SR.NotSupported_UnwritableStream);
if (value > _capacity)
throw new IOException(SR.IO_FixedCapacity);
long pos = Interlocked.Read(ref _position);
long len = Interlocked.Read(ref _length);
if (value > len)
{
unsafe
{
Helpers.ZeroMemory(_mem + len, value - len);
}
}
Interlocked.Exchange(ref _length, value);
if (pos > value)
{
Interlocked.Exchange(ref _position, value);
}
}
[System.Security.SecuritySafeCritical] // auto-generated
public override void Write(byte[] buffer, int offset, int count)
{
if (buffer == null)
throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer);
if (offset < 0)
throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum);
if (count < 0)
throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum);
if (buffer.Length - offset < count)
throw new ArgumentException(SR.Argument_InvalidOffLen);
Contract.EndContractBlock();
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!CanWrite) throw new NotSupportedException(SR.NotSupported_UnwritableStream);
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
long n = pos + count;
// Check for overflow
if (n < 0)
throw new IOException(SR.IO_StreamTooLong);
if (n > _capacity)
{
throw new NotSupportedException(SR.IO_FixedCapacity);
}
// Check to see whether we are now expanding the stream and must
// zero any memory in the middle.
if (pos > len)
{
unsafe
{
Helpers.ZeroMemory(_mem + len, pos - len);
}
}
// set length after zeroing memory to avoid race condition of accessing unzeroed memory
if (n > len)
{
Interlocked.Exchange(ref _length, n);
}
unsafe
{
Marshal.Copy(buffer, offset, (IntPtr)(_mem + pos), count);
}
Interlocked.Exchange(ref _position, n);
return;
}
[System.Security.SecuritySafeCritical] // auto-generated
public override void WriteByte(byte value)
{
if (!_isOpen) throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed);
if (!CanWrite) throw new NotSupportedException(SR.NotSupported_UnwritableStream);
long pos = Interlocked.Read(ref _position); // Use a local to avoid a race condition
long len = Interlocked.Read(ref _length);
long n = pos + 1;
if (pos >= len)
{
// Check for overflow
if (n < 0)
throw new IOException(SR.IO_StreamTooLong);
if (n > _capacity)
throw new NotSupportedException(SR.IO_FixedCapacity);
// Check to see whether we are now expanding the stream and must
// zero any memory in the middle.
if (pos > len)
{
unsafe
{
Helpers.ZeroMemory(_mem + len, pos - len);
}
}
// set length after zeroing memory to avoid race condition of accessing unzeroed memory
Interlocked.Exchange(ref _length, n);
}
unsafe
{
_mem[pos] = value;
}
Interlocked.Exchange(ref _position, n);
}
}
}

View File

@@ -345,7 +345,7 @@ namespace System.Resources
{
if (packageSimpleName.EndsWith(".resources.dll", StringComparison.CurrentCultureIgnoreCase))
{
// Pretend we didnt get a package name. When an attempt is made to get resource string, GetString implementation
// Pretend we didn't get a package name. When an attempt is made to get resource string, GetString implementation
// will see that we are going to use modern resource manager but we don't have PRI and will thrown an exception indicating
// so. This will force the developer to have a valid PRI based resource.
packageSimpleName = null;

View File

@@ -182,7 +182,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime
{
try
{
// Pin the the data array:
// Pin the data array:
gcHandle = GCHandle.Alloc(_data, GCHandleType.Pinned);
buffPtr = gcHandle.AddrOfPinnedObject() + _dataStartOffs;

View File

@@ -2,8 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
extern alias System_Runtime_Extensions;
using System.Diagnostics.Contracts;
using System.Diagnostics;
using System.IO;
@@ -11,8 +9,6 @@ using System.Runtime.WindowsRuntime.Internal;
using Windows.Foundation;
using Windows.Storage.Streams;
using MemoryStream = System_Runtime_Extensions::System.IO.MemoryStream;
namespace System.Runtime.InteropServices.WindowsRuntime
{
/// <summary>

View File

@@ -90,7 +90,7 @@ namespace System.Threading
public Invoker(SendOrPostCallback callback, object state)
{
_executionContext = ExecutionContext.FastCapture();
_executionContext = ExecutionContext.Capture();
_callback = callback;
_state = state;
@@ -106,7 +106,7 @@ namespace System.Threading
if (_executionContext == null)
InvokeCore();
else
ExecutionContext.Run(_executionContext, s_contextCallback, this, preserveSyncCtx: true);
ExecutionContext.Run(_executionContext, s_contextCallback, this);
// If there was an ETW event that fired at the top of the winrt event handling loop, ETW listeners could
// use it as a marker of completion of the previous request. Since such an event does not exist we need to