Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Common/src/Interop/Windows/BCrypt/Interop.NTSTATUS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// See the LICENSE file in the project root for more information.

using System;
using System.Security.Cryptography;

internal partial class Interop
{
Expand Down
15 changes: 15 additions & 0 deletions src/Common/src/System/OperationCanceledException.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace System
{
internal class OperationCanceledException : Exception
{
public OperationCanceledException()
{
}
}
}
49 changes: 49 additions & 0 deletions src/Common/src/System/Runtime/InteropServices/Marshal.Unix.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// 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.Runtime.InteropServices
{
// Stand-in type for low-level assemblies to obtain Win32 errors
internal static class Marshal
{
public static int GetLastWin32Error()
{
// issue: https://github.com/dotnet/corefx/issues/6778
// Need to define and implement this for Linux
return 0;
}

unsafe public static String PtrToStringAnsi(IntPtr ptr)
{
if (IntPtr.Zero == ptr)
{
return null;
}

byte *pBytes = (byte *) ptr;
int length = 0;

while (*pBytes != 0)
{
pBytes++;
length++;
}

if (length == 0)
{
return String.Empty;
}

char [] chars = new char[length];
pBytes = (byte *) ptr;

for (int i=0; i<length; i++)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use UTF8 encoding instead. Adding it to the issue #6778

{
chars[i] = (char) pBytes[i];
}

return new string(chars);
}
}
}
8 changes: 8 additions & 0 deletions src/System.Private.Uri/src/System.Private.Uri.builds
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
<OSGroup>Windows_NT</OSGroup>
<TargetGroup>netcore50aot</TargetGroup>
</Project>
<Project Include="System.Private.Uri.csproj">
<OSGroup>Windows_NT</OSGroup>
<TargetGroup>netstandard13aot</TargetGroup>
</Project>
<Project Include="System.Private.Uri.csproj">
<OSGroup>Linux</OSGroup>
<TargetGroup>netstandard13aot</TargetGroup>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>
Expand Down
29 changes: 20 additions & 9 deletions src/System.Private.Uri/src/System.Private.Uri.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<!-- Suppress warnings for type conflicts between SafeFileHandle in partial facade and mscorlib -->
<NoWarn>0436</NoWarn>
<PackageTargetFramework Condition="'$(PackageTargetFramework)'==''">netstandard1.0</PackageTargetFramework>
<SkipCommonResourcesIncludes Condition="'$(TargetGroup)'=='netcore50aot'">true</SkipCommonResourcesIncludes>
<SkipCommonResourcesIncludes Condition="'$(TargetGroup)'=='netcore50aot' Or '$(TargetGroup)'=='netstandard13aot'">true</SkipCommonResourcesIncludes>
<NuGetTargetMoniker Condition="'$(TargetGroup)' == ''">.NETStandard,Version=v1.0</NuGetTargetMoniker>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
Expand All @@ -27,8 +27,10 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_Release|AnyCPU'"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_netcore50aot_Debug|AnyCPU'"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_netcore50aot_Release|AnyCPU'"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard13aot_Debug|AnyCPU'"/>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard13aot_Release|AnyCPU'"/>
<ItemGroup>
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.cs" Condition="'$(TargetGroup)'!='netcore50aot'">
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.cs" Condition="'$(TargetGroup)'!='netcore50aot' And '$(TargetGroup)'!='netstandard13aot'">
<Link>Common\System\Diagnostics\Debug.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Collections\Generic\LowLevelDictionary.cs">
Expand Down Expand Up @@ -77,7 +79,7 @@
<Compile Include="$(CommonPath)\System\Globalization\IdnMapping.Windows.cs">
<Link>Common\System\Globalization\IdnMapping.Windows.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.Windows.cs" Condition="'$(TargetGroup)'!='netcore50aot'">
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.Windows.cs" Condition="'$(TargetGroup)'!='netcore50aot' And '$(TargetGroup)'!='netstandard13aot'">
<Link>Common\System\Diagnostics\Debug.Windows.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.SetLastError.cs">
Expand All @@ -97,7 +99,7 @@
<Compile Include="$(CommonPath)\System\Globalization\IdnMapping.Unix.cs">
<Link>Common\System\Globalization\IdnMapping.Unix.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.Unix.cs">
<Compile Include="$(CommonPath)\System\Diagnostics\Debug.Unix.cs" Condition="'$(TargetGroup)'!='netcore50aot' And '$(TargetGroup)'!='netstandard13aot'">
<Link>Common\System\Diagnostics\Debug.Unix.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Unix\Interop.Libraries.cs">
Expand Down Expand Up @@ -146,19 +148,28 @@
<Link>Common\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcore50aot'">
<ItemGroup Condition="'$(TargetGroup)'=='netcore50aot' Or '$(TargetGroup)'=='netstandard13aot'">
<TargetingPackReference Include="System.Private.CoreLib" />
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
<Compile Include="$(CommonPath)\System\SR.Core.cs">
<Compile Include="$(CommonPath)\System\SR.Core.cs" Condition="'$(TargetGroup)'=='netcore50aot'">
<Link>Common\System\SR.Core.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\SR.CoreRT.cs" Condition="'$(TargetGroup)'=='netstandard13aot'">
<Link>Common\System\SR.CoreRT.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Resources\NeutralResourcesLanguageAttribute.cs">
<Link>Common\System\Resources\NeutralResourcesLanguageAttribute.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Runtime\InteropServices\Marshal.cs">
<Link>Common\System\Runtime\InteropServices\Marshal.cs</Link>
<Compile Include="$(CommonPath)\System\Runtime\InteropServices\Marshal.Win32.cs" Condition="'$(TargetsWindows)'=='true'">
<Link>Common\System\Runtime\InteropServices\Marshal.Win32.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\Runtime\InteropServices\Marshal.Unix.cs" Condition="'$(TargetsUnix)'=='true'">
<Link>Common\System\Runtime\InteropServices\Marshal.Unix.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\System\OperationCanceledException.cs" Condition="'$(TargetsUnix)'=='true'">
<Link>Common\System\System\OperationCanceledException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.GetLastError.cs">
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.GetLastError.cs" Condition="'$(TargetsWindows)'=='true'">
<Link>Common\Interop\Windows\mincore\Interop.GetLastError.cs</Link>
</Compile>
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/System.Private.Uri/src/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"dependencies": {
"Microsoft.TargetingPack.Private.NETNative": "1.0.0-rc3-23908"
}
},
"netstandard1.3": {
"imports": [ "netcore50" ],
"dependencies": {
"Microsoft.TargetingPack.Private.NETNative": "1.0.0-rc3-23908"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
<OSGroup>Windows_NT</OSGroup>
<TargetGroup>netcore50aot</TargetGroup>
</Project>
<Project Include="System.Runtime.Extensions.csproj">
<OSGroup>Windows_NT</OSGroup>
<TargetGroup>netstandard13aot</TargetGroup>
</Project>
<Project Include="System.Runtime.Extensions.csproj">
<OSGroup>Linux</OSGroup>
<TargetGroup>netstandard13aot</TargetGroup>
</Project>
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />
</Project>
Expand Down
28 changes: 19 additions & 9 deletions src/System.Runtime.Extensions/src/System.Runtime.Extensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<PackageTargetFramework Condition="'$(PackageTargetFramework)' == ''">netstandard1.3</PackageTargetFramework>
<PackageTargetRuntime Condition="'$(TargetsWindows)' == 'true' And '$(TargetGroup)' != 'net46'">win7</PackageTargetRuntime >
<PackageTargetRuntime Condition="'$(TargetsUnix)' == 'true'">unix</PackageTargetRuntime >
<PackageTargetRuntime Condition="'$(TargetsWindows)' == 'true' And '$(TargetGroup)' == 'netstandard13aot'">win-aot</PackageTargetRuntime >
<PackageTargetRuntime Condition="'$(TargetsUnix)' == 'true' And '$(TargetGroup)' == 'netstandard13aot'">unix-aot</PackageTargetRuntime >
<CoreClrOrCorRt Condition="'$(TargetGroup)' == '' Or '$(TargetGroup)' == 'netstandard13aot'">true</CoreClrOrCorRt>
</PropertyGroup>

<!-- Default configurations to help VS understand the configurations -->
Expand All @@ -32,8 +35,10 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net46_Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_netcore50aot_Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Windows_netcore50aot_Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard13aot_Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard13aot_Release|AnyCPU'" />

<PropertyGroup Condition="'$(TargetGroup)' == 'netcore50aot'">
<PropertyGroup Condition="'$(TargetGroup)' == 'netcore50aot' Or '$(TargetGroup)' == 'netstandard13aot'">
<SkipCommonResourcesIncludes>true</SkipCommonResourcesIncludes>
<ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile>
</PropertyGroup>
Expand Down Expand Up @@ -112,7 +117,7 @@
</ItemGroup>

<!-- WINDOWS: CoreCLR -->
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' And '$(TargetGroup)' == ''">
<ItemGroup Condition=" '$(TargetsWindows)' == 'true' And '$(CoreClrOrCorRt)' == 'true'">
<Compile Include="System\IO\Path.Win32.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs">
<Link>Common\Interop\Windows\BCrypt\Interop.BCryptGenRandom.cs</Link>
Expand Down Expand Up @@ -162,15 +167,16 @@
</ItemGroup>

<!-- WINDOWS: .NET Native -->
<ItemGroup Condition="'$(TargetGroup)' == 'netcore50aot'">
<ItemGroup Condition="'$(TargetGroup)' == 'netcore50aot' Or '$(TargetGroup)' == 'netstandard13aot'">
<Compile Include="System\Random.cs" />
<Compile Include="System\Net\Configuration\UnicodeDecodingConformance.cs" />
<Compile Include="System\Net\Configuration\UnicodeEncodingConformance.cs" />
<Compile Include="System\IO\LowLevelTextWriter.cs" />
<Compile Include="System\IO\LowLevelStringWriter.cs" />
<Compile Include="System\IO\Path.WinRT.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.GetLastError.cs" />
<Compile Include="$(CommonPath)\System\SR.Core.cs" />
<Compile Include="System\IO\Path.WinRT.cs" Condition="'$(TargetGroup)' == 'netcore50aot' And '$(TargetsWindows)'=='true'"/>
<Compile Include="$(CommonPath)\Interop\Windows\mincore\Interop.GetLastError.cs" Condition="'$(TargetsWindows)'=='true'"/>
<Compile Include="$(CommonPath)\System\SR.Core.cs" Condition="'$(TargetGroup)' == 'netcore50aot' And '$(TargetsWindows)'=='true'"/>
<Compile Include="$(CommonPath)\System\SR.CoreRT.cs" Condition="'$(TargetGroup)' == 'netstandard13aot' Or '$(TargetsUnix)'=='true'"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetGroup)' == ''">
Expand All @@ -183,14 +189,18 @@
<TargetingPackReference Include="System" />
</ItemGroup>

<ItemGroup Condition="'$(TargetGroup)' == 'netcore50aot'">
<ItemGroup Condition="'$(TargetGroup)' == 'netcore50aot' Or '$(TargetGroup)' == 'netstandard13aot'">
<TargetingPackReference Include="System.Private.CoreLib" />
<TargetingPackReference Include="System.Private.CoreLib.InteropServices" />
<TargetingPackReference Include="System.Private.Interop" />
<TargetingPackReference Include="System.Private.Threading" />
<ProjectReference Include="$(SourceDir)/mscorlib.WinRT-Facade/mscorlib.WinRT-Facade.csproj" />
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
<ProjectReference Include="$(SourceDir)/mscorlib.WinRT-Facade/mscorlib.WinRT-Facade.csproj" Condition="'$(TargetGroup)' == 'netcore50aot'"/>
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" >
<TargetGroup>netcore50aot</TargetGroup>
</ProjectReference>
<ProjectReference Include="..\..\System.Private.Uri\src\System.Private.Uri.csproj" />
<ValidateIgnoreReference Include="@(TargetingPackReference)" Condition="'$(TargetGroup)' == 'netstandard13aot'"/>
<ValidateIgnoreReference Include="System.Private.Uri" Condition="'$(TargetGroup)' == 'netstandard13aot'"/>
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/System.Runtime.Extensions/src/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
"Microsoft.TargetingPack.Private.NETNative": "1.0.0-rc3-23908",
"Microsoft.TargetingPack.Private.WinRT": "1.0.1"
}
},
"netstandard1.3": {
"imports": [ "netcore50" ],
"dependencies": {
"Microsoft.TargetingPack.Private.NETNative": "1.0.0-rc3-23908"
}
}
}
}