6. [Configuration Options](#configuration-options)
7. [Working with Submodules](#working-with-submodules)
-**Build Status**
-
-Officially supported architectures:
-
-| ubuntu-1404-amd64 | ubuntu-1404-i386 | debian-8-armel | debian-8-armhf | debian-8-arm64 | windows-amd64 |
-|------------------------------|-----------------------------|---------------------------|---------------------------|-----------------------------|----------------------------|
-| [![ubuntu-1404-amd64][1]][2] | [![ubuntu-1404-i386][3]][4] | [![debian-8-armel][5]][6] | [![debian-8-armhf][7]][8] | [![debian-8-arm64][9]][10] | [![windows-amd64][11]][12] |
-
-Community supported architectures:
-
-| centos-s390x |
-|---------------------------|
-| [![centos-s390x][13]][14] |
+### Build Status
+
+| OS | Architecture | Status |
+|--------------|--------------------|------------------------------|
+| Ubuntu 14.04 | amd64 | [![ubuntu-1404-amd64][1]][2] |
+| Ubuntu 14.04 | i386 | [![ubuntu-1404-i386][3]][4] |
+| Debian 8 | armel | [![debian-8-armel][5]][6] |
+| Debian 8 | armhf | [![debian-8-armhf][7]][8] |
+| Debian 8 | arm64 | [![debian-8-arm64][9]][10] |
+| OS X | amd64 | [![osx-amd64][11]][12] |
+| OS X | i386 | [![osx-i386][13]][14] |
+| Windows | amd64 | [![windows-amd64][15]][16] |
+| Windows | i386 | [![windows-amd64][17]][18] |
+| CentOS | s390x (cs) | [![centos-s390x][19]][20] |
+
+_(cs) = community supported architecture_
[1]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64/badge/icon
[2]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=ubuntu-1404-amd64
[8]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-armhf/
[9]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/badge/icon
[10]: https://jenkins.mono-project.com/job/test-mono-mainline-linux/label=debian-8-arm64/
-[11]: https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true
-[12]: https://ci.appveyor.com/project/ajlennon/mono-817/branch/master
-[13]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
-[14]: https://jenkins.mono-project.com/job/z/label=centos-s390x
+[11]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/badge/icon
+[12]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-amd64/
+[13]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/badge/icon
+[14]: https://jenkins.mono-project.com/job/test-mono-mainline/label=osx-i386/
+[15]: https://jenkins.mono-project.com/job/z/label=w64/badge/icon
+[16]: https://jenkins.mono-project.com/job/z/label=w64/
+[17]: https://jenkins.mono-project.com/job/z/label=w32/badge/icon
+[18]: https://jenkins.mono-project.com/job/z/label=w32/
+[19]: https://jenkins.mono-project.com/job/z/label=centos-s390x/badge/icon
+[20]: https://jenkins.mono-project.com/job/z/label=centos-s390x
Compilation and Installation
============================
+++ /dev/null
-#
-# Appveyor configuration file for CI build of Mono on Windows (under Cygwin)
-#
-# For further details see http://www.appveyor.com
-#
-
-#
-# Custom environment variables
-#
-environment:
- global:
- CYG_ROOT: C:\cygwin
- CYG_MIRROR: http://cygwin.mirror.constant.com
- CYG_CACHE: C:\cygwin\var\cache\setup
- CYG_BASH: C:\cygwin\bin\bash
-
-#
-# Cache Cygwin files to speed up build
-#
-cache:
- - '%CYG_CACHE%'
-
-#
-# Do a shallow clone of the repo to speed up build
-#
-clone_depth: 1
-
-#
-# Initialisation prior to pulling the Mono repository
-# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
-#
-init:
- - git config --global core.autocrlf input
-
-#
-# Install needed build dependencies
-#
-install:
- - ps: 'Start-FileDownload "http://cygwin.com/setup-x86.exe" -FileName "setup-x86.exe"'
- - 'setup-x86.exe --quiet-mode --no-shortcuts --only-site --root "%CYG_ROOT%" --site "%CYG_MIRROR%" --local-package-dir "%CYG_CACHE%" --packages autoconf,automake,bison,gcc-core,gcc-g++,mingw-runtime,mingw-binutils,mingw-gcc-core,mingw-gcc-g++,mingw-pthreads,mingw-w32api,libtool,make,python,gettext-devel,gettext,intltool,libiconv,pkg-config,git,curl,libxslt > NUL 2>&1'
- - '%CYG_BASH% -lc "cygcheck -dc cygwin"'
-
-# Cygwin build script
-#
-# NOTES:
-#
-# The stdin/stdout file descriptor appears not to be valid for the Appveyor
-# build which causes failures as certain functions attempt to redirect
-# default file handles. Ensure a dummy file descriptor is opened with 'exec'.
-#
-build_script:
- - 'echo Building...'
- - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; ./autogen.sh --prefix=/usr/local --host=i686-pc-mingw32"'
- - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make get-monolite-latest"'
- - '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make -j2"'
- - 'echo Installing...'
- - 'mkdir %APPVEYOR_BUILD_FOLDER%\install'
- - '%CYG_BASH% -lc "export CYGWIN=winsymlinks:native; mount \"$APPVEYOR_BUILD_FOLDER\install\" /usr/local; cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; make install; umount /usr/local"'
-
-#
-# Disable tests for now
-#
-test: off
-
-#
-# Only build the master branch
-#
-branches:
- only:
- - master
-
-#
-# NOTE: Currently this is the Mono installation tree. In future we will create an installation package artifact.
-# It has to be relative to the project path. Thus we have installed to within the build tree.
-#
-artifacts:
- - path: install
- name: mono-binaries
- type: zip
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/types.h>
+#include <direct.h>
#ifdef G_OS_WIN32
#include <io.h>
return fd;
}
+gchar *
+g_mkdtemp (char *tmp_template)
+{
+ gunichar2* utf16_template;
+
+ utf16_template = u8to16 (tmp_template);
+
+ utf16_template = _wmktemp(utf16_template);
+ if (utf16_template && *utf16_template) {
+ if (_wmkdir (utf16_template) == 0){
+ char *ret = u16to8 (utf16_template);
+ g_free (utf16_template);
+ return ret;
+ }
+ }
+
+ g_free (utf16_template);
+ return NULL;
+}
+
#ifdef _MSC_VER
#pragma warning(disable:4701)
#endif
#define g_ascii_strtod strtod
#define g_ascii_isalnum isalnum
+#ifdef WIN32
+gchar *g_mkdtemp (gchar *tmpl);
+#else
+#define g_mkdtemp mkdtemp
+#endif
+
/*
* Pattern matching
*/
Or you can use a comma delimited list of the workds CJK, MidWest,
Other, Rare and West to specificy which encoding assemblies to distribute.
.TP
-.TP
.I "-L path"
Adds the `path' do the search list for assemblies. The rules are the
same as for the compiler -lib: or -L flags.
+.TP
+.I "--library [LIB,]PATH"
+Embeds the dynamic library file pointed to by `PATH' and optionally
+give it the name `LIB' into the bundled executable. This is used to
+ship native library dependencies that are unpacked at startup and
+loaded from the runtime.
+.TP
.I "--lists-targets"
Lists all of the available local cross compilation targets available
as precompiled binaries on the Mono distribution server.
if (!Version.TryParse (field.GetValue (null) as string, out version))
return 4;
- if (version < new Version (3, 8))
+ if (version < new Version (4, 0))
return 5;
return 0;
System.Xml.Serialization \
Mono.CSharp \
Microsoft.CSharp \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation \
System.Reflection.DispatchProxy \
System.Xml.XPath.XmlDocument \
System.Data.Linq \
System.Net.Http \
System.Net.Http.WebRequest \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.OldTls \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation \
System.Reflection.Context \
System.Net.Http.WinHttpHandler \
System.Web.Http \
System.Web.Http.SelfHost \
System.Web.Http.WebHost \
- Mono.Security.Providers.NewSystemSource \
- Mono.Security.Providers.NewTls \
System.Runtime.InteropServices.RuntimeInformation
# These are the subdirs which depends on libs in net_4_x_dirs
System.ComponentModel.Composition.4.5 \
System.Windows \
System.Xml.Serialization \
- Mono.Security.Providers.DotNet \
- Mono.Security.Providers.OldTls \
System.DirectoryServices.Protocols \
RabbitMQ.Client \
Microsoft.VisualC \
{
if (!string.IsNullOrEmpty (ToolPath))
return Path.Combine (ToolPath, ToolExe);
- return ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+ var possibleToolPath = ToolLocationHelper.GetPathToDotNetFrameworkFile (ToolExe, TargetDotNetFrameworkVersion.VersionLatest);
+ if (!string.IsNullOrEmpty(possibleToolPath))
+ return possibleToolPath;
+ return ToolLocationHelper.GetPathToDotNetFrameworkBinFile(ToolExe);
}
[MonoTODO]
module.SetDeclaringAssembly (temp);
var importer = new Compiler.ReflectionImporter (module, cc.BuiltinTypes) {
- IgnorePrivateMembers = false
+ IgnorePrivateMembers = false,
+ IgnoreCompilerGeneratedField = false
};
// Import all currently loaded assemblies
* with newer runtimes, and vice versa.
*/
internal const int MAJOR_VERSION = 2;
- internal const int MINOR_VERSION = 43;
+ internal const int MINOR_VERSION = 44;
enum WPSuspendPolicy {
NONE = 0,
GET_THIS = 2,
SET_VALUES = 3,
GET_DOMAIN = 4,
+ SET_THIS = 5,
}
enum CmdArrayRef {
return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId ();
}
+ internal void StackFrame_SetThis (long thread_id, long id, ValueImpl value) {
+ SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_THIS, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteValue (value));
+ }
+
/*
* ARRAYS
*/
return vm.DecodeValue (vm.conn.StackFrame_GetThis (thread.Id, Id));
}
+ // Since protocol version 2.44
+ public void SetThis (Value value) {
+ if (value == null)
+ throw new ArgumentNullException ("value");
+ if (Method.IsStatic || !Method.DeclaringType.IsValueType)
+ throw new InvalidOperationException ("The frame's method needs to be a valuetype instance method.");
+ vm.conn.StackFrame_SetThis (thread.Id, Id, vm.EncodeValue (value));
+ }
+
public void SetValue (LocalVariable var, Value value) {
if (var == null)
throw new ArgumentNullException ("var");
AssertValue ("T", s ["s"]);
AssertValue (45, s ["k"]);
+ // Test SetThis ()
+ s ["i"] = vm.CreateValue (55);
+ frame.SetThis (s);
+ obj = frame.GetThis ();
+ Assert.IsTrue (obj is StructMirror);
+ s = obj as StructMirror;
+ AssertValue (55, s ["i"]);
+ AssertValue ("T", s ["s"]);
+ AssertValue (45, s ["k"]);
+
// this on static vtype methods
e = run_until ("vtypes3");
e = step_until (e.Thread, "static_foo");
+++ /dev/null
-thisdir = class/Mono.Security.Providers.DotNet
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.DotNet.dll
-LIB_REFS = System Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
-
-EXTRA_DISTFILES = README.md
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{391EDD2B-85AC-4FCA-B607-AAD6C51E6799}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.DotNet</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include=".\Mono.Security.Providers.DotNet\DotNetSslStreamImpl.cs" />\r
- <Compile Include=".\Mono.Security.Providers.DotNet\DotNetTlsProvider.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-./Mono.Security.Providers.DotNet/DotNetTlsProvider.cs
-./Mono.Security.Providers.DotNet/DotNetSslStreamImpl.cs
+++ /dev/null
-//
-// DotNetSslStreamImpl.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Threading.Tasks;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using System.Security.Principal;
-using System.Security.Cryptography;
-using MSI = Mono.Security.Interface;
-
-namespace Mono.Security.Providers.DotNet
-{
- class DotNetSslStreamImpl : MSI.IMonoSslStream
- {
- DotNetTlsProvider provider;
- SslStream impl;
-
- internal SslStream Impl {
- get {
- CheckDisposed ();
- return impl;
- }
- }
-
- public DotNetSslStreamImpl (
- Stream innerStream, bool leaveInnerStreamOpen, DotNetTlsProvider provider,
- RemoteCertificateValidationCallback userCertificateValidationCallback,
- LocalCertificateSelectionCallback userCertificateSelectionCallback)
- {
- this.provider = provider;
- impl = new SslStream (
- innerStream, leaveInnerStreamOpen,
- userCertificateValidationCallback,
- userCertificateSelectionCallback);
- }
-
- public void AuthenticateAsClient (string targetHost)
- {
- Impl.AuthenticateAsClient (targetHost);
- }
-
- public void AuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, asyncCallback, asyncState);
- }
-
- public IAsyncResult BeginAuthenticateAsClient (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
-
- public void EndAuthenticateAsClient (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsClient (asyncResult);
- }
-
- public void AuthenticateAsServer (X509Certificate serverCertificate)
- {
- Impl.AuthenticateAsServer (serverCertificate);
- }
-
- public void AuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- Impl.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, asyncCallback, asyncState);
- }
-
- public IAsyncResult BeginAuthenticateAsServer (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginAuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation, asyncCallback, asyncState);
- }
-
- public void EndAuthenticateAsServer (IAsyncResult asyncResult)
- {
- Impl.EndAuthenticateAsServer (asyncResult);
- }
-
- public Task AuthenticateAsClientAsync (string targetHost)
- {
- return Impl.AuthenticateAsClientAsync (targetHost);
- }
-
- public Task AuthenticateAsClientAsync (string targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsClientAsync (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public Task AuthenticateAsServerAsync (X509Certificate serverCertificate)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate);
- }
-
- public Task AuthenticateAsServerAsync (X509Certificate serverCertificate, bool clientCertificateRequired, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- return Impl.AuthenticateAsServerAsync (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- }
-
- public void Flush ()
- {
- Impl.Flush ();
- }
-
- public int Read (byte[] buffer, int offset, int count)
- {
- return Impl.Read (buffer, offset, count);
- }
-
- public void Write (byte[] buffer)
- {
- Impl.Write (buffer);
- }
-
- public void Write (byte[] buffer, int offset, int count)
- {
- Impl.Write (buffer, offset, count);
- }
-
- public IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginRead (buffer, offset, count, asyncCallback, asyncState);
- }
-
- public int EndRead (IAsyncResult asyncResult)
- {
- return Impl.EndRead (asyncResult);
- }
-
- public IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
- {
- return Impl.BeginWrite (buffer, offset, count, asyncCallback, asyncState);
- }
-
- public void EndWrite (IAsyncResult asyncResult)
- {
- Impl.EndWrite (asyncResult);
- }
-
- public TransportContext TransportContext {
- get { throw new NotSupportedException (); }
- }
-
- public bool IsAuthenticated {
- get { return Impl.IsAuthenticated; }
- }
-
- public bool IsMutuallyAuthenticated {
- get { return Impl.IsMutuallyAuthenticated; }
- }
-
- public bool IsEncrypted {
- get { return Impl.IsEncrypted; }
- }
-
- public bool IsSigned {
- get { return Impl.IsSigned; }
- }
-
- public bool IsServer {
- get { return Impl.IsServer; }
- }
-
- public CipherAlgorithmType CipherAlgorithm {
- get { return Impl.CipherAlgorithm; }
- }
-
- public int CipherStrength {
- get { return Impl.CipherStrength; }
- }
-
- public HashAlgorithmType HashAlgorithm {
- get { return Impl.HashAlgorithm; }
- }
-
- public int HashStrength {
- get { return Impl.HashStrength; }
- }
-
- public ExchangeAlgorithmType KeyExchangeAlgorithm {
- get { return Impl.KeyExchangeAlgorithm; }
- }
-
- public int KeyExchangeStrength {
- get { return KeyExchangeStrength; }
- }
-
- public bool CanRead {
- get { return Impl.CanRead; }
- }
-
- public bool CanTimeout {
- get { return Impl.CanTimeout; }
- }
-
- public bool CanWrite {
- get { return Impl.CanWrite; }
- }
-
- public long Length {
- get { return Impl.Length; }
- }
-
- public long Position {
- get { return Impl.Position; }
- }
-
- public void SetLength (long value)
- {
- Impl.SetLength (value);
- }
-
- public AuthenticatedStream AuthenticatedStream {
- get { return Impl; }
- }
-
- public int ReadTimeout {
- get { return Impl.ReadTimeout; }
- set { Impl.ReadTimeout = value; }
- }
-
- public int WriteTimeout {
- get { return Impl.WriteTimeout; }
- set { Impl.WriteTimeout = value; }
- }
-
- public bool CheckCertRevocationStatus {
- get { return Impl.CheckCertRevocationStatus; }
- }
-
- public X509Certificate InternalLocalCertificate {
- get {
- try {
- return LocalCertificate;
- } catch {
- return null;
- }
- }
- }
-
- public X509Certificate LocalCertificate {
- get { return Impl.LocalCertificate; }
- }
-
- public X509Certificate RemoteCertificate {
- get { return Impl.RemoteCertificate; }
- }
-
- public SslProtocols SslProtocol {
- get { return Impl.SslProtocol; }
- }
-
- MSI.MonoTlsProvider MSI.IMonoSslStream.Provider {
- get { return provider; }
- }
-
- MSI.MonoTlsConnectionInfo MSI.IMonoSslStream.GetConnectionInfo ()
- {
- return null;
- }
-
- void CheckDisposed ()
- {
- if (impl == null)
- throw new ObjectDisposedException ("MonoSslStream");
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected void Dispose (bool disposing)
- {
- if (impl != null && disposing) {
- impl.Dispose ();
- impl = null;
- }
- }
- }
-}
-
+++ /dev/null
-//
-// MonoDefaultTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using Mono.Security.Interface;
-
-namespace Mono.Security.Providers.DotNet
-{
- /*
- * This provider only uses the public .NET APIs from System.dll.
- *
- * It is primarily intended for testing.
- */
- public class DotNetTlsProvider : MonoTlsProvider
- {
- static readonly Guid id = new Guid ("3a7b3a26-0dbd-4572-a5b8-fdce766bf0dd");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "dotnet"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return false; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return false; }
- }
-
- internal override bool SupportsTlsContext {
- get { return false; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return (SslProtocols)ServicePointManager.SecurityProtocol; }
- }
-
- public override IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsSettings settings = null)
- {
- if (settings != null)
- throw new NotSupportedException ("Mono-specific API Extensions not available.");
-
- RemoteCertificateValidationCallback validation_callback = null;
- LocalCertificateSelectionCallback selection_callback = null;
-
- if (settings != null) {
- validation_callback = ConvertCallback (settings.RemoteCertificateValidationCallback);
- selection_callback = ConvertCallback (settings.ClientCertificateSelectionCallback);
- }
-
- return new DotNetSslStreamImpl (innerStream, leaveInnerStreamOpen, this, validation_callback, selection_callback);
- }
-
- internal override IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, TlsProtocols protocolFlags,
- X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
- MonoTlsSettings settings)
- {
- throw new NotSupportedException ();
- }
-
- internal static RemoteCertificateValidationCallback ConvertCallback (MonoRemoteCertificateValidationCallback callback)
- {
- if (callback == null)
- return null;
-
- return (s, c, ch, e) => callback (null, c, ch, (MonoSslPolicyErrors)e);
- }
-
- internal static LocalCertificateSelectionCallback ConvertCallback (MonoLocalCertificateSelectionCallback callback)
- {
- if (callback == null)
- return null;
-
- return (s, t, lc, rc, ai) => callback (t, lc, rc, ai);
- }
-
- }
-}
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.DotNet.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.DotNet.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
+++ /dev/null
-See mcs/class/Mono.Security.Providers.NewSystemSource/README.md for a detailed README.
+++ /dev/null
-thisdir = class/Mono.Security.Providers.NewSystemSource
-SUBDIRS =
-include ../../build/rules.make
-
-LIB_REFS = System
-
-LIBRARY = Mono.Security.Providers.NewSystemSource.dll
-
-LIB_MCS_FLAGS = -d:SECURITY_DEP \
- -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:MONO -d:FEATURE_PAL -d:MONO_FEATURE_NEW_TLS \
- -d:MONO_FEATURE_NEW_SYSTEM_SOURCE -d:DISABLE_CAS_USE
-
-ifdef MOBILE_PROFILE
-LIB_REFS += Mono.Security
-else
-LIB_REFS += MonoSecurity=Mono.Security
-LIB_MCS_FLAGS += -d:MONO_SECURITY_ALIAS
-endif
-
-EXTRA_DISTFILES = README.md
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.NewSystemSource</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE;MONO_SECURITY_ALIAS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP;MONO;FEATURE_PAL;MONO_FEATURE_NEW_TLS;MONO_FEATURE_NEW_SYSTEM_SOURCE;DISABLE_CAS_USE;MONO_SECURITY_ALIAS</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\SR.cs" />\r
- <Compile Include="..\referencesource\mscorlib\InternalApis\NDP_Common\inc\PinnableBufferCache.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_LazyAsyncResult.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_LoggingObject.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_NTAuthentication.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_SecureChannel.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\_SslSessionsCache.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\Logging.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_FixedSizeReader.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_HelperAsyncResults.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_SslState.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\_SslStream.cs" />\r
- <Compile Include="..\referencesource\System\net\System\Net\SecureProtocols\SslStream.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\CallbackHelpers.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\IMonoTlsProvider.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\MonoTlsProviderFactory.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\MonoTlsProviderWrapper.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SslState.cs" />\r
- <Compile Include="..\System\ReferenceSources\_SslStream.cs" />\r
- <Compile Include="..\System\ReferenceSources\Internal.cs" />\r
- <Compile Include="..\System\ReferenceSources\SR.cs" />\r
- <Compile Include="..\System\ReferenceSources\SR2.cs" />\r
- <Compile Include="..\System\ReferenceSources\SslStream.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="..\System\ReferenceSources\SSPIWrapper.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- <Aliases>MonoSecurity</Aliases> </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/SR.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-../referencesource/System/net/System/Net/Logging.cs
-../referencesource/System/net/System/Net/_SslSessionsCache.cs
-../referencesource/System/net/System/Net/_LazyAsyncResult.cs
-../referencesource/System/net/System/Net/_LoggingObject.cs
-../referencesource/System/net/System/Net/_NTAuthentication.cs
-../referencesource/System/net/System/Net/_SecureChannel.cs
-../referencesource/System/net/System/Net/SecureProtocols/SslStream.cs
-../referencesource/System/net/System/Net/SecureProtocols/_SslState.cs
-../referencesource/System/net/System/Net/SecureProtocols/_SslStream.cs
-../referencesource/System/net/System/Net/SecureProtocols/_FixedSizeReader.cs
-../referencesource/System/net/System/Net/SecureProtocols/_HelperAsyncResults.cs
-../referencesource/mscorlib/InternalApis/NDP_Common/inc/PinnableBufferCache.cs
-
-../System/ReferenceSources/SR.cs
-../System/ReferenceSources/SR2.cs
-../System/ReferenceSources/Internal.cs
-../System/ReferenceSources/SSPIWrapper.cs
-../System/ReferenceSources/SSPISafeHandles.cs
-../System/ReferenceSources/SslStream.cs
-../System/ReferenceSources/_SslState.cs
-../System/ReferenceSources/_SslStream.cs
-../System/ReferenceSources/_SecureChannel.cs
-../System/ReferenceSources/SSPIConfiguration.cs
-../System/Mono.Net.Security/CallbackHelpers.cs
-../System/Mono.Net.Security/IMonoTlsProvider.cs
-../System/Mono.Net.Security/MonoTlsProviderFactory.cs
-../System/Mono.Net.Security/MonoTlsProviderWrapper.cs
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.NewSystemSource.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.NewSystemSource.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000003336d6aed41624ca156ab579881fe90a576f1dfec48378fc94e4e440f4556776224e2d70c18996d91f36227f539fdb44340e07651f1455a489b29a7e6219a8f85e52b0f8588b4f8a857746a8468d37b556223d1452f3fcbaf0f269cdf1900ceb68f69485dc5887750d19571030c732331e00387d9b813a9ad52891087301793")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
+++ /dev/null
-Mono.Security.Interface / Mono.Security.Providers
-=================================================
-
-This is not a public API yet, but will eventually become public.
-
-
-Mono.Security.Interface
------------------------
-
-`Mono.Security.Interface` provides an abstraction layer for the TLS
-APIs that are currently being used by Mono's class libraries.
-
-The main API entry points are `MonoTlsProviderFactory.GetProvider()`
-and `MonoTlsProviderFactory.InstallProvider()`.
-
-Mono.Net.Security
------------------
-
-`Mono.Net.Security` provides the internal implementation and lives
-inside `System.dll` as private and internal APIs. `Mono.Security.dll`
-uses reflection to access these.
-
-On Mobile, the `Mono.Security.Interface` APIs are included as public
-APIs in `System.dll`.
-
-Mono.Security.Providers
------------------------
-
-Implementations of the `Mono.Security.Interface.MonoTlsProvider` class
-to provide TLS functionality.
-
-The default provider is inside `System.dll` - it will be used automatically
-if you don't explicitly install a custom provider, so simply call
-`MonoTlsProviderFactory.GetProvider()` to use it.
-
-* DotNet:
- Provides the default `SslStream` implementation from `System.dll`, only using
- public .NET types.
-
-* NewSystemSource:
- Compiles several referencesource files which would normally live inside
- `System.dll` if we compiled it with their `SslStream` implementation.
-
- This allows to keep the code in `System.dll` as-is, while still providing the
- new `SslStream`, which will be required by the new TLS code.
-
- `System.dll` needs to make its internals visible and we're using several compiler /
- external alias tricks in here to make this work.
-
- In this configuration, `MONO_SYSTEM_ALIAS`, `MONO_FEATURE_NEW_TLS` and
- `MONO_FEATURE_NEW_SYSTEM_SOURCE` (defining conditional for this configuration)
- are defined. We do not define `MONO_X509_ALIAS here`.
-
-The `Mono.Security.Providers.DotNet` and `Mono.Security.Providers.NewSystemSource` directory is currently
-enabled in the top-level `Makefile`, but the resulting binaries should only be used to test the new TLS
-code and not shipped as stable APIs.
-
-Pending changes
----------------
-
-This code is not actually being used in `System.dll` yet. I have some
-local changes which will switch the existing code in `WebClient`,
-`SmptClient` and `FtpWebRequest` over, but these need to be carefully
-tested.
-
-At the moment, this work branch only provides new code and build
-changes, which shuffle some stuff around. There are also several
-new files which are conditional and not actually being built by
-default.
-
-Build Configurations
---------------------
-
-* Normal build:
- Builds everything as before with some new APIs added, but without
- modifying any existing functionality.
-
-* Build with the `newtls` profile:
- Builds `System.dll` with the new `SslStream` implementation from the
- referencesource. This is currently a "build then throw away" profile
- and not enabled from the top-level Makefile. The resulting `System.dll`
- won't actually work at runtime since it's missing the new TLS code;
- building it helps find problems and ensures that it will actually
- be possible to build this once we deploy it.
-
-* Mono.Security.Providers:
- The new TLS code requires the newly built `System` and `Mono.Security.Providers.NewSystemSource`
- from this branch installed in the system. It is recommended to install it
- into a custom prefix and set that as custom runtime in Xamarin Studio.
-
-
-Last changed March 07th, 2015,
-Martin Baulig <martin.baulig@xamarin.com>
-
-
+++ /dev/null
-thisdir = class/Mono.Security.Providers.NewTls
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.NewTls.dll
-LIB_REFS = System NewSystemSource=Mono.Security.Providers.NewSystemSource Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{C8B8E524-BB3A-44E2-8C22-E3313E9F477C}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.NewTls</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\SR.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\ITlsConfiguration.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\ITlsContext.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\MonoNewTlsStream.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\MonoNewTlsStreamFactory.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\NewTlsProvider.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\TlsContextWrapper.cs" />\r
- <Compile Include=".\Mono.Security.Providers.NewTls\TlsProviderFactory.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj">\r
- <Project>{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}</Project>\r
- <Name>Mono.Security.Providers.NewSystemSource-net_4_x</Name>\r
- <Aliases>NewSystemSource</Aliases> </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/SR.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-
-./Mono.Security.Providers.NewTls/ITlsConfiguration.cs
-./Mono.Security.Providers.NewTls/ITlsContext.cs
-
-./Mono.Security.Providers.NewTls/MonoNewTlsStream.cs
-./Mono.Security.Providers.NewTls/MonoNewTlsStreamFactory.cs
-./Mono.Security.Providers.NewTls/NewTlsProvider.cs
-./Mono.Security.Providers.NewTls/TlsContextWrapper.cs
-./Mono.Security.Providers.NewTls/TlsProviderFactory.cs
+++ /dev/null
-//
-// ITlsContext.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System;
-using System.Security.Cryptography;
-
-using Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- interface ITlsConfiguration
- {
- bool HasCredentials {
- get;
- }
-
- void SetCertificate (MX.X509Certificate certificate, AsymmetricAlgorithm privateKey);
-
- bool? AskForClientCertificate {
- get; set;
- }
- }
-}
+++ /dev/null
-//
-// ITlsContext.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.Security.Cryptography;
-
-using Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- interface ITlsContext : IDisposable
- {
- bool IsValid {
- get;
- }
-
- TlsException LastError {
- get;
- }
-
- bool ReceivedCloseNotify {
- get;
- }
-
- MonoTlsConnectionInfo ConnectionInfo {
- get;
- }
-
- MX.X509Certificate GetRemoteCertificate (out MX.X509CertificateCollection remoteCertificateStore);
-
- bool VerifyRemoteCertificate ();
-
- int GenerateNextToken (TlsBuffer incoming, TlsMultiBuffer outgoing);
-
- int DecryptMessage (ref TlsBuffer incoming);
-
- int EncryptMessage (ref TlsBuffer incoming);
-
- byte[] CreateAlert (Alert alert);
-
- byte[] CreateHelloRequest ();
- }
-}
-
+++ /dev/null
-//
-// MonoNewTlsStream.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using EncryptionPolicy = NewSystemSource::System.Net.Security.EncryptionPolicy;
-using LocalCertificateSelectionCallback = NewSystemSource::System.Net.Security.LocalCertificateSelectionCallback;
-using RemoteCertificateValidationCallback = NewSystemSource::System.Net.Security.RemoteCertificateValidationCallback;
-using SslStream = NewSystemSource::System.Net.Security.SslStream;
-
-using System;
-using System.IO;
-using System.Threading.Tasks;
-
-using MSI = Mono.Security.Interface;
-
-using XAuthenticatedStream = System.Net.Security.AuthenticatedStream;
-using System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public class MonoNewTlsStream : SslStream, MSI.IMonoSslStream
- {
- MSI.MonoTlsProvider provider;
-
- internal MonoNewTlsStream (Stream innerStream, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
- : this (innerStream, false, provider, settings)
- {
- }
-
- internal MonoNewTlsStream (Stream innerStream, bool leaveOpen, MSI.MonoTlsProvider provider, MSI.MonoTlsSettings settings)
- : base (innerStream, leaveOpen, EncryptionPolicy.RequireEncryption, provider, settings)
- {
- this.provider = provider;
- }
-
- public MSI.MonoTlsProvider Provider {
- get { return provider; }
- }
-
- new public bool IsClosed {
- get { return base.IsClosed; }
- }
-
- public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
- {
- return GetMonoConnectionInfo ();
- }
-
- public Task Shutdown ()
- {
- return Task.Factory.FromAsync ((state, result) => BeginShutdown (state, result), EndShutdown, null);
- }
-
- public Task RequestRenegotiation ()
- {
- return Task.Factory.FromAsync ((state, result) => BeginRenegotiate (state, result), EndRenegotiate, null);
- }
-
- X509Certificate MSI.IMonoSslStream.InternalLocalCertificate {
- get { return InternalLocalCertificate; }
- }
-
- XAuthenticatedStream MSI.IMonoSslStream.AuthenticatedStream {
- get { return this; }
- }
- }
-}
-
-
+++ /dev/null
-//
-// MonoNewTlsStreamFactory.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using XEncryptionPolicy = NewSystemSource::System.Net.Security.EncryptionPolicy;
-using XSslPolicyErrors = NewSystemSource::System.Net.Security.SslPolicyErrors;
-using XLocalCertificateSelectionCallback = NewSystemSource::System.Net.Security.LocalCertificateSelectionCallback;
-using XRemoteCertificateValidationCallback = NewSystemSource::System.Net.Security.RemoteCertificateValidationCallback;
-
-using System;
-using System.IO;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using Mono.Security.Interface;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public static class MonoNewTlsStreamFactory
- {
- internal static IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsProvider provider, MonoTlsSettings settings = null)
- {
- return new MonoNewTlsStream (innerStream, leaveInnerStreamOpen, provider, settings);
- }
-
- public static MonoNewTlsStream CreateServer (
- Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
- SSCX.X509Certificate serverCertificate, bool clientCertificateRequired,
- SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- var stream = new MonoNewTlsStream (innerStream, leaveOpen, provider, settings);
-
- try {
- stream.AuthenticateAsServer (serverCertificate, clientCertificateRequired, enabledSslProtocols, checkCertificateRevocation);
- } catch (Exception ex) {
- var tlsEx = stream.LastError;
- if (tlsEx != null)
- throw new AggregateException (ex, tlsEx);
- throw;
- }
-
- return stream;
- }
-
- public static MonoNewTlsStream CreateClient (
- Stream innerStream, bool leaveOpen, MonoTlsProvider provider, MonoTlsSettings settings,
- string targetHost, PSSCX.X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, bool checkCertificateRevocation)
- {
- var stream = new MonoNewTlsStream (innerStream, leaveOpen, provider, settings);
-
- try {
- stream.AuthenticateAsClient (targetHost, clientCertificates, enabledSslProtocols, checkCertificateRevocation);
- } catch (Exception ex) {
- var tlsEx = stream.LastError;
- if (tlsEx != null)
- throw new AggregateException (ex, tlsEx);
- throw;
- }
- return stream;
- }
- }
-}
+++ /dev/null
-//
-// NewTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- public class NewTlsProvider : MSI.MonoTlsProvider
- {
- static readonly Guid id = new Guid ("e5ff34f1-8b7a-4aa6-aff9-24719d709693");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "newtls"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return true; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return true; }
- }
-
- internal override bool SupportsTlsContext {
- get { return true; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return SslProtocols.Tls12 | SslProtocols.Tls11 | SslProtocols.Tls; }
- }
-
- public override MSI.IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MSI.MonoTlsSettings settings = null)
- {
- return MonoNewTlsStreamFactory.CreateSslStream (innerStream, leaveInnerStreamOpen, this, settings);
- }
-
- internal override MSI.IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- SSCX.X509Certificate serverCertificate, PSSCX.X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MSI.MonoEncryptionPolicy encryptionPolicy,
- MSI.MonoTlsSettings settings)
- {
- var config = TlsProviderFactory.CreateTlsConfiguration (
- hostname, serverMode, protocolFlags, serverCertificate,
- remoteCertRequired, settings);
- return new TlsContextWrapper (config, serverMode);
- }
- }
-}
-
+++ /dev/null
-//
-// TlsContextWrapper.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.Security.Cryptography;
-
-using SSCX = System.Security.Cryptography.X509Certificates;
-using PSSCX = System.Security.Cryptography.X509Certificates;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-namespace Mono.Security.Providers.NewTls
-{
- class TlsContextWrapper : IDisposable, MSI.IMonoTlsContext
- {
- ITlsConfiguration config;
- ITlsContext context;
- bool serverMode;
-
- public TlsContextWrapper (ITlsConfiguration config, bool serverMode)
- {
- this.config = config;
- this.serverMode = serverMode;
- }
-
- public bool IsServer {
- get { return serverMode; }
- }
-
- public bool IsValid {
- get { return context != null && context.IsValid; }
- }
-
- public void Initialize (MSI.IMonoTlsEventSink eventSink)
- {
- if (context != null)
- throw new InvalidOperationException ();
- context = TlsProviderFactory.CreateTlsContext (config, serverMode, eventSink);
- }
-
- void Clear ()
- {
- if (context != null) {
- context.Dispose ();
- context = null;
- }
- }
-
- public ITlsConfiguration Configuration {
- get {
- if (config == null)
- throw new ObjectDisposedException ("TlsConfiguration");
- return config;
- }
- }
-
- public ITlsContext Context {
- get {
- if (!IsValid)
- throw new ObjectDisposedException ("TlsContext");
- return context;
- }
- }
-
- public bool HasCredentials {
- get { return Configuration.HasCredentials; }
- }
-
- public void SetCertificate (SSCX.X509Certificate certificate, AsymmetricAlgorithm privateKey)
- {
- var monoCert = new MX.X509Certificate (certificate.GetRawCertData ());
- Configuration.SetCertificate (monoCert, privateKey);
- }
-
- public int GenerateNextToken (MSI.IBufferOffsetSize incoming, out MSI.IBufferOffsetSize outgoing)
- {
- var input = incoming != null ? new MSI.TlsBuffer (BOSWrapper.Wrap (incoming)) : null;
- var output = new MSI.TlsMultiBuffer ();
- var retval = Context.GenerateNextToken (input, output);
- if (output.IsEmpty)
- outgoing = null;
- outgoing = BOSWrapper.Wrap (output.StealBuffer ());
- return (int)retval;
- }
-
- public int EncryptMessage (ref MSI.IBufferOffsetSize incoming)
- {
- var buffer = new MSI.TlsBuffer (BOSWrapper.Wrap (incoming));
- var retval = Context.EncryptMessage (ref buffer);
- incoming = BOSWrapper.Wrap (buffer.GetRemaining ());
- return (int)retval;
- }
-
- public int DecryptMessage (ref MSI.IBufferOffsetSize incoming)
- {
- var buffer = new MSI.TlsBuffer (BOSWrapper.Wrap (incoming));
- var retval = Context.DecryptMessage (ref buffer);
- incoming = buffer != null ? BOSWrapper.Wrap (buffer.GetRemaining ()) : null;
- return (int)retval;
- }
-
- class BOSWrapper : MSI.IBufferOffsetSize
- {
- public byte[] Buffer {
- get;
- private set;
- }
-
- public int Offset {
- get;
- private set;
- }
-
- public int Size {
- get;
- private set;
- }
-
- BOSWrapper (byte[] buffer, int offset, int size)
- {
- Buffer = buffer;
- Offset = offset;
- Size = size;
- }
-
- public static BOSWrapper Wrap (MSI.IBufferOffsetSize bos)
- {
- return bos != null ? new BOSWrapper (bos.Buffer, bos.Offset, bos.Size) : null;
- }
- }
-
- public byte[] CreateCloseNotify ()
- {
- return Context.CreateAlert (new MSI.Alert (MSI.AlertLevel.Warning, MSI.AlertDescription.CloseNotify));
- }
-
- public byte[] CreateHelloRequest ()
- {
- return Context.CreateHelloRequest ();
- }
-
- public SSCX.X509Certificate GetRemoteCertificate (out PSSCX.X509CertificateCollection remoteCertificateStore)
- {
- MX.X509CertificateCollection monoCollection;
- var remoteCert = Context.GetRemoteCertificate (out monoCollection);
- if (remoteCert == null) {
- remoteCertificateStore = null;
- return null;
- }
-
- remoteCertificateStore = new PSSCX.X509CertificateCollection ();
- foreach (var cert in monoCollection) {
- remoteCertificateStore.Add (new PSSCX.X509Certificate2 (cert.RawData));
- }
- return new PSSCX.X509Certificate2 (remoteCert.RawData);
-
- }
-
- public bool VerifyRemoteCertificate ()
- {
- return Context.VerifyRemoteCertificate ();
- }
-
- public Exception LastError {
- get {
- if (context != null)
- return context.LastError;
- return null;
- }
- }
-
- public bool ReceivedCloseNotify {
- get {
- return Context.ReceivedCloseNotify;
- }
- }
-
- public MSI.MonoTlsConnectionInfo GetConnectionInfo ()
- {
- return Context.ConnectionInfo;
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- void Dispose (bool disposing)
- {
- Clear ();
- }
- }
-}
-
+++ /dev/null
-//
-// TlsProviderFactory.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015-2016 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-extern alias NewSystemSource;
-
-using System;
-using System.IO;
-
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-
-using MSI = Mono.Security.Interface;
-using MX = Mono.Security.X509;
-
-using PSSCX = System.Security.Cryptography.X509Certificates;
-using SSCX = System.Security.Cryptography.X509Certificates;
-
-namespace Mono.Security.Providers.NewTls
-{
- static class TlsProviderFactory
- {
- const string assemblyName = "Mono.Security.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=84e3aee7225169c2";
- const string tlsConfigTypeName = "Mono.Security.NewTls.TlsConfiguration";
- const string tlsContextTypeName = "Mono.Security.NewTls.TlsContext";
-
- static object CreateInstance (string typeName, object[] args)
- {
- var type = Type.GetType (typeName + ", " + assemblyName);
- return Activator.CreateInstance (type, args);
- }
-
- internal static ITlsConfiguration CreateTlsConfiguration (
- string hostname, bool serverMode, MSI.TlsProtocols protocolFlags,
- SSCX.X509Certificate serverCertificate, bool remoteCertRequired,
- MSI.MonoTlsSettings settings)
- {
- object[] args;
- ITlsConfiguration config;
- if (serverMode) {
- var cert = (PSSCX.X509Certificate2)serverCertificate;
- var monoCert = new MX.X509Certificate (cert.RawData);
- args = new object[] {
- (MSI.TlsProtocols)protocolFlags,
- (MSI.MonoTlsSettings)settings,
- monoCert,
- cert.PrivateKey
- };
- } else {
- args = new object[] {
- (MSI.TlsProtocols)protocolFlags,
- (MSI.MonoTlsSettings)settings,
- hostname
- };
- }
-
- config = (ITlsConfiguration)CreateInstance (tlsConfigTypeName, args);
-
- if (serverMode && remoteCertRequired)
- config.AskForClientCertificate = true;
-
- return config;
- }
-
- internal static ITlsContext CreateTlsContext (
- ITlsConfiguration config, bool serverMode,
- MSI.IMonoTlsEventSink eventSink)
- {
- return (ITlsContext)CreateInstance (
- tlsContextTypeName,
- new object[] { config, serverMode, eventSink });
- }
- }
-}
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("Xamarin")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.NewTls.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.NewTls.dll")]
-[assembly: CLSCompliant (false)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
-[assembly: InternalsVisibleTo ("Mono.Security.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000003336d6aed41624ca156ab579881fe90a576f1dfec48378fc94e4e440f4556776224e2d70c18996d91f36227f539fdb44340e07651f1455a489b29a7e6219a8f85e52b0f8588b4f8a857746a8468d37b556223d1452f3fcbaf0f269cdf1900ceb68f69485dc5887750d19571030c732331e00387d9b813a9ad52891087301793")]
+++ /dev/null
-Properties/AssemblyInfo.cs
-
-Mono.Security.Providers.NewTls/ITlsConfiguration.cs
-Mono.Security.Providers.NewTls/ITlsContext.cs
-
-Mono.Security.Providers.NewTls/MonoNewTlsStream.cs
-Mono.Security.Providers.NewTls/MonoNewTlsStreamFactory.cs
+++ /dev/null
-#include mobile_Mono.Security.Providers.NewTls.dll.sources
+++ /dev/null
-thisdir = class/Mono.Security.Providers.OldTls
-SUBDIRS =
-include ../../build/rules.make
-
-LIBRARY = Mono.Security.Providers.OldTls.dll
-LIB_REFS = System Mono.Security
-LIB_MCS_FLAGS = -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP
-
-include ../../build/library.make
-
-$(the_lib): ../Mono.Security/Makefile
-
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
- <PropertyGroup>\r
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
- <ProductVersion>9.0.30729</ProductVersion>\r
- <SchemaVersion>2.0</SchemaVersion>\r
- <ProjectGuid>{E485E885-59B1-4081-BC66-56AAAFD8771A}</ProjectGuid>\r
- <OutputType>Library</OutputType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <OutputPath>./../../class/lib/net_4_x</OutputPath>\r
- <IntermediateOutputPath>obj-net_4_x</IntermediateOutputPath>\r
- <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>\r
- <NoStdLib>True</NoStdLib>\r
- \r
- <NoConfig>True</NoConfig>\r
- <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
- <AppDesignerFolder>Properties</AppDesignerFolder>\r
- <RootNamespace>\r
- </RootNamespace>\r
- <AssemblyName>Mono.Security.Providers.OldTls</AssemblyName>\r
- <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r
- <FileAlignment>512</FileAlignment>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <SignAssembly>true</SignAssembly>\r
- <DelaySign>true</DelaySign>\r
- </PropertyGroup>\r
- <PropertyGroup>\r
- <AssemblyOriginatorKeyFile>../mono.pub</AssemblyOriginatorKeyFile>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
- <DebugSymbols>true</DebugSymbols>\r
- <DebugType>full</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>false</Optimize>\r
- <DefineConstants>TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
- <DebugType>pdbonly</DebugType>\r
- <NoWarn>1699,1030</NoWarn>\r
- <Optimize>true</Optimize>\r
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;DISABLE_CAS_USE;SECURITY_DEP</DefineConstants>\r
- <ErrorReport>prompt</ErrorReport>\r
- <WarningLevel>4</WarningLevel>\r
- </PropertyGroup>\r
- <!-- Set AddAdditionalExplicitAssemblyReferences to false, otherwise if targetting .NET4.0, \r
- Microsoft.NETFramework.props will force a dependency on the assembly System.Core. This\r
- is a problem to compile the Mono mscorlib.dll -->\r
- <PropertyGroup>\r
- <AddAdditionalExplicitAssemblyReferences>false</AddAdditionalExplicitAssemblyReferences>\r
- </PropertyGroup>\r
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
- <ItemGroup>\r
- <Compile Include="..\..\build\common\Consts.cs" />\r
- <Compile Include="..\..\build\common\Locale.cs" />\r
- <Compile Include="..\..\build\common\MonoTODOAttribute.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Cryptography\MD5SHA1.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Cryptography\TlsHMAC.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientCertificateVerify.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsClientKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerCertificateRequest.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerHelloDone.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Client\TlsServerKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientCertificateVerify.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsClientKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificate.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerCertificateRequest.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerFinished.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHello.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerHelloDone.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake.Server\TlsServerKeyExchange.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\ClientCertificateType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\HandshakeMessage.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls.Handshake\HandshakeType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\Alert.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuiteCollection.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\CipherSuiteFactory.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientContext.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientRecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ClientSessionCache.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ContentType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\Context.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\DebugHelper.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ExchangeAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HandshakeState.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HashAlgorithmType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\HttpsClientStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RSASslSignatureDeformatter.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\RSASslSignatureFormatter.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityCompressionType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityParameters.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SecurityProtocolType.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ServerContext.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\ServerRecordProtocol.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslCipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslClientStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslHandshakeHash.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslServerStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\SslStreamBase.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsCipherSuite.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsClientSettings.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsException.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsServerSettings.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.Protocol.Tls\TlsStream.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\AuthorityKeyIdentifierExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\ExtendedKeyUsageExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\GeneralNames.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\NetscapeCertTypeExtension.cs" />\r
- <Compile Include="..\Mono.Security\Mono.Security.X509.Extensions\SubjectAltNameExtension.cs" />\r
- <Compile Include="..\System\Mono.Net.Security\LegacySslStream.cs" />\r
- <Compile Include=".\Mono.Security.Providers.OldTls\OldTlsProvider.cs" />\r
- <Compile Include=".\Properties\AssemblyInfo.cs" />\r </ItemGroup>\r
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
- Other similar extension points exist, see Microsoft.Common.targets.\r
- <Target Name="BeforeBuild">\r
- </Target>\r
- <Target Name="AfterBuild">\r
- </Target>\r
- -->\r
- <PropertyGroup>\r
- <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PreBuildEvent>\r
- <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PreBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
-
- </PostBuildEvent>\r
- <PostBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">\r
-\r
- </PostBuildEvent>\r
- </PropertyGroup>\r
- <ItemGroup>\r
- <ProjectReference Include="../corlib/corlib-net_4_x.csproj">\r
- <Project>{2CA6026B-2DC8-4C4C-A12C-1E8234049DB7}</Project>\r
- <Name>corlib-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../System/System-net_4_x.csproj">\r
- <Project>{2762E921-91A8-4C87-91E9-BA628013F753}</Project>\r
- <Name>System-net_4_x</Name>\r
- </ProjectReference>\r
- <ProjectReference Include="../Mono.Security/Mono.Security-net_4_x.csproj">\r
- <Project>{42D59DE7-586F-4ACF-BDD5-E7869E39E3EF}</Project>\r
- <Name>Mono.Security-net_4_x</Name>\r
- </ProjectReference>\r
- </ItemGroup>\r
- <ItemGroup>\r
- <Folder Include="Properties\" />\r
- </ItemGroup>\r
-</Project>\r
-
+++ /dev/null
-./Properties/AssemblyInfo.cs
-../../build/common/Consts.cs
-../../build/common/Locale.cs
-../../build/common/MonoTODOAttribute.cs
-
-./Mono.Security.Providers.OldTls/OldTlsProvider.cs
-../System/Mono.Net.Security/LegacySslStream.cs
-
-../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
-../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
-../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
-../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
-../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
-../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
-../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
-../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
-../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
-../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
+++ /dev/null
-//
-// OldTlsProvider.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Security;
-using System.Security.Authentication;
-using System.Security.Cryptography.X509Certificates;
-using Mono.Security.Interface;
-using MNS = Mono.Net.Security;
-
-namespace Mono.Security.Providers.OldTls
-{
- public class OldTlsProvider : MonoTlsProvider
- {
- static readonly Guid id = new Guid ("cf8baa0d-c6ed-40ae-b512-dec8d097e9af");
-
- public override Guid ID {
- get { return id; }
- }
-
- public override string Name {
- get { return "old"; }
- }
-
- public override bool SupportsSslStream {
- get { return true; }
- }
-
- public override bool SupportsMonoExtensions {
- get { return false; }
- }
-
- public override bool SupportsConnectionInfo {
- get { return false; }
- }
-
- internal override bool SupportsTlsContext {
- get { return false; }
- }
-
- public override SslProtocols SupportedProtocols {
- get { return SslProtocols.Tls; }
- }
-
- public override IMonoSslStream CreateSslStream (
- Stream innerStream, bool leaveInnerStreamOpen,
- MonoTlsSettings settings = null)
- {
- var impl = new MNS.Private.LegacySslStream (innerStream, leaveInnerStreamOpen, this, settings);
- return new MNS.Private.MonoSslStreamImpl (impl);
- }
-
- internal override IMonoTlsContext CreateTlsContext (
- string hostname, bool serverMode, TlsProtocols protocolFlags,
- X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, MonoEncryptionPolicy encryptionPolicy,
- MonoTlsSettings settings)
- {
- throw new NotSupportedException ();
- }
- }
-}
-
+++ /dev/null
-//
-// AssemblyInfo.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin, Inc.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-using System;
-using System.Reflection;
-using System.Resources;
-using System.Security;
-using System.Security.Permissions;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about the system assembly
-
-[assembly: AssemblyVersion (Consts.FxVersion)]
-
-[assembly: AssemblyCompany ("MONO development team")]
-[assembly: AssemblyCopyright ("(c) 2015 Xamarin")]
-[assembly: AssemblyDescription ("Mono.Security.Providers.OldTls.dll")]
-[assembly: AssemblyProduct ("MONO CLI")]
-[assembly: AssemblyTitle ("Mono.Security.Providers.OldTls.dll")]
-[assembly: CLSCompliant (true)]
-[assembly: ComVisible (false)]
-[assembly: NeutralResourcesLanguage ("en-US")]
-
[assembly: InternalsVisibleTo ("System, PublicKey=00000000000000000400000000000000")]
#endif
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
-[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
/*
* Internal API, intended to be used by MonoTlsProvider implementations.
*/
+ internal static ICertificateValidator2 GetInternalValidator (MonoTlsSettings settings, MonoTlsProvider provider)
+ {
+ return (ICertificateValidator2)NoReflectionHelper.GetInternalValidator (provider, settings);
+ }
+
+ [Obsolete ("Use GetInternalValidator")]
internal static ICertificateValidator2 GetDefaultValidator (MonoTlsSettings settings, MonoTlsProvider provider)
{
- return (ICertificateValidator2)NoReflectionHelper.GetDefaultCertificateValidator (provider, settings);
+ return GetInternalValidator (settings, provider);
}
/*
* Use this overloaded version in user code.
*/
- public static ICertificateValidator GetValidator (MonoTlsSettings settings, MonoTlsProvider provider = null)
+ public static ICertificateValidator GetValidator (MonoTlsSettings settings)
{
- return GetDefaultValidator (settings, provider);
+ return (ICertificateValidator)NoReflectionHelper.GetDefaultValidator (settings);
}
}
}
/// <summary>
/// RFC 2246 A.5
/// </summary>
+ [CLSCompliant (false)]
public enum CipherSuiteCode : ushort
{
TLS_NULL_WITH_NULL_NULL = 0x0000,
{
public class MonoTlsConnectionInfo
{
+ [CLSCompliant (false)]
public CipherSuiteCode CipherSuiteCode {
get; set;
}
get; set;
}
+ public string PeerDomainName {
+ get; set;
+ }
+
public override string ToString ()
{
return string.Format ("[MonoTlsConnectionInfo: {0}:{1}]", ProtocolVersion, CipherSuiteCode);
get; set;
}
+ [CLSCompliant (false)]
public CipherSuiteCode[] EnabledCiphers {
get; set;
}
+++ /dev/null
-Test/App.config
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<configuration>
+ <connectionStrings>
+ <add name="test-connstring"
+ connectionString="Server=(local);Initial Catalog=someDb;User Id=someUser;Password=somePassword;Application Name=someAppName;Min Pool Size=5;Max Pool Size=500;Connect Timeout=10;Connection Lifetime=29;" />
+ </connectionStrings>
+ <appSettings file="Test/appSettings.config" />
+</configuration>
namespace Microsoft.Win32.SafeHandles
{
- public abstract class SafeNCryptHandle : System.Runtime.InteropServices.SafeHandle
+ public abstract class SafeNCryptHandle : SafeHandleZeroOrMinusOneIsInvalid
{
protected SafeNCryptHandle ()
- : base (IntPtr.Zero, true)
+ : base (true)
{
}
public class MemoryMappedFile : IDisposable {
- MemoryMappedFileAccess fileAccess;
- string name;
- long fileCapacity;
+ // MemoryMappedFileAccess fileAccess;
+ // string name;
+ // long fileCapacity;
//
// We allow the use of either the FileStream/keepOpen combo
return new MemoryMappedFile () {
handle = handle,
- fileAccess = MemoryMappedFileAccess.ReadWrite,
- fileCapacity = capacity
+ // fileAccess = MemoryMappedFileAccess.ReadWrite,
+ // fileCapacity = capacity
};
}
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity
};
}
if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
throw new ArgumentException ("capacity");
- IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.Handle, mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+ IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity,
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity,
stream = fileStream,
keepOpen = leaveOpen
if ((!MonoUtil.IsUnix && capacity == 0 && fileStream.Length == 0) || (capacity > fileStream.Length))
throw new ArgumentException ("capacity");
- IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.Handle, mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
+ IntPtr handle = MemoryMapImpl.OpenHandle (fileStream.SafeFileHandle.DangerousGetHandle (), mapName, out capacity, access, MemoryMappedFileOptions.DelayAllocatePages);
MemoryMapImpl.ConfigureHandleInheritability (handle, inheritability);
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity,
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity,
stream = fileStream,
keepOpen = leaveOpen
return new MemoryMappedFile () {
handle = handle,
- fileAccess = access,
- name = mapName,
- fileCapacity = capacity
+ // fileAccess = access,
+ // name = mapName,
+ // fileCapacity = capacity
};
}
}
#endif
-#if !MOBILE
public AnonymousPipeServerStream (PipeDirection direction, HandleInheritability inheritability, int bufferSize, PipeSecurity pipeSecurity)
: base (direction, bufferSize)
{
if (direction == PipeDirection.InOut)
throw new NotSupportedException ("Anonymous pipe direction can only be either in or out.");
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32AnonymousPipeServer (this, direction, inheritability, bufferSize, pipeSecurity);
else
InitializeHandle (impl.Handle, false, false);
IsConnected = true;
- }
#endif
+ }
[MonoTODO]
public AnonymousPipeServerStream (PipeDirection direction, SafePipeHandle serverSafePipeHandle, SafePipeHandle clientSafePipeHandle)
#endif
}
-#if !MOBILE
public NamedPipeClientStream (string serverName, string pipeName, PipeAccessRights desiredAccessRights, PipeOptions options, TokenImpersonationLevel impersonationLevel, HandleInheritability inheritability)
: base (ToDirection (desiredAccessRights), DefaultBufferSize)
{
if (impersonationLevel != TokenImpersonationLevel.None ||
inheritability != HandleInheritability.None)
throw ThrowACLException ();
-
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32NamedPipeClient (this, serverName, pipeName, desiredAccessRights, options, inheritability);
else
impl = new UnixNamedPipeClient (this, serverName, pipeName, desiredAccessRights, options, inheritability);
- }
#endif
+ }
+
~NamedPipeClientStream () {
Dispose (false);
}
throw new NotImplementedException ();
}
+ protected override internal void CheckPipePropertyOperations () {
+ base.CheckPipePropertyOperations();
+ }
+
public int NumberOfServerInstances {
get {
CheckPipePropertyOperations ();
}
#endif
-#if !MOBILE
public NamedPipeServerStream (string pipeName, PipeDirection direction, int maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, int inBufferSize, int outBufferSize, PipeSecurity pipeSecurity)
: this (pipeName, direction, maxNumberOfServerInstances, transmissionMode, options, inBufferSize, outBufferSize, pipeSecurity, HandleInheritability.None)
{
{
var rights = ToAccessRights (direction) | additionalAccessRights;
// FIXME: reject some rights declarations (for ACL).
-
+#if MOBILE
+ throw new NotImplementedException ();
+#else
if (IsWindows)
impl = new Win32NamedPipeServer (this, pipeName, maxNumberOfServerInstances, transmissionMode,
rights, options, inBufferSize, outBufferSize,
rights, options, inBufferSize, outBufferSize, inheritability);
InitializeHandle (impl.Handle, false, (options & PipeOptions.Asynchronous) != PipeOptions.None);
- }
#endif
+ }
public NamedPipeServerStream (PipeDirection direction, bool isAsync, bool isConnected, SafePipeHandle safePipeHandle)
: base (direction, DefaultBufferSize)
impl.Disconnect ();
}
-#if !MOBILE
[MonoTODO]
[SecurityPermission (SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlPrincipal)]
public void RunAsClient (PipeStreamImpersonationWorker impersonationWorker)
{
throw new NotImplementedException ();
}
-#endif
public void WaitForConnection ()
{
throw new NotImplementedException ();
}
-#if !MOBILE
// async operations
Action wait_connect_delegate;
{
wait_connect_delegate.EndInvoke (asyncResult);
}
-#endif
}
}
return new NotImplementedException ("ACL is not supported in Mono");
}
-#if !MOBILE
internal static PipeAccessRights ToAccessRights (PipeDirection direction)
{
switch (direction) {
throw new ArgumentOutOfRangeException ();
}
}
-#endif
protected PipeStream (PipeDirection direction, int bufferSize)
: this (direction, PipeTransmissionMode.Byte, bufferSize)
set { stream = value; }
}
-#if !MOBILE
protected bool IsHandleExposed { get; private set; }
-#endif
[MonoTODO]
public bool IsMessageComplete { get; private set; }
}
// initialize/dispose/state check
-#if MOBILE
- internal static void CheckPipePropertyOperations ()
- {
- }
-
- static void CheckReadOperations ()
- {
- }
- static void CheckWriteOperations ()
- {
- }
-#else
[MonoTODO]
protected internal virtual void CheckPipePropertyOperations ()
{
this.IsHandleExposed = isExposed;
this.IsAsync = isAsync;
}
-#endif
protected override void Dispose (bool disposing)
{
throw new NotSupportedException ();
}
-#if !MOBILE
public PipeSecurity GetAccessControl ()
{
+#if MOBILE
+ throw new PlatformNotSupportedException ();
+#else
return new PipeSecurity (SafePipeHandle,
AccessControlSections.Owner |
AccessControlSections.Group |
AccessControlSections.Access);
+#endif
}
public void SetAccessControl (PipeSecurity pipeSecurity)
{
+#if MOBILE
+ throw new PlatformNotSupportedException ();
+#else
if (pipeSecurity == null)
throw new ArgumentNullException ("pipeSecurity");
pipeSecurity.Persist (SafePipeHandle);
- }
#endif
+ }
// pipe I/O
// async
-#if !MOBILE
Func<byte [],int,int,int> read_delegate;
[HostProtection (SecurityAction.LinkDemand, ExternalThreading = true)]
{
write_delegate.EndInvoke (asyncResult);
}
-#endif
}
}
opener = delegate {
var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (desiredAccessRights), FileShare.ReadWrite);
owner.Stream = fs;
- handle = new SafePipeHandle (fs.Handle, false);
+ handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
};
}
// FIXME: maxNumberOfServerInstances, modes, sizes, handle inheritability
var fs = new FileStream (name, FileMode.Open, RightsToFileAccess (rights), FileShare.ReadWrite);
- handle = new SafePipeHandle (fs.Handle, false);
+ handle = new SafePipeHandle (fs.SafeFileHandle.DangerousGetHandle (), false);
owner.Stream = fs;
should_close_handle = true;
}
else {
IPHostEntry he = Dns.Resolve (Dns.GetHostName());
if (he.AddressList.Length == 0) throw new RemotingException ("IP address could not be determined for this host");
- host = he.AddressList [0].ToString ();
+ AddressFamily addressFamily = (Socket.OSSupportsIPv4) ? AddressFamily.InterNetwork : AddressFamily.InterNetworkV6;
+ IPAddress addr = GetMachineAddress (he, addressFamily);
+ if (addr != null)
+ host = addr.ToString ();
+ else
+ host = he.AddressList [0].ToString ();
}
}
else
server_thread.Join ();
server_thread = null;
}
+
+ private static IPAddress GetMachineAddress (IPHostEntry host, AddressFamily addressFamily)
+ {
+ IPAddress result = null;
+ if (host != null) {
+ IPAddress[] addressList = host.AddressList;
+ for (int i = 0; i < addressList.Length; i++) {
+ if (addressList[i].AddressFamily == addressFamily) {
+ result = addressList[i];
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
}
class ClientConnection
return false;
}
+ internal static void AddDefaultXmlType(XmlSchemaSet schemas, string localName, string ns)
+ {
+ throw new NotImplementedException();
+ }
+
static bool InvokeSchemaProviderMethod(Type clrType, XmlSchemaSet schemas, out XmlQualifiedName stableName, out XmlSchemaType xsdType, out bool hasRoot)
{
xsdType = null;
--- /dev/null
+//
+// XsdDataContractExporter_mobile.cs
+//
+// Authors:
+// Alexander Köplinger <alexander.koeplinger@xamarin.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Xml;
+using System.Xml.Schema;
+
+namespace System.Runtime.Serialization
+{
+ public class XsdDataContractExporter
+ {
+ public XsdDataContractExporter () { throw new NotImplementedException (); }
+ public XsdDataContractExporter (XmlSchemaSet schemas) { throw new NotImplementedException (); }
+ public ExportOptions Options { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } }
+ public XmlSchemaSet Schemas { get { throw new NotImplementedException (); } }
+ public bool CanExport (ICollection<Assembly> assemblies) { throw new NotImplementedException ();}
+ public bool CanExport (ICollection<Type> types) { throw new NotImplementedException (); }
+ public bool CanExport (Type type) { throw new NotImplementedException (); }
+ public void Export (ICollection<Assembly> assemblies) { throw new NotImplementedException (); }
+ public void Export (ICollection<Type> types) { throw new NotImplementedException (); }
+ public void Export (Type type) { throw new NotImplementedException (); }
+ public XmlQualifiedName GetRootElementName (Type type) { throw new NotImplementedException (); }
+ public XmlSchemaType GetSchemaType (Type type) { throw new NotImplementedException (); }
+ public XmlQualifiedName GetSchemaTypeName (Type type) { throw new NotImplementedException (); }
+ }
+}
+
#include ReferenceSource.common.sources
ReferenceSources/SchemaExporter_mobile.cs
+ReferenceSources/XsdDataContractExporter_mobile.cs
ReferenceSources/SimplifiedCodeTypeReference.cs
protected virtual bool ShouldSerializeLinkHoverColor ()
{
- return grid_style.LinkHoverColor != grid_style.LinkHoverColor;
+ return grid_style.LinkHoverColor != default_style.LinkHoverColor;
}
protected virtual bool ShouldSerializeParentRowsBackColor ()
if (this.title_style == TitleStyle.Normal) {
pt.Y += caption_height;
- } else if (this.title_style == TitleStyle.Normal) {
+ } else if (this.title_style == TitleStyle.Tool) {
pt.Y += tool_caption_height;
}
static bool AreEqual (VisualStyleElement value1, VisualStyleElement value2)
{
return
- value1.ClassName == value1.ClassName &&
+ value1.ClassName == value2.ClassName &&
value1.Part == value2.Part &&
value1.State == value2.State;
}
return serializable;
}
+ protected IXmlSerializable ReadSerializable (IXmlSerializable serializable, bool wrappedAny)
+ {
+ string name = null;
+ string ns = null;
+
+ if (wrappedAny) {
+ name = reader.LocalName;
+ ns = reader.NamespaceURI;
+ reader.Read ();
+ reader.MoveToContent ();
+ }
+ serializable.ReadXml (reader);
+
+ if (wrappedAny) {
+ while (reader.NodeType == XmlNodeType.Whitespace) reader.Skip ();
+ if (reader.NodeType == XmlNodeType.None) reader.Skip ();
+ if (reader.NodeType == XmlNodeType.EndElement && reader.LocalName == name && reader.NamespaceURI == ns) {
+ reader.Read ();
+ }
+ }
+ return serializable;
+ }
+
protected string ReadString (string value)
{
readCount++;
{
}
+ public XmlSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location)
+ : this (type, overrides, extraTypes, root, defaultNamespace, location, null)
+ {
+ }
+
public XmlSerializer (Type type, XmlAttributeOverrides overrides)
: this (type, overrides, null, null, null)
{
}
}
+ public XmlSerializer CreateSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location)
+ {
+ return CreateSerializer (type, overrides, extraTypes, root, defaultNamespace, location, null);
+ }
+
public XmlSerializer CreateSerializer (Type type, string defaultNamespace)
{
return CreateSerializer (type, null, null, null, defaultNamespace);
using System.Collections;
using System.IO;
using System.Text;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Policy;
Transform (input.CreateNavigator (), arguments, results, null);
}
+ public void Transform (IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
+ {
+ Transform (input.CreateNavigator (), arguments, results, documentResolver);
+ }
+
public void Transform (XmlReader input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
{
Transform (new XPathDocument (input, XmlSpace.Preserve).CreateNavigator (), arguments, results, documentResolver);
Load (new XPathDocument (stylesheetUri, XmlSpace.Preserve).CreateNavigator (), settings, stylesheetResolver);
}
+ public void Load (MethodInfo executeMethod, byte[] queryData, Type[] earlyBoundTypes)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Load (Type compiledStylesheet)
+ {
+ throw new NotImplementedException ();
+ }
#endregion
}
[assembly: StringFreezing]
[assembly: DefaultDependency (LoadHint.Always)]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewSystemSource, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.OldTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.NewTls, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Mono.Security.Providers.DotNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
[assembly: InternalsVisibleTo ("Mono.Security, PublicKey=002400000480000094000000060200000024000052534131000400000100010079159977d2d03a8e6bea7a2e74e8d1afcc93e8851974952bb480a12c9134474d04062447c37e0e68c080536fcf3c3fbe2ff9c979ce998475e506e8ce82dd5b0f350dc10e93bf2eeecf874b24770c5081dbea7447fddafa277b22de47d6ffea449674a4f9fccf84d15069089380284dbdd35f46cdff12a1bd78e4ef0065d016df")]
- [assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
namespace Microsoft.Win32.SafeHandles
{
- public sealed class SafeX509ChainHandle : SafeHandle
+ public sealed class SafeX509ChainHandle : SafeHandleZeroOrMinusOneIsInvalid
{
- [MonoTODO]
- public override bool IsInvalid
- {
- get
- {
- throw new NotImplementedException ();
- }
- }
-
- [MonoTODO]
- internal SafeX509ChainHandle() : base ((IntPtr)0, false)
+ internal SafeX509ChainHandle (IntPtr handle)
+ : base (true)
{
throw new NotImplementedException ();
}
[MonoTODO]
- protected override bool ReleaseHandle()
+ protected override bool ReleaseHandle ()
{
throw new NotImplementedException ();
}
Complete,
WantRead,
WantWrite,
- ReadDone
+ ReadDone,
+ FinishWrite
}
class AsyncProtocolRequest
Debug ("ResetRead: {0} {1}", oldStatus, Status);
}
+ internal void ResetWrite ()
+ {
+ var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.Complete, (int)AsyncOperationStatus.WantWrite);
+ Debug ("ResetWrite: {0} {1}", oldStatus, Status);
+ }
+
internal void RequestWrite ()
{
var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.WantWrite, (int)AsyncOperationStatus.Running);
+ Debug ("RequestWrite: {0} {1}", oldStatus, Status);
if (oldStatus == AsyncOperationStatus.Running)
return;
else if (oldStatus != AsyncOperationStatus.WantRead && oldStatus != AsyncOperationStatus.WantWrite)
status = ProcessOperation (status);
- var oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
+ Debug ("ProcessOperation done: {0}", status);
+
+ AsyncOperationStatus oldStatus;
+ if (status == AsyncOperationStatus.Complete) {
+ oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)AsyncOperationStatus.FinishWrite, (int)AsyncOperationStatus.WantWrite);
+ if (oldStatus == AsyncOperationStatus.WantWrite) {
+ // We are done, but still need to flush the write queue.
+ status = AsyncOperationStatus.FinishWrite;
+ continue;
+ }
+ }
+
+ oldStatus = (AsyncOperationStatus)Interlocked.CompareExchange (ref Status, (int)status, (int)AsyncOperationStatus.Running);
Debug ("ProcessOperation done: {0} -> {1}", oldStatus, status);
if (oldStatus != AsyncOperationStatus.Running) {
else
return AsyncOperationStatus.WantRead;
} else if (status == AsyncOperationStatus.WantWrite) {
+ Debug ("ProcessOperation - want write");
Parent.InnerWrite ();
+ Debug ("ProcessOperation - want write done");
return AsyncOperationStatus.Continue;
} else if (status == AsyncOperationStatus.Initialize || status == AsyncOperationStatus.Continue) {
Debug ("ProcessOperation - continue");
status = Operation (this, status);
Debug ("ProcessOperation - read done: {0}", status);
return status;
+ } else if (status == AsyncOperationStatus.FinishWrite) {
+ Debug ("ProcessOperation - finish write");
+ Parent.InnerWrite ();
+ Debug ("ProcessOperation - finish write done");
+ return AsyncOperationStatus.Complete;
}
throw new InvalidOperationException ();
readonly MonoTlsStream tlsStream;
readonly HttpWebRequest request;
- internal static ICertificateValidator GetDefaultValidator (MonoTlsProvider provider, MonoTlsSettings settings)
+ internal static ICertificateValidator GetInternalValidator (MonoTlsProvider provider, MonoTlsSettings settings)
{
if (settings == null)
return new ChainValidationHelper (provider, null, false, null, null);
return new ChainValidationHelper (provider, settings, false, null, null);
}
+ internal static ICertificateValidator GetDefaultValidator (MonoTlsSettings settings)
+ {
+ var provider = MonoTlsProviderFactory.GetProvider ();
+ if (settings == null)
+ return new ChainValidationHelper (provider, null, false, null, null);
+ if (settings.CertificateValidator != null)
+ throw new NotSupportedException ();
+ return new ChainValidationHelper (provider, settings, false, null, null);
+ }
+
#region SslStream support
/*
settings = MonoTlsSettings.CopyDefaultSettings ();
if (cloneSettings)
settings = settings.CloneWithValidator (this);
+ if (provider == null)
+ provider = MonoTlsProviderFactory.GetProvider ();
this.provider = provider;
this.settings = settings;
: base (innerStream, leaveInnerStreamOpen)
{
this.provider = provider;
- certificateValidator = ChainValidationHelper.GetDefaultValidator (provider, settings);
+ certificateValidator = ChainValidationHelper.GetInternalValidator (provider, settings);
}
#endregion // Constructors
if (wantMore || writeBuffer.Size > 0)
return AsyncOperationStatus.WantWrite;
+ asyncRequest.ResetWrite ();
asyncRequest.UserResult = asyncRequest.CurrentSize;
return AsyncOperationStatus.Complete;
}
this.clientCertificates = clientCertificates;
this.askForClientCert = askForClientCert;
- certificateValidator = CertificateValidationHelper.GetDefaultValidator (
+ certificateValidator = CertificateValidationHelper.GetInternalValidator (
parent.Settings, parent.Provider);
}
static IMonoTlsProvider CreateDefaultProvider ()
{
#if SECURITY_DEP
- MSI.MonoTlsProvider provider = null;
-#if MONO_FEATURE_NEW_SYSTEM_SOURCE
- /*
- * This is a hack, which is used in the Mono.Security.Providers.NewSystemSource
- * assembly, which will provide a "fake" System.dll. Use the public Mono.Security
- * API to get the "real" System.dll's provider via reflection, then wrap it with
- * the "fake" version's perceived view.
- *
- * NewSystemSource needs to compile MonoTlsProviderFactory.cs, IMonoTlsProvider.cs,
- * MonoTlsProviderWrapper.cs and CallbackHelpers.cs from this directory and only these.
- */
- provider = MSI.MonoTlsProviderFactory.GetProvider ();
-#else
- provider = CreateDefaultProviderImpl ();
-#endif
+ MSI.MonoTlsProvider provider = CreateDefaultProviderImpl ();
if (provider != null)
return new Private.MonoTlsProviderWrapper (provider);
#endif
#endregion
-#if SECURITY_DEP && !MONO_FEATURE_NEW_SYSTEM_SOURCE
+#if SECURITY_DEP
static Dictionary<string,string> providerRegistration;
return;
providerRegistration = new Dictionary<string,string> ();
providerRegistration.Add ("legacy", "Mono.Net.Security.Private.MonoLegacyTlsProvider");
- providerRegistration.Add ("newtls", "Mono.Security.Providers.NewTls.NewTlsProvider, Mono.Security.Providers.NewTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
- providerRegistration.Add ("oldtls", "Mono.Security.Providers.OldTls.OldTlsProvider, Mono.Security.Providers.OldTls, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756");
#if HAVE_BTLS
if (Mono.Btls.MonoBtlsProvider.IsSupported ())
providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider");
//
internal static class NoReflectionHelper
{
- internal static object GetDefaultCertificateValidator (object provider, object settings)
+ internal static object GetInternalValidator (object provider, object settings)
{
#if SECURITY_DEP
- return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+ return ChainValidationHelper.GetInternalValidator ((MSI.MonoTlsProvider)provider, (MSI.MonoTlsSettings)settings);
+ #else
+ throw new NotSupportedException ();
+ #endif
+ }
+
+ internal static object GetDefaultValidator (object settings)
+ {
+ #if SECURITY_DEP
+ return ChainValidationHelper.GetDefaultValidator ((MSI.MonoTlsSettings)settings);
#else
throw new NotSupportedException ();
#endif
+++ /dev/null
-//
-// Internal.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-using System.Runtime.InteropServices;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Net.Security
-{
- //From Schannel.h
- [Flags]
- internal enum SchProtocols
- {
- Zero = 0,
- PctClient = 0x00000002,
- PctServer = 0x00000001,
- Pct = (PctClient | PctServer),
- Ssl2Client = 0x00000008,
- Ssl2Server = 0x00000004,
- Ssl2 = (Ssl2Client | Ssl2Server),
- Ssl3Client = 0x00000020,
- Ssl3Server = 0x00000010,
- Ssl3 = (Ssl3Client | Ssl3Server),
- Tls10Client = 0x00000080,
- Tls10Server = 0x00000040,
- Tls10 = (Tls10Client | Tls10Server),
- Tls11Client = 0x00000200,
- Tls11Server = 0x00000100,
- Tls11 = (Tls11Client | Tls11Server),
- Tls12Client = 0x00000800,
- Tls12Server = 0x00000400,
- Tls12 = (Tls12Client | Tls12Server),
- Ssl3Tls = (Ssl3 | Tls10),
- UniClient = unchecked((int)0x80000000),
- UniServer = 0x40000000,
- Unified = (UniClient | UniServer),
- ClientMask = (PctClient | Ssl2Client | Ssl3Client | Tls10Client | Tls11Client | Tls12Client | UniClient),
- ServerMask = (PctServer | Ssl2Server | Ssl3Server | Tls10Server | Tls11Server | Tls12Server | UniServer)
- }
-
- //From Schannel.h
- [StructLayout (LayoutKind.Sequential)]
- internal class SslConnectionInfo
- {
- public readonly int Protocol;
- public readonly int DataCipherAlg;
- public readonly int DataKeySize;
- public readonly int DataHashAlg;
- public readonly int DataHashKeySize;
- public readonly int KeyExchangeAlg;
- public readonly int KeyExchKeySize;
-
- internal SslConnectionInfo (int protocol)
- {
- Protocol = protocol;
- }
- }
-}
}
}
+ internal static TraceSource Sockets {
+ get {
+ return null;
+ }
+ }
+
[Conditional ("TRACE")]
internal static void Enter(TraceSource traceSource, object obj, string method, object paramObject) {
}
+++ /dev/null
-//
-// SSPIConfiguration.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-using Mono.Net.Security;
-
-namespace System.Net.Security
-{
- internal interface SSPIConfiguration
- {
- IMonoTlsProvider Provider {
- get;
- }
-
- MonoTlsSettings Settings {
- get;
- }
-
- IMonoTlsEventSink EventSink {
- get;
- }
- }
-}
-#endif
+++ /dev/null
-//
-// SafeHandles.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using IMonoTlsContext = MonoSecurity::Mono.Security.Interface.IMonoTlsContext;
-#else
-using IMonoTlsContext = Mono.Security.Interface.IMonoTlsContext;
-#endif
-
-using System.Runtime.InteropServices;
-using System.Security.Cryptography.X509Certificates;
-
-namespace System.Net.Security
-{
- class DummySafeHandle : SafeHandle
- {
- protected DummySafeHandle ()
- : base ((IntPtr)(-1), true)
- {
- }
-
- protected override bool ReleaseHandle ()
- {
- return true;
- }
-
- public override bool IsInvalid {
- get { return handle == (IntPtr)(-1); }
- }
- }
-
- class SafeFreeCertContext : DummySafeHandle
- {
- }
-
- class SafeFreeCredentials : DummySafeHandle
- {
- SecureCredential credential;
-
- public X509Certificate2 Certificate {
- get {
- if (IsInvalid)
- throw new ObjectDisposedException ("Certificate");
- return credential.certificate;
- }
- }
-
- public SafeFreeCredentials (SecureCredential credential)
- {
- this.credential = credential;
- bool success = true;
- DangerousAddRef (ref success);
- }
-
- public override bool IsInvalid {
- get {
- return credential.certificate == null;
- }
- }
-
- protected override bool ReleaseHandle ()
- {
- credential.Clear ();
- return base.ReleaseHandle ();
- }
- }
-
- class SafeDeleteContext : DummySafeHandle
- {
- IMonoTlsContext context;
-
- public IMonoTlsContext Context {
- get {
- if (IsInvalid)
- throw new ObjectDisposedException ("TlsContext");
- return context;
- }
- }
-
- public SafeDeleteContext (IMonoTlsContext context)
- {
- this.context = context;
- }
-
- public override bool IsInvalid {
- get {
- return context == null || !context.IsValid;
- }
- }
-
- protected override bool ReleaseHandle ()
- {
- context.Dispose ();
- context = null;
- return base.ReleaseHandle ();
- }
- }
-
- struct SecureCredential
- {
- public const int CurrentVersion = 0x4;
-
- [Flags]
- public enum Flags
- {
- Zero = 0,
- NoSystemMapper = 0x02,
- NoNameCheck = 0x04,
- ValidateManual = 0x08,
- NoDefaultCred = 0x10,
- ValidateAuto = 0x20,
- SendAuxRecord = 0x00200000,
- UseStrongCrypto = 0x00400000
- }
-
- int version;
- internal X509Certificate2 certificate;
- SchProtocols protocols;
- EncryptionPolicy policy;
-
- public SecureCredential (int version, X509Certificate2 certificate, SecureCredential.Flags flags, SchProtocols protocols, EncryptionPolicy policy)
- {
- this.version = version;
- this.certificate = certificate;
- this.protocols = protocols;
- this.policy = policy;
- }
-
- public void Clear ()
- {
- certificate = null;
- }
- }
-
- internal class SafeCredentialReference : DummySafeHandle
- {
- //
- // Static cache will return the target handle if found the reference in the table.
- //
- internal SafeFreeCredentials _Target;
-
- //
- //
- internal static SafeCredentialReference CreateReference (SafeFreeCredentials target)
- {
- SafeCredentialReference result = new SafeCredentialReference (target);
- if (result.IsInvalid)
- return null;
-
- return result;
- }
-
- private SafeCredentialReference (SafeFreeCredentials target)
- : base ()
- {
- // Bumps up the refcount on Target to signify that target handle is statically cached so
- // its dispose should be postponed
- bool b = false;
- try {
- target.DangerousAddRef (ref b);
- } catch {
- if (b) {
- target.DangerousRelease ();
- b = false;
- }
- } finally {
- if (b) {
- _Target = target;
- SetHandle (new IntPtr (0)); // make this handle valid
- }
- }
- }
-
- override protected bool ReleaseHandle ()
- {
- SafeFreeCredentials target = _Target;
- if (target != null)
- target.DangerousRelease ();
- _Target = null;
- return true;
- }
- }
-
-}
-#endif
+++ /dev/null
-//
-// SSPIWrapper.cs
-//
-// Author:
-// Martin Baulig <martin.baulig@xamarin.com>
-//
-// Copyright (c) 2015 Xamarin Inc. (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-#endif
-
-#if MONO_SECURITY_ALIAS
-using MX = MonoSecurity::Mono.Security.X509;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using MX = Mono.Security.X509;
-using Mono.Security.Interface;
-#endif
-
-using System.Runtime.InteropServices;
-using System.Security.Authentication.ExtendedProtection;
-using System.Security.Cryptography.X509Certificates;
-using MNS = Mono.Net.Security;
-
-namespace System.Net.Security
-{
- internal class SSPIInterface
- {
- public IMonoTlsContext Context {
- get;
- private set;
- }
-
- public IMonoTlsEventSink EventSink {
- get;
- private set;
- }
-
- public SSPIInterface (IMonoTlsContext context, IMonoTlsEventSink eventSink)
- {
- Context = context;
- EventSink = eventSink;
- }
- }
-
- internal static class GlobalSSPI
- {
- internal static SSPIInterface Create (string hostname, bool serverMode, SchProtocols protocolFlags, X509Certificate serverCertificate, X509CertificateCollection clientCertificates,
- bool remoteCertRequired, bool checkCertName, bool checkCertRevocationStatus, EncryptionPolicy encryptionPolicy,
- LocalCertSelectionCallback certSelectionDelegate, RemoteCertValidationCallback remoteValidationCallback, SSPIConfiguration userConfig)
- {
- if (userConfig.Settings != null && remoteValidationCallback != null)
- throw new InvalidOperationException ();
- var context = userConfig.Provider.CreateTlsContext (
- hostname, serverMode, (TlsProtocols)protocolFlags, serverCertificate, clientCertificates,
- remoteCertRequired, checkCertName, checkCertRevocationStatus,
- (MonoEncryptionPolicy)encryptionPolicy, userConfig.Settings);
- return new SSPIInterface (context, userConfig.EventSink);
- }
- }
-
- /*
- * SSPIWrapper _is a _class that provides a managed implementation of the equivalent
- * _class _in Microsofts .NET Framework.
- *
- * The SSPIWrapper class is used by the TLS/SSL stack to implement both the
- * protocol handshake as well as the encryption and decryption of messages.
- *
- * Microsoft's implementation of this class is merely a P/Invoke wrapper
- * around the native SSPI APIs on Windows. This implementation instead,
- * provides a managed implementation that uses the cross platform Mono.Security
- * to provide the equivalent functionality.
- *
- * Ideally, this should be abstracted with a different name, and decouple
- * the naming from the SSPIWrapper name, but this allows Mono to reuse
- * the .NET code with minimal changes.
- *
- * The "internal" methods here are the API that is consumed by the class
- * libraries.
- */
- internal static class SSPIWrapper
- {
- static void SetCredentials (SSPIInterface secModule, SafeFreeCredentials credentials)
- {
- if (credentials != null && !credentials.IsInvalid) {
- if (!secModule.Context.HasCredentials && credentials.Certificate != null) {
- var cert = new X509Certificate2 (credentials.Certificate.RawData);
- secModule.Context.SetCertificate (cert, credentials.Certificate.PrivateKey);
- }
- bool success = true;
- credentials.DangerousAddRef (ref success);
- }
- }
-
- /*
- * @safecontext is null on the first use, but it will become non-null for invocations
- * where the connection is being re-negotiated.
- *
- */
- internal static int AcceptSecurityContext (SSPIInterface secModule, ref SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, ContextFlags inFlags, Endianness endianness, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (endianness != Endianness.Native)
- throw new NotSupportedException ();
-
- if (safeContext == null) {
- if (credentials == null || credentials.IsInvalid)
- return (int)SecurityStatus.CredentialsNeeded;
-
- secModule.Context.Initialize (secModule.EventSink);
- safeContext = new SafeDeleteContext (secModule.Context);
- }
-
- SetCredentials (secModule, credentials);
-
- var incoming = GetInputBuffer (inputBuffer);
- IBufferOffsetSize outgoing;
-
- var retval = (int)safeContext.Context.GenerateNextToken (incoming, out outgoing);
- UpdateOutput (outgoing, outputBuffer);
- return retval;
- }
-
- internal static int InitializeSecurityContext (SSPIInterface secModule, ref SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, string targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (inputBuffer != null)
- throw new InvalidOperationException ();
-
- if (safeContext == null) {
- secModule.Context.Initialize (secModule.EventSink);
- safeContext = new SafeDeleteContext (secModule.Context);
- }
-
- return InitializeSecurityContext (secModule, credentials, ref safeContext, targetName, inFlags, endianness, null, outputBuffer, ref outFlags);
- }
-
- internal static int InitializeSecurityContext (SSPIInterface secModule, SafeFreeCredentials credentials, ref SafeDeleteContext safeContext, string targetName, ContextFlags inFlags, Endianness endianness, SecurityBuffer[] inputBuffers, SecurityBuffer outputBuffer, ref ContextFlags outFlags)
- {
- if (endianness != Endianness.Native)
- throw new NotSupportedException ();
-
- SetCredentials (secModule, credentials);
-
- SecurityBuffer inputBuffer = null;
- if (inputBuffers != null) {
- if (inputBuffers.Length != 2 || inputBuffers [1].type != BufferType.Empty)
- throw new NotSupportedException ();
- inputBuffer = inputBuffers [0];
- }
-
- var incoming = GetInputBuffer (inputBuffer);
- IBufferOffsetSize outgoing = null;
-
- var retval = (int)safeContext.Context.GenerateNextToken (incoming, out outgoing);
- UpdateOutput (outgoing, outputBuffer);
- return retval;
- }
-
- internal static int EncryptMessage (SSPIInterface secModule, SafeDeleteContext safeContext, SecurityBuffer securityBuffer, uint sequenceNumber)
- {
- var incoming = GetInputBuffer (securityBuffer);
- var retval = (int)safeContext.Context.EncryptMessage (ref incoming);
- UpdateOutput (incoming, securityBuffer);
- return retval;
- }
-
- internal static int DecryptMessage (SSPIInterface secModule, SafeDeleteContext safeContext, SecurityBuffer securityBuffer, uint sequenceNumber)
- {
- var incoming = GetInputBuffer (securityBuffer);
- var retval = (int)safeContext.Context.DecryptMessage (ref incoming);
- UpdateOutput (incoming, securityBuffer);
- return retval;
- }
-
- internal static byte[] CreateShutdownMessage (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.CreateCloseNotify ();
- }
-
- internal static byte[] CreateHelloRequestMessage (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.CreateHelloRequest ();
- }
-
- internal static bool IsClosed (SSPIInterface secModule, SafeDeleteContext safeContext)
- {
- return safeContext.Context.ReceivedCloseNotify;
- }
-
- internal static SafeFreeCredentials AcquireCredentialsHandle (SSPIInterface SecModule, string package, CredentialUse intent, SecureCredential scc)
- {
- return new SafeFreeCredentials (scc);
- }
-
- public static ChannelBinding QueryContextChannelBinding (SSPIInterface SecModule, SafeDeleteContext securityContext, ContextAttribute contextAttribute)
- {
- return null;
- }
-
- internal static X509Certificate2 GetRemoteCertificate (SafeDeleteContext safeContext, out X509Certificate2Collection remoteCertificateStore)
- {
- X509CertificateCollection monoCollection;
- if (safeContext == null || safeContext.IsInvalid) {
- remoteCertificateStore = null;
- return null;
- }
- var monoCert = safeContext.Context.GetRemoteCertificate (out monoCollection);
- if (monoCert == null) {
- remoteCertificateStore = null;
- return null;
- }
-
- remoteCertificateStore = new X509Certificate2Collection ();
- foreach (var cert in monoCollection) {
- remoteCertificateStore.Add (cert);
- }
- return (X509Certificate2)monoCert;
- }
-
- internal static bool CheckRemoteCertificate (SafeDeleteContext safeContext)
- {
- return safeContext.Context.VerifyRemoteCertificate ();
- }
-
- internal static MonoTlsConnectionInfo GetMonoConnectionInfo (SSPIInterface SecModule, SafeDeleteContext securityContext)
- {
- return securityContext.Context.GetConnectionInfo ();
- }
-
- internal static SslConnectionInfo GetConnectionInfo (SSPIInterface SecModule, SafeDeleteContext securityContext)
- {
- var info = securityContext.Context.GetConnectionInfo ();
- if (info == null)
- return null;
-
- return new SslConnectionInfo ((int)info.ProtocolVersion);
- }
-
- class InputBuffer : IBufferOffsetSize
- {
- public byte[] Buffer {
- get;
- private set;
- }
-
- public int Offset {
- get;
- private set;
- }
-
- public int Size {
- get;
- private set;
- }
-
- public InputBuffer (byte[] buffer, int offset, int size)
- {
- Buffer = buffer;
- Offset = offset;
- Size = size;
- }
- }
-
- static IBufferOffsetSize GetInputBuffer (SecurityBuffer incoming)
- {
- return incoming != null ? new InputBuffer (incoming.token, incoming.offset, incoming.size) : null;
- }
-
- static void UpdateOutput (IBufferOffsetSize buffer, SecurityBuffer outputBuffer)
- {
- if (buffer != null) {
- outputBuffer.token = buffer.Buffer;
- outputBuffer.offset = buffer.Offset;
- outputBuffer.size = buffer.Size;
- outputBuffer.type = BufferType.Token;
- } else {
- outputBuffer.token = null;
- outputBuffer.size = outputBuffer.offset = 0;
- outputBuffer.type = BufferType.Empty;
- }
- }
- }
-}
-#endif
// this version does not throw.
internal void InternalShutdown (SocketShutdown how)
{
- if (!is_connected || is_disposed)
+ if (!is_connected || CleanedUp)
return;
int error;
- Shutdown_internal (safe_handle, how, out error);
+ Shutdown_internal (m_Handle, how, out error);
}
internal IAsyncResult UnsafeBeginConnect (EndPoint remoteEP, AsyncCallback callback, object state)
internal void SetSocketOption (SocketOptionLevel optionLevel, SocketOptionName optionName, int optionValue, bool silent)
{
- if (is_disposed && is_closed) {
+ if (CleanedUp && is_closed) {
if (silent)
return;
throw new ObjectDisposedException (GetType ().ToString ());
int error;
- SetSocketOption_internal (safe_handle, optionLevel, optionName, null,
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, null,
null, optionValue, out error);
if (!silent && error != 0)
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's SslStream.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-using System.Threading;
-using System.Security.Cryptography.X509Certificates;
-using MNS = Mono.Net.Security;
-
-namespace System.Net.Security
-{
- using System.Net.Sockets;
- using System.IO;
-
- partial class SslStream : IMonoTlsEventSink
- {
- #if SECURITY_DEP
- SSPIConfiguration _Configuration;
-
- internal SslStream (Stream innerStream, bool leaveInnerStreamOpen, EncryptionPolicy encryptionPolicy, MonoTlsProvider provider, MonoTlsSettings settings)
- : base (innerStream, leaveInnerStreamOpen)
- {
- if (encryptionPolicy != EncryptionPolicy.RequireEncryption && encryptionPolicy != EncryptionPolicy.AllowNoEncryption && encryptionPolicy != EncryptionPolicy.NoEncryption)
- throw new ArgumentException (SR.GetString (SR.net_invalid_enum, "EncryptionPolicy"), "encryptionPolicy");
-
- var validationHelper = MNS.ChainValidationHelper.CloneWithCallbackWrapper (provider, ref settings, myUserCertValidationCallbackWrapper);
-
- LocalCertSelectionCallback selectionCallback = null;
- if (validationHelper.HasCertificateSelectionCallback)
- selectionCallback = validationHelper.SelectClientCertificate;
-
- var internalProvider = new MNS.Private.MonoTlsProviderWrapper (provider);
- _Configuration = new MyConfiguration (internalProvider, settings, this);
- _SslState = new SslState (innerStream, null, selectionCallback, encryptionPolicy, _Configuration);
- }
-
- /*
- * Mono-specific version of 'userCertValidationCallbackWrapper'; we're called from ChainValidationHelper.ValidateChain() here.
- *
- * Since we're built without the PrebuiltSystem alias, we can't use 'SslPolicyErrors' here. This prevents us from creating a subclass of 'ChainValidationHelper'
- * as well as providing a custom 'ServerCertValidationCallback'.
- */
- bool myUserCertValidationCallbackWrapper (ServerCertValidationCallback callback, X509Certificate certificate, X509Chain chain, MonoSslPolicyErrors sslPolicyErrors)
- {
- m_RemoteCertificateOrBytes = certificate == null ? null : certificate.GetRawCertData ();
- if (callback == null) {
- if (!_SslState.RemoteCertRequired)
- sslPolicyErrors &= ~MonoSslPolicyErrors.RemoteCertificateNotAvailable;
-
- return (sslPolicyErrors == MonoSslPolicyErrors.None);
- }
-
- return MNS.ChainValidationHelper.InvokeCallback (callback, this, certificate, chain, sslPolicyErrors);
- }
-
- class MyConfiguration : SSPIConfiguration
- {
- MNS.IMonoTlsProvider provider;
- MonoTlsSettings settings;
- IMonoTlsEventSink eventSink;
-
- public MyConfiguration (MNS.IMonoTlsProvider provider, MonoTlsSettings settings, IMonoTlsEventSink eventSink)
- {
- this.provider = provider;
- this.settings = settings;
- this.eventSink = eventSink;
- }
-
- public MNS.IMonoTlsProvider Provider {
- get { return provider; }
- }
-
- public MonoTlsSettings Settings {
- get { return settings; }
- }
-
- public IMonoTlsEventSink EventSink {
- get { return eventSink; }
- }
- }
- #endif
-
- internal bool IsClosed {
- get { return _SslState.IsClosed; }
- }
-
- internal Exception LastError {
- get { return lastError; }
- }
-
- #region IMonoTlsEventSink
-
- Exception lastError;
-
- void IMonoTlsEventSink.Error (Exception exception)
- {
- Interlocked.CompareExchange<Exception> (ref lastError, exception, null);
- }
-
- void IMonoTlsEventSink.ReceivedCloseNotify ()
- {
- }
-
- #endregion
-
- internal IAsyncResult BeginShutdown (AsyncCallback asyncCallback, object asyncState)
- {
- return _SslState.BeginShutdown (asyncCallback, asyncState);
- }
-
- internal void EndShutdown (IAsyncResult asyncResult)
- {
- _SslState.EndShutdown (asyncResult);
- }
-
- internal IAsyncResult BeginRenegotiate (AsyncCallback asyncCallback, object asyncState)
- {
- return _SslState.BeginRenegotiate (asyncCallback, asyncState);
- }
-
- internal void EndRenegotiate (IAsyncResult asyncResult)
- {
- _SslState.EndRenegotiate (asyncResult);
- }
-
- internal X509Certificate InternalLocalCertificate {
- get { return _SslState.InternalLocalCertificate; }
- }
-
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return _SslState.GetMonoConnectionInfo ();
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SecureChannel.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-namespace System.Net.Security
-{
- partial class SecureChannel
- {
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return SSPIWrapper.GetMonoConnectionInfo (m_SecModule, m_SecurityContext);
- }
-
- internal ProtocolToken CreateShutdownMessage ()
- {
- var buffer = SSPIWrapper.CreateShutdownMessage (m_SecModule, m_SecurityContext);
- return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
- }
-
- internal ProtocolToken CreateHelloRequestMessage ()
- {
- var buffer = SSPIWrapper.CreateHelloRequestMessage (m_SecModule, m_SecurityContext);
- return new ProtocolToken (buffer, SecurityStatus.ContinueNeeded);
- }
-
- internal bool IsClosed {
- get {
- if (m_SecModule == null || m_SecurityContext == null || m_SecurityContext.IsClosed)
- return true;
- return SSPIWrapper.IsClosed (m_SecModule, m_SecurityContext);
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SslState.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-#if MONO_SECURITY_ALIAS
-extern alias MonoSecurity;
-using MonoSecurity::Mono.Security.Interface;
-#else
-using Mono.Security.Interface;
-#endif
-namespace System.Net.Security
-{
- using System.IO;
- using System.Threading;
- using System.Net.Sockets;
-
- partial class SslState
- {
- int _SentShutdown;
-
- internal MonoTlsConnectionInfo GetMonoConnectionInfo ()
- {
- return Context.GetMonoConnectionInfo ();
- }
-
- internal bool IsClosed {
- get { return Context.IsClosed; }
- }
-
- internal ProtocolToken CreateShutdownMessage ()
- {
- return Context.CreateShutdownMessage ();
- }
-
- internal ProtocolToken CreateHelloRequestMessage ()
- {
- return Context.CreateHelloRequestMessage ();
- }
-
- internal IAsyncResult BeginShutdown (AsyncCallback asyncCallback, object asyncState)
- {
- var shutdownResult = new ShutdownAsyncResult (this, asyncState, asyncCallback);
-
- if (Interlocked.CompareExchange (ref _SentShutdown, 1, 0) == 1) {
- shutdownResult.InvokeCallback ();
- return shutdownResult;
- }
-
- try
- {
- CheckThrow (false);
- shutdownResult.SentShutdown = true;
- SecureStream.BeginShutdown (shutdownResult);
- return shutdownResult;
- } catch (Exception e) {
- if (e is IOException)
- throw;
- throw new IOException (SR.GetString (SR.mono_net_io_shutdown), e);
- }
- }
-
- internal void EndShutdown (IAsyncResult asyncResult)
- {
- if (asyncResult == null)
- throw new ArgumentNullException ("asyncResult");
-
- var shutdownResult = asyncResult as ShutdownAsyncResult;
- if (shutdownResult == null)
- throw new ArgumentException (SR.GetString (SR.net_io_async_result, asyncResult.GetType ().FullName), "asyncResult");
-
- if (shutdownResult.SentShutdown)
- SecureStream.EndShutdown (shutdownResult);
- }
-
- internal IAsyncResult BeginRenegotiate (AsyncCallback asyncCallback, object asyncState)
- {
- var lazyResult = new LazyAsyncResult (this, asyncState, asyncCallback);
-
- if (Interlocked.Exchange (ref _NestedAuth, 1) == 1)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidnestedcall, "BeginRenegotiate", "renegotiate"));
- if (Interlocked.CompareExchange (ref _PendingReHandshake, 1, 0) == 1)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidnestedcall, "BeginRenegotiate", "renegotiate"));
-
- try {
- CheckThrow (false);
- SecureStream.BeginRenegotiate (lazyResult);
- return lazyResult;
- } catch (Exception e) {
- _NestedAuth = 0;
- if (e is IOException)
- throw;
- throw new IOException (SR.GetString (SR.mono_net_io_renegotiate), e);
- }
- }
-
- internal void EndRenegotiate (IAsyncResult result)
- {
- if (result == null)
- throw new ArgumentNullException ("asyncResult");
-
- LazyAsyncResult lazyResult = result as LazyAsyncResult;
- if (lazyResult == null)
- throw new ArgumentException (SR.GetString (SR.net_io_async_result, result.GetType ().FullName), "asyncResult");
-
- if (Interlocked.Exchange (ref _NestedAuth, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndRenegotiate"));
-
- SecureStream.EndRenegotiate (lazyResult);
- }
-
- internal bool CheckEnqueueHandshakeWrite (byte[] buffer, AsyncProtocolRequest asyncRequest)
- {
- return CheckEnqueueHandshake (buffer, asyncRequest);
- }
-
- internal void StartReHandshake (AsyncProtocolRequest asyncRequest)
- {
- if (IsServer) {
- byte[] buffer = null;
- if (CheckEnqueueHandshakeRead (ref buffer, asyncRequest))
- return;
-
- StartReceiveBlob (buffer, asyncRequest);
- return;
- }
-
- ForceAuthentication (false, null, asyncRequest);
- }
-
- class ShutdownAsyncResult : LazyAsyncResult
- {
- public bool SentShutdown;
-
- internal ShutdownAsyncResult (SslState instance, object userState, AsyncCallback callback)
- : base (instance, userState, callback)
- {
- }
- }
- }
-}
-#endif
+++ /dev/null
-//
-// Mono-specific additions to Microsoft's _SslStream.cs
-//
-#if MONO_FEATURE_NEW_TLS && SECURITY_DEP
-namespace System.Net.Security
-{
- using System.IO;
- using System.Threading;
- using System.Net.Sockets;
-
- partial class _SslStream
- {
- static readonly AsyncCallback _HandshakeWriteCallback = new AsyncCallback (HandshakeWriteCallback);
- static readonly HandshakeProtocolCallback _ResumeHandshakeWriteCallback = new HandshakeProtocolCallback (ResumeHandshakeWriteCallback);
-
- internal void BeginShutdown (LazyAsyncResult lazyResult)
- {
- HandshakeProtocolRequest asyncRequest = new HandshakeProtocolRequest (lazyResult);
-
- if (Interlocked.Exchange (ref _NestedWrite, 1) == 1)
- throw new NotSupportedException (SR.GetString (SR.net_io_invalidnestedcall, (asyncRequest != null ? "BeginShutdown" : "Shutdown"), "shutdown"));
-
- bool failed = false;
- try
- {
- ProtocolToken message = _SslState.CreateShutdownMessage ();
- asyncRequest.SetNextRequest (HandshakeProtocolState.Shutdown, message, _ResumeHandshakeWriteCallback);
-
- StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- failed = true;
- throw;
- } finally {
- if (failed)
- _NestedWrite = 0;
- }
- }
-
- internal void EndShutdown (LazyAsyncResult lazyResult)
- {
- if (Interlocked.Exchange (ref _NestedWrite, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndShutdown"));
-
- // No "artificial" timeouts implemented so far, InnerStream controls timeout.
- lazyResult.InternalWaitForCompletion ();
-
- if (lazyResult.Result is Exception) {
- if (lazyResult.Result is IOException)
- throw (Exception)lazyResult.Result;
- throw new IOException (SR.GetString (SR.mono_net_io_shutdown), (Exception)lazyResult.Result);
- }
- }
-
- internal void BeginRenegotiate (LazyAsyncResult lazyResult)
- {
- HandshakeProtocolRequest asyncRequest = new HandshakeProtocolRequest (lazyResult);
-
- if (Interlocked.Exchange (ref _NestedWrite, 1) == 1)
- throw new NotSupportedException (SR.GetString (SR.net_io_invalidnestedcall, (asyncRequest != null ? "BeginRenegotiate" : "Renegotiate"), "renegotiate"));
-
- bool failed = false;
- try
- {
- if (_SslState.IsServer) {
- ProtocolToken message = _SslState.CreateHelloRequestMessage ();
- asyncRequest.SetNextRequest (HandshakeProtocolState.SendHelloRequest, message, _ResumeHandshakeWriteCallback);
- } else {
- asyncRequest.SetNextRequest (HandshakeProtocolState.ClientRenegotiation, null, _ResumeHandshakeWriteCallback);
- }
-
- StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- failed = true;
- throw;
- } finally {
- if (failed)
- _NestedWrite = 0;
- }
- }
-
- internal void EndRenegotiate (LazyAsyncResult lazyResult)
- {
- if (Interlocked.Exchange (ref _NestedWrite, 0) == 0)
- throw new InvalidOperationException (SR.GetString (SR.net_io_invalidendcall, "EndRenegotiate"));
-
- // No "artificial" timeouts implemented so far, InnerStream controls timeout.
- lazyResult.InternalWaitForCompletion();
-
- if (lazyResult.Result is Exception) {
- if (lazyResult.Result is IOException)
- throw (Exception)lazyResult.Result;
- throw new IOException (SR.GetString (SR.mono_net_io_renegotiate), (Exception)lazyResult.Result);
- }
- }
-
- void StartHandshakeWrite (HandshakeProtocolRequest asyncRequest)
- {
- byte[] buffer = null;
- if (asyncRequest.Message != null) {
- buffer = asyncRequest.Message.Payload;
- if (buffer.Length != asyncRequest.Message.Size) {
- buffer = new byte [asyncRequest.Message.Size];
- Buffer.BlockCopy (asyncRequest.Message.Payload, 0, buffer, 0, buffer.Length);
- }
- }
-
- switch (asyncRequest.State) {
- case HandshakeProtocolState.ClientRenegotiation:
- case HandshakeProtocolState.ServerRenegotiation:
- _SslState.StartReHandshake (asyncRequest);
- return;
-
- case HandshakeProtocolState.SendHelloRequest:
- if (_SslState.CheckEnqueueHandshakeWrite (buffer, asyncRequest)) {
- // operation is async and has been queued, return.
- return;
- }
- break;
-
- case HandshakeProtocolState.Shutdown:
- if (_SslState.CheckEnqueueWrite (asyncRequest)) {
- // operation is async and has been queued, return.
- return;
- }
- break;
-
- default:
- throw new InvalidOperationException ();
- }
-
- if (_SslState.LastPayload != null)
- throw new InvalidOperationException ();
-
- // prepare for the next request
- IAsyncResult ar = ((NetworkStream)_SslState.InnerStream).BeginWrite (buffer, 0, buffer.Length, _HandshakeWriteCallback, asyncRequest);
- if (!ar.CompletedSynchronously)
- return;
-
- HandshakeWriteCallback (asyncRequest, ar);
- }
-
- static void HandshakeWriteCallback (IAsyncResult transportResult)
- {
- if (transportResult.CompletedSynchronously)
- return;
-
- HandshakeProtocolRequest asyncRequest = (HandshakeProtocolRequest)transportResult.AsyncState;
-
- SslState sslState = (SslState)asyncRequest.AsyncObject;
- sslState.SecureStream.HandshakeWriteCallback (asyncRequest, transportResult);
- }
-
- void HandshakeWriteCallback (HandshakeProtocolRequest asyncRequest, IAsyncResult transportResult)
- {
- try {
- _SslState.InnerStream.EndWrite (transportResult);
- } catch (Exception e) {
- _SslState.FinishWrite ();
- if (!asyncRequest.IsUserCompleted) {
- asyncRequest.CompleteWithError (e);
- return;
- }
- throw;
- }
-
- if (asyncRequest.State == HandshakeProtocolState.SendHelloRequest) {
- asyncRequest.SetNextRequest (HandshakeProtocolState.ServerRenegotiation, null, _ResumeHandshakeWriteCallback);
- StartHandshakeWrite (asyncRequest);
- return;
- }
-
- try {
- _SslState.FinishWrite ();
- asyncRequest.CompleteUser ();
- } catch (Exception e) {
- if (!asyncRequest.IsUserCompleted) {
- asyncRequest.CompleteWithError (e);
- return;
- }
- throw;
- }
- }
-
- static void ResumeHandshakeWriteCallback (HandshakeProtocolRequest asyncRequest)
- {
- try {
- ((_SslStream)asyncRequest.AsyncObject).StartHandshakeWrite (asyncRequest);
- } catch (Exception e) {
- if (asyncRequest.IsUserCompleted) {
- // This will throw on a worker thread.
- throw;
- }
- ((_SslStream)asyncRequest.AsyncObject)._SslState.FinishWrite ();
- asyncRequest.CompleteWithError (e);
- }
- }
-
- delegate void HandshakeProtocolCallback (HandshakeProtocolRequest asyncRequest);
-
- enum HandshakeProtocolState {
- None,
- Shutdown,
- SendHelloRequest,
- ServerRenegotiation,
- ClientRenegotiation
- }
-
- class HandshakeProtocolRequest : AsyncProtocolRequest
- {
- public ProtocolToken Message;
- public HandshakeProtocolState State;
-
- public HandshakeProtocolRequest (LazyAsyncResult userAsyncResult)
- : base (userAsyncResult)
- {
- State = HandshakeProtocolState.None;
- }
-
- public void SetNextRequest (HandshakeProtocolState state, ProtocolToken message, HandshakeProtocolCallback callback)
- {
- State = state;
- Message = message;
- SetNextRequest (null, 0, 0, (r) => callback ((HandshakeProtocolRequest)r));
- }
- }
- }
-}
-#endif
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
- <Compile Include="ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="ReferenceSources\_SslState.cs" />\r
- <Compile Include="ReferenceSources\_SslStream.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
<Compile Include="ReferenceSources\HttpApi.cs" />\r
<Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
- <Compile Include="ReferenceSources\Internal.cs" />\r
<Compile Include="ReferenceSources\Logging.cs" />\r
<Compile Include="ReferenceSources\NativeMethods.cs" />\r
<Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
<Compile Include="ReferenceSources\SR.cs" />\r
<Compile Include="ReferenceSources\SR2.cs" />\r
<Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
- <Compile Include="ReferenceSources\SslStream.cs" />\r
- <Compile Include="ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="ReferenceSources\SSPIWrapper.cs" />\r
<Compile Include="ReferenceSources\Win32Exception.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
<Compile Include="Mono.Net.Security\MonoTlsStream.cs" />\r
<Compile Include="Mono.Net.Security\NoReflectionHelper.cs" />\r
<Compile Include="Mono.Net.Security\SystemCertificateValidator.cs" />\r
- <Compile Include="ReferenceSources\_SecureChannel.cs" />\r
- <Compile Include="ReferenceSources\_SslState.cs" />\r
- <Compile Include="ReferenceSources\_SslStream.cs" />\r
<Compile Include="ReferenceSources\AssertWrapper.cs" />\r
<Compile Include="ReferenceSources\AutoWebProxyScriptEngine.cs" />\r
<Compile Include="ReferenceSources\BinaryCompatibility.cs" />\r
<Compile Include="ReferenceSources\EnvironmentHelpers.cs" />\r
<Compile Include="ReferenceSources\HttpApi.cs" />\r
<Compile Include="ReferenceSources\HttpSysSettings.cs" />\r
- <Compile Include="ReferenceSources\Internal.cs" />\r
<Compile Include="ReferenceSources\Logging.cs" />\r
<Compile Include="ReferenceSources\NativeMethods.cs" />\r
<Compile Include="ReferenceSources\RequestCacheProtocol.cs" />\r
<Compile Include="ReferenceSources\SR.cs" />\r
<Compile Include="ReferenceSources\SR2.cs" />\r
<Compile Include="ReferenceSources\SRCategoryAttribute.cs" />\r
- <Compile Include="ReferenceSources\SslStream.cs" />\r
- <Compile Include="ReferenceSources\SSPIConfiguration.cs" />\r
- <Compile Include="ReferenceSources\SSPISafeHandles.cs" />\r
- <Compile Include="ReferenceSources\SSPIWrapper.cs" />\r
<Compile Include="ReferenceSources\Win32Exception.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeCompiler.cs" />\r
<Compile Include="System.CodeDom.Compiler\CodeDomConfigurationHandler.cs" />\r
+++ /dev/null
-//
-// System.Diagnostics.ProcessModuleCollection.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-
-namespace System.Diagnostics
-{
-#if MOBILE
- public class ProcessModuleCollectionBase : System.Collections.Generic.List<ProcessModule>
- {
- protected ProcessModuleCollectionBase InnerList {
- get { return this; }
- }
-
- public System.Collections.IEnumerator GetEnumerator ()
- {
- return ((System.Collections.IEnumerable)InnerList).GetEnumerator ();
- }
- }
-#endif
-
- public class ProcessModuleCollection :
-#if !MOBILE
- ReadOnlyCollectionBase
-#else
- ProcessModuleCollectionBase
-#endif
- {
- protected ProcessModuleCollection()
- {
- }
-
- public ProcessModuleCollection(ProcessModule[] processModules)
- {
- InnerList.AddRange (processModules);
- }
-
- public ProcessModule this[int index] {
- get {
- return (ProcessModule)InnerList[index];
- }
- }
-
- public bool Contains(ProcessModule module)
- {
- return InnerList.Contains (module);
- }
-
- public void CopyTo(ProcessModule[] array, int index)
- {
- InnerList.CopyTo (array, index);
- }
-
- public int IndexOf(ProcessModule module)
- {
- return InnerList.IndexOf (module);
- }
- }
-}
+++ /dev/null
-//
-// System.Diagnostics.ProcessThreadCollection.cs
-//
-// Authors:
-// Dick Porter (dick@ximian.com)
-// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
-//
-// (C) 2002 Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Collections;
-
-namespace System.Diagnostics
-{
-#if MOBILE
- public class ProcessThreadCollectionBase : System.Collections.Generic.List<ProcessThread>
- {
- protected ProcessThreadCollectionBase InnerList {
- get { return this; }
- }
-
- public new int Add (ProcessThread thread)
- {
- base.Add (thread);
- return Count - 1;
- }
-
- public System.Collections.IEnumerator GetEnumerator ()
- {
- return ((System.Collections.IEnumerable)InnerList).GetEnumerator ();
- }
- }
-#endif
-
- public class ProcessThreadCollection :
-#if !MOBILE
- ReadOnlyCollectionBase
-#else
- ProcessThreadCollectionBase
-#endif
- {
- protected ProcessThreadCollection()
- {
- }
-
- internal static ProcessThreadCollection GetEmpty ()
- {
- return new ProcessThreadCollection ();
- }
-
- public ProcessThreadCollection(ProcessThread[] processThreads)
- {
- InnerList.AddRange (processThreads);
- }
-
- public ProcessThread this[int index] {
- get {
- return (ProcessThread)InnerList[index];
- }
- }
-
- public int Add(ProcessThread thread)
- {
- return InnerList.Add (thread);
- }
-
- public bool Contains(ProcessThread thread)
- {
- return InnerList.Contains (thread);
- }
-
- public void CopyTo(ProcessThread[] array, int index)
- {
- InnerList.CopyTo (array, index);
- }
-
- public int IndexOf(ProcessThread thread)
- {
- return InnerList.IndexOf (thread);
- }
-
- public void Insert(int index, ProcessThread thread)
- {
- InnerList.Insert (index, thread);
- }
-
- public void Remove(ProcessThread thread)
- {
- InnerList.Remove (thread);
- }
- }
-}
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+using System.ComponentModel;
+
namespace System.IO
{
- public class FileSystemWatcher : IDisposable
+ public class FileSystemWatcher : Component, IDisposable, ISupportInitialize
{
public FileSystemWatcher () { throw new NotImplementedException (); }
public FileSystemWatcher (string path) { throw new NotImplementedException (); }
public int InternalBufferSize { get { throw new NotImplementedException (); } set { } }
public NotifyFilters NotifyFilter { get { throw new NotImplementedException (); } set { } }
public string Path { get { throw new NotImplementedException (); } set { } }
+ public override ISite Site { get { throw new NotImplementedException (); } set { } }
+ public ISynchronizeInvoke SynchronizingObject { get { throw new NotImplementedException (); } set { } }
public event FileSystemEventHandler Changed;
public event FileSystemEventHandler Created;
public event FileSystemEventHandler Deleted;
public event ErrorEventHandler Error;
public event RenamedEventHandler Renamed;
+ public void BeginInit() { throw new NotImplementedException (); }
+ public void EndInit() { throw new NotImplementedException (); }
protected void OnChanged (FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnCreated (FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnDeleted (System.IO.FileSystemEventArgs e) { throw new NotImplementedException (); }
protected void OnRenamed (RenamedEventArgs e) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType) { throw new NotImplementedException (); }
public WaitForChangedResult WaitForChanged (WatcherChangeTypes changeType, int timeout) { throw new NotImplementedException (); }
-
- public virtual void Dispose ()
- {
- }
-
- protected virtual void Dispose (bool disposing)
- {
- }
+ public virtual void Dispose () { throw new NotImplementedException (); }
+ protected override void Dispose (bool disposing) { throw new NotImplementedException (); }
}
}
\ No newline at end of file
set { bodyEncoding = value; }
}
+ public TransferEncoding BodyTransferEncoding {
+ get { return GuessTransferEncoding (BodyEncoding); }
+ set { throw new NotImplementedException (); }
+ }
+
public MailAddressCollection CC {
get { return cc; }
}
{
public static readonly Win32IPAddressCollection Empty = new Win32IPAddressCollection (IntPtr.Zero);
- bool is_readonly;
-
// for static methods
Win32IPAddressCollection ()
{
{
foreach (IntPtr head in heads)
AddSubsequentlyString (head);
- is_readonly = true;
}
public Win32IPAddressCollection (params Win32_IP_ADDR_STRING [] al)
foreach (Win32_IP_ADDR_STRING a in al) {
if (String.IsNullOrEmpty (a.IpAddress))
continue;
- Add (IPAddress.Parse (a.IpAddress));
+ InternalAdd (IPAddress.Parse (a.IpAddress));
AddSubsequentlyString (a.Next);
}
- is_readonly = true;
}
public static Win32IPAddressCollection FromAnycast (IntPtr ptr)
Win32_IP_ADAPTER_ANYCAST_ADDRESS a;
for (IntPtr p = ptr; p != IntPtr.Zero; p = a.Next) {
a = (Win32_IP_ADAPTER_ANYCAST_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_ANYCAST_ADDRESS));
- c.Add (a.Address.GetIPAddress ());
+ c.InternalAdd (a.Address.GetIPAddress ());
}
- c.is_readonly = true;
return c;
}
a = (Win32_IP_ADAPTER_DNS_SERVER_ADDRESS) Marshal.PtrToStructure (p, typeof (Win32_IP_ADAPTER_DNS_SERVER_ADDRESS));
// FIXME: It somehow fails here. Looks like there is something wrong.
//if (a.Address.Sockaddr == IntPtr.Zero) throw new Exception ("pointer " + p + " a.length " + a.Address.SockaddrLength);
- c.Add (a.Address.GetIPAddress ());
+ c.InternalAdd (a.Address.GetIPAddress ());
}
- c.is_readonly = true;
return c;
}
Win32_IP_ADDR_STRING a;
for (IntPtr p = head; p != IntPtr.Zero; p = a.Next) {
a = (Win32_IP_ADDR_STRING) Marshal.PtrToStructure (p, typeof (Win32_IP_ADDR_STRING));
- Add (IPAddress.Parse (a.IpAddress));
+ InternalAdd (IPAddress.Parse (a.IpAddress));
}
}
-
- public override bool IsReadOnly {
- get { return is_readonly; }
- }
}
#endif
}
#if !MOBILE
class Win32NetworkInterfaceAPI : NetworkInterfaceFactory
{
- [DllImport ("iphlpapi.dll", SetLastError = true)]
+ private const string IPHLPAPI = "iphlpapi.dll";
+
+ [DllImport (IPHLPAPI, SetLastError = true)]
static extern int GetAdaptersAddresses (uint family, uint flags, IntPtr reserved, byte [] info, ref int size);
+ [DllImport (IPHLPAPI)]
+ static extern uint GetBestInterfaceEx (byte[] ipAddress, out int index);
+
unsafe static Win32_IP_ADAPTER_ADDRESSES [] GetAdaptersAddresses ()
{
byte [] bytes = null;
return ret;
}
+ private static int GetBestInterfaceForAddress (IPAddress addr) {
+ int index;
+ SocketAddress address = new SocketAddress (addr);
+ int error = (int) GetBestInterfaceEx (address.m_Buffer, out index);
+ if (error != 0) {
+ throw new NetworkInformationException (error);
+ }
+
+ return index;
+ }
+
public override int GetLoopbackInterfaceIndex ()
{
- throw new NotImplementedException ();
+ return GetBestInterfaceForAddress (IPAddress.Loopback);
}
public override IPAddress GetNetMask (IPAddress address)
bytes = new byte [100];
do {
EndPoint endpoint = client;
- int error = 0;
- int rc = s.ReceiveFrom_nochecks_exc (bytes, 0, 100, SocketFlags.None,
- ref endpoint, false, out error);
+ SocketError error = 0;
+ int rc = s.ReceiveFrom (bytes, 0, 100, SocketFlags.None,
+ ref endpoint, out error);
- if (error != 0) {
- if (error == (int) SocketError.TimedOut) {
+ if (error != SocketError.Success) {
+ if (error == SocketError.TimedOut) {
return new PingReply (null, new byte [0], options, 0, IPStatus.TimedOut);
}
throw new NotSupportedException (String.Format ("Unexpected socket error during ping request: {0}", error));
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, AsyncCallback asyncCallback, object asyncState)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, string targetName, AsyncCallback asyncCallback, object asyncState)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual IAsyncResult BeginAuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override IAsyncResult BeginRead (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public virtual IAsyncResult BeginAuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel, AsyncCallback asyncCallback, object asyncState)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual IAsyncResult BeginAuthenticateAsServer (ExtendedProtectionPolicy policy, AsyncCallback asyncCallback, object asyncState)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public override IAsyncResult BeginWrite (byte[] buffer, int offset, int count, AsyncCallback asyncCallback, object asyncState)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void AuthenticateAsClient (NetworkCredential credential, ChannelBinding binding, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public virtual void AuthenticateAsClient (NetworkCredential credential, string targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public virtual void AuthenticateAsServer (ExtendedProtectionPolicy policy)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
+ public virtual void AuthenticateAsServer (NetworkCredential credential, ExtendedProtectionPolicy policy, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
+ {
+ throw new NotImplementedException ();
+ }
+
[MonoTODO]
public virtual void AuthenticateAsServer (NetworkCredential credential, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel requiredImpersonationLevel)
{
bool is_closed;
bool is_listening;
- bool use_overlapped_io;
+ bool useOverlappedIO;
int linger_timeout;
- AddressFamily address_family;
- SocketType socket_type;
- ProtocolType protocol_type;
+ AddressFamily addressFamily;
+ SocketType socketType;
+ ProtocolType protocolType;
- /* the field "safe_handle" is looked up by name by the runtime */
- internal SafeSocketHandle safe_handle;
+ /* the field "m_Handle" is looked up by name by the runtime */
+ internal SafeSocketHandle m_Handle;
/*
* This EndPoint is used when creating new endpoints. Because
*/
internal EndPoint seed_endpoint = null;
- internal Queue<KeyValuePair<IntPtr, IOSelectorJob>> readQ = new Queue<KeyValuePair<IntPtr, IOSelectorJob>> (2);
- internal Queue<KeyValuePair<IntPtr, IOSelectorJob>> writeQ = new Queue<KeyValuePair<IntPtr, IOSelectorJob>> (2);
+ internal SemaphoreSlim ReadSem = new SemaphoreSlim (1, 1);
+ internal SemaphoreSlim WriteSem = new SemaphoreSlim (1, 1);
internal bool is_blocking = true;
internal bool is_bound;
/* When true, the socket was connected at the time of the last IO operation */
internal bool is_connected;
- internal bool is_disposed;
+ int m_IntCleanedUp;
internal bool connect_in_progress;
+ private static volatile bool s_LoggingEnabled = Logging.On;
+
#region Constructors
static Socket ()
}
}
- //
- // This constructor is used by servers that want to listen for instance on both
- // ipv4 and ipv6. Mono has historically done that if you use InterNetworkV6 (at
- // least on Unix), because that is the default behavior unless the IPV6_V6ONLY
- // option is explicitly set by using setsockopt (sock, IPPROTO_IPV6, IPV6_ONLY)
- //
- public Socket (SocketType socketType, ProtocolType protocolType)
- : this (AddressFamily.InterNetworkV6, socketType, protocolType)
- {
- DualMode = true;
- }
-
public Socket(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
{
- this.address_family = addressFamily;
- this.socket_type = socketType;
- this.protocol_type = protocolType;
+ this.addressFamily = addressFamily;
+ this.socketType = socketType;
+ this.protocolType = protocolType;
int error;
- this.safe_handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
+ this.m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
if (error != 0)
throw new SocketException (error);
SocketDefaults ();
}
-#if !MOBILE
public Socket (SocketInformation socketInformation)
{
this.is_listening = (socketInformation.Options & SocketInformationOptions.Listening) != 0;
this.is_connected = (socketInformation.Options & SocketInformationOptions.Connected) != 0;
this.is_blocking = (socketInformation.Options & SocketInformationOptions.NonBlocking) == 0;
- this.use_overlapped_io = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
+ this.useOverlappedIO = (socketInformation.Options & SocketInformationOptions.UseOnlyOverlappedIO) != 0;
var result = Mono.DataConverter.Unpack ("iiiil", socketInformation.ProtocolInformation, 0);
- this.address_family = (AddressFamily) (int) result [0];
- this.socket_type = (SocketType) (int) result [1];
- this.protocol_type = (ProtocolType) (int) result [2];
+ this.addressFamily = (AddressFamily) (int) result [0];
+ this.socketType = (SocketType) (int) result [1];
+ this.protocolType = (ProtocolType) (int) result [2];
this.is_bound = (ProtocolType) (int) result [3] != 0;
- this.safe_handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
+ this.m_Handle = new SafeSocketHandle ((IntPtr) (long) result [4], true);
SocketDefaults ();
}
-#endif
/* private constructor used by Accept, which already has a socket handle to use */
internal Socket(AddressFamily family, SocketType type, ProtocolType proto, SafeSocketHandle safe_handle)
{
- this.address_family = family;
- this.socket_type = type;
- this.protocol_type = proto;
+ this.addressFamily = family;
+ this.socketType = type;
+ this.protocolType = proto;
- this.safe_handle = safe_handle;
+ this.m_Handle = safe_handle;
this.is_connected = true;
}
- ~Socket ()
- {
- Dispose (false);
- }
-
void SocketDefaults ()
{
try {
/* Need to test IPv6 further */
- if (address_family == AddressFamily.InterNetwork
- // || address_family == AddressFamily.InterNetworkV6
+ if (addressFamily == AddressFamily.InterNetwork
+ // || addressFamily == AddressFamily.InterNetworkV6
) {
/* This is the default, but it probably has nasty side
* effects on Linux, as the socket option is kludged by
* turning on or off PMTU discovery... */
this.DontFragment = false;
- this.NoDelay = false;
- } else if (address_family == AddressFamily.InterNetworkV6) {
+ if (protocolType == ProtocolType.Tcp)
+ this.NoDelay = false;
+ } else if (addressFamily == AddressFamily.InterNetworkV6) {
this.DualMode = true;
}
ThrowIfDisposedAndClosed ();
int ret, error;
- ret = Available_internal (safe_handle, out error);
+ ret = Available_internal (m_Handle, out error);
if (error != 0)
throw new SocketException (error);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static int Available_internal (IntPtr socket, out int error);
- public bool DontFragment {
- get {
- ThrowIfDisposedAndClosed ();
-
- switch (address_family) {
- case AddressFamily.InterNetwork:
- return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment)) != 0;
- case AddressFamily.InterNetworkV6:
- return ((int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment)) != 0;
- default:
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- switch (address_family) {
- case AddressFamily.InterNetwork:
- SetSocketOption (SocketOptionLevel.IP, SocketOptionName.DontFragment, value ? 1 : 0);
- break;
- case AddressFamily.InterNetworkV6:
- SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.DontFragment, value ? 1 : 0);
- break;
- default:
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
- }
- }
-
+ // FIXME: import from referencesource
public bool EnableBroadcast {
get {
ThrowIfDisposedAndClosed ();
- if (protocol_type != ProtocolType.Udp)
+ if (protocolType != ProtocolType.Udp)
throw new SocketException ((int) SocketError.ProtocolOption);
return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast)) != 0;
set {
ThrowIfDisposedAndClosed ();
- if (protocol_type != ProtocolType.Udp)
+ if (protocolType != ProtocolType.Udp)
throw new SocketException ((int) SocketError.ProtocolOption);
SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
}
}
- public bool ExclusiveAddressUse {
- get {
- ThrowIfDisposedAndClosed ();
-
- return ((int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse)) != 0;
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (is_bound)
- throw new InvalidOperationException ("Bind has already been called for this socket");
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ExclusiveAddressUse, value ? 1 : 0);
- }
- }
-
public bool IsBound {
get {
return is_bound;
}
}
- public LingerOption LingerState {
- get {
- ThrowIfDisposedAndClosed ();
-
- return (LingerOption) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger);
- }
- set {
- ThrowIfDisposedAndClosed ();
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.Linger, value);
- }
- }
-
+ // FIXME: import from referencesource
public bool MulticastLoopback {
get {
ThrowIfDisposedAndClosed ();
* "Setting this property on a Transmission Control Protocol (TCP)
* socket will have no effect." but the MS runtime throws the
* exception...) */
- if (protocol_type == ProtocolType.Tcp)
+ if (protocolType == ProtocolType.Tcp)
throw new SocketException ((int)SocketError.ProtocolOption);
- switch (address_family) {
+ switch (addressFamily) {
case AddressFamily.InterNetwork:
return ((int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback)) != 0;
case AddressFamily.InterNetworkV6:
* "Setting this property on a Transmission Control Protocol (TCP)
* socket will have no effect." but the MS runtime throws the
* exception...) */
- if (protocol_type == ProtocolType.Tcp)
+ if (protocolType == ProtocolType.Tcp)
throw new SocketException ((int)SocketError.ProtocolOption);
- switch (address_family) {
+ switch (addressFamily) {
case AddressFamily.InterNetwork:
SetSocketOption (SocketOptionLevel.IP, SocketOptionName.MulticastLoopback, value ? 1 : 0);
break;
}
}
- public bool DualMode {
- get {
- if (AddressFamily != AddressFamily.InterNetworkV6)
- throw new NotSupportedException("This protocol version is not supported");
-
- return ((int)GetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only) == 0);
- }
- set {
- if (AddressFamily != AddressFamily.InterNetworkV6)
- throw new NotSupportedException("This protocol version is not supported");
-
- SetSocketOption(SocketOptionLevel.IPv6, SocketOptionName.IPv6Only, value ? 0 : 1);
- }
- }
-
- private bool IsDualMode {
- get {
- return AddressFamily == AddressFamily.InterNetworkV6 && DualMode;
- }
- }
-
- [MonoTODO ("This doesn't do anything on Mono yet")]
- public bool UseOnlyOverlappedIO {
- get { return use_overlapped_io; }
- set { use_overlapped_io = value; }
- }
-
- public IntPtr Handle {
- get { return safe_handle.DangerousGetHandle (); }
- }
-
// Wish: support non-IP endpoints.
public EndPoint LocalEndPoint {
get {
return null;
int error;
- SocketAddress sa = LocalEndPoint_internal (safe_handle, (int) address_family, out error);
+ SocketAddress sa = LocalEndPoint_internal (m_Handle, (int) addressFamily, out error);
if (error != 0)
throw new SocketException (error);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern static SocketAddress LocalEndPoint_internal (IntPtr socket, int family, out int error);
- public SocketType SocketType {
- get { return socket_type; }
- }
-
- public int SendTimeout {
- get {
- ThrowIfDisposedAndClosed ();
-
- return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout);
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (value < -1)
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
-
- /* According to the MSDN docs we should adjust values between 1 and
- * 499 to 500, but the MS runtime doesn't do this. */
- if (value == -1)
- value = 0;
-
- SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, value);
- }
- }
-
- public int ReceiveTimeout {
- get {
- ThrowIfDisposedAndClosed ();
-
- return (int) GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout);
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (value < -1)
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than -1");
-
- if (value == -1)
- value = 0;
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, value);
- }
- }
-
- public AddressFamily AddressFamily {
- get { return address_family; }
- }
-
public bool Blocking {
get { return is_blocking; }
set {
ThrowIfDisposedAndClosed ();
int error;
- Blocking_internal (safe_handle, value, out error);
+ Blocking_internal (m_Handle, value, out error);
if (error != 0)
throw new SocketException (error);
internal set { is_connected = value; }
}
- public ProtocolType ProtocolType {
- get { return protocol_type; }
- }
-
+ // FIXME: import from referencesource
public bool NoDelay {
get {
ThrowIfDisposedAndClosed ();
set {
ThrowIfDisposedAndClosed ();
ThrowIfUdp ();
-
SetSocketOption (SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
}
}
- public int ReceiveBufferSize {
- get {
- ThrowIfDisposedAndClosed ();
-
- return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer);
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (value < 0)
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, value);
- }
- }
-
- public int SendBufferSize {
- get {
- ThrowIfDisposedAndClosed ();
-
- return (int) GetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer);
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (value < 0)
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero");
-
- SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendBuffer, value);
- }
- }
-
- public short Ttl {
- get {
- ThrowIfDisposedAndClosed ();
-
- switch (address_family) {
- case AddressFamily.InterNetwork:
- return (short) (int) GetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive);
- case AddressFamily.InterNetworkV6:
- return (short) (int) GetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit);
- default:
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
- }
- set {
- ThrowIfDisposedAndClosed ();
-
- if (value < 0 || value > 255)
- throw new ArgumentOutOfRangeException ("value", "The value specified for a set operation is less than zero or greater than 255.");
-
- switch (address_family) {
- case AddressFamily.InterNetwork:
- SetSocketOption (SocketOptionLevel.IP, SocketOptionName.IpTimeToLive, value);
- break;
- case AddressFamily.InterNetworkV6:
- SetSocketOption (SocketOptionLevel.IPv6, SocketOptionName.HopLimit, value);
- break;
- default:
- throw new NotSupportedException ("This property is only valid for InterNetwork and InterNetworkV6 sockets");
- }
- }
- }
-
public EndPoint RemoteEndPoint {
get {
ThrowIfDisposedAndClosed ();
return null;
int error;
- SocketAddress sa = RemoteEndPoint_internal (safe_handle, (int) address_family, out error);
+ SocketAddress sa = RemoteEndPoint_internal (m_Handle, (int) addressFamily, out error);
if (error != 0)
throw new SocketException (error);
throw new NotSupportedException ("'mode' parameter is not valid.");
int error;
- bool result = Poll_internal (safe_handle, mode, microSeconds, out error);
+ bool result = Poll_internal (m_Handle, mode, microSeconds, out error);
if (error != 0)
throw new SocketException (error);
ThrowIfDisposedAndClosed ();
int error = 0;
- SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+ SafeSocketHandle safe_handle = Accept_internal (this.m_Handle, out error, is_blocking);
if (error != 0) {
if (is_closed)
ThrowIfDisposedAndClosed ();
int error = 0;
- SafeSocketHandle safe_handle = Accept_internal (this.safe_handle, out error, is_blocking);
+ SafeSocketHandle safe_handle = Accept_internal (this.m_Handle, out error, is_blocking);
if (error != 0) {
if (is_closed)
throw new SocketException (error);
}
- acceptSocket.address_family = this.AddressFamily;
- acceptSocket.socket_type = this.SocketType;
- acceptSocket.protocol_type = this.ProtocolType;
- acceptSocket.safe_handle = safe_handle;
+ acceptSocket.addressFamily = this.AddressFamily;
+ acceptSocket.socketType = this.SocketType;
+ acceptSocket.protocolType = this.ProtocolType;
+ acceptSocket.m_Handle = safe_handle;
acceptSocket.is_connected = true;
acceptSocket.seed_endpoint = this.seed_endpoint;
acceptSocket.Blocking = this.Blocking;
InitSocketAsyncEventArgs (e, AcceptAsyncCallback, e, SocketOperation.Accept);
- QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, e.socket_async_result));
+ QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, e.socket_async_result));
return true;
}
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Accept);
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptCallback, sockares));
return sockares;
}
sockares.Complete (acc_socket);
});
- public IAsyncResult BeginAccept (int receiveSize, AsyncCallback callback, object state)
- {
- ThrowIfDisposedAndClosed ();
-
- if (receiveSize < 0)
- throw new ArgumentOutOfRangeException ("receiveSize", "receiveSize is less than zero");
-
- SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.AcceptReceive) {
- Buffer = new byte [receiveSize],
- Offset = 0,
- Size = receiveSize,
- SockFlags = SocketFlags.None,
- };
-
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
-
- return sockares;
- }
-
public IAsyncResult BeginAccept (Socket acceptSocket, int receiveSize, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
AcceptSocket = acceptSocket,
};
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginAcceptReceiveCallback, sockares));
return sockares;
}
if (sockares.Size > 0) {
try {
SocketError error;
- total = acc_socket.Receive_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out error);
+ total = acc_socket.Receive (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out error);
if (error != 0) {
sockares.Complete (new SocketException ((int) error));
return;
return EndAccept (out buffer, out bytes, result);
}
- public Socket EndAccept (out byte[] buffer, IAsyncResult asyncResult)
- {
- int bytes;
- return EndAccept (out buffer, out bytes, asyncResult);
- }
-
public Socket EndAccept (out byte[] buffer, out int bytesTransferred, IAsyncResult asyncResult)
{
ThrowIfDisposedAndClosed ();
}
int error;
- Bind_internal (safe_handle, localEP.Serialize(), out error);
+ Bind_internal (m_Handle, localEP.Serialize(), out error);
if (error != 0)
throw new SocketException (error);
throw new SocketException ((int) SocketError.InvalidArgument);
int error;
- Listen_internal(safe_handle, backlog, out error);
+ Listen_internal(m_Handle, backlog, out error);
if (error != 0)
throw new SocketException (error);
iep = RemapIPEndPoint (iep);
- Connect_internal (safe_handle, iep.Serialize (), out error);
+ Connect_internal (m_Handle, iep.Serialize (), out error);
if (error == 0) {
is_connected = true;
is_bound = true;
IPEndPoint ep = remoteEP as IPEndPoint;
/* Dgram uses Any to 'disconnect' */
- if (ep != null && socket_type != SocketType.Dgram) {
+ if (ep != null && socketType != SocketType.Dgram) {
if (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any))
throw new SocketException ((int) SocketError.AddressNotAvailable);
}
SocketAddress serial = remoteEP.Serialize ();
int error = 0;
- Connect_internal (safe_handle, serial, out error);
+ Connect_internal (m_Handle, serial, out error);
if (error == 0 || error == 10035)
seed_endpoint = remoteEP; // Keep the ep around for non-blocking sockets
throw new SocketException (error);
}
- is_connected = !(socket_type == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
+ is_connected = !(socketType == SocketType.Dgram && ep != null && (ep.Address.Equals (IPAddress.Any) || ep.Address.Equals (IPAddress.IPv6Any)));
is_bound = true;
}
}
});
- public IAsyncResult BeginConnect (IPAddress address, int port, AsyncCallback callback, object state)
- {
- ThrowIfDisposedAndClosed ();
-
- if (address == null)
- throw new ArgumentNullException ("address");
- if (address.ToString ().Length == 0)
- throw new ArgumentException ("The length of the IP address is zero");
- if (port <= 0 || port > 65535)
- throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
- if (is_listening)
- throw new InvalidOperationException ();
-
- return BeginConnect (new IPEndPoint (address, port), callback, state);
- }
-
public IAsyncResult BeginConnect (string host, int port, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
if (host == null)
throw new ArgumentNullException ("host");
- if (address_family != AddressFamily.InterNetwork && address_family != AddressFamily.InterNetworkV6)
+ if (addressFamily != AddressFamily.InterNetwork && addressFamily != AddressFamily.InterNetworkV6)
throw new NotSupportedException ("This method is valid only for sockets in the InterNetwork and InterNetworkV6 families");
if (port <= 0 || port > 65535)
throw new ArgumentOutOfRangeException ("port", "Must be > 0 and < 65536");
if (end_point == null)
throw new ArgumentNullException ("end_point");
+ if (is_listening)
+ throw new InvalidOperationException ();
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Connect) {
EndPoint = end_point,
// Calling connect() again will reset the connection attempt and cause
// an error. Better to just close the socket and move on.
connect_in_progress = false;
- safe_handle.Dispose ();
- safe_handle = new SafeSocketHandle (Socket_internal (address_family, socket_type, protocol_type, out error), true);
+ m_Handle.Dispose ();
+ m_Handle = new SafeSocketHandle (Socket_internal (addressFamily, socketType, protocolType, out error), true);
if (error != 0)
throw new SocketException (error);
}
bool blk = is_blocking;
if (blk)
Blocking = false;
- Connect_internal (safe_handle, end_point.Serialize (), out error);
+ Connect_internal (m_Handle, end_point.Serialize (), out error);
if (blk)
Blocking = true;
ThrowIfDisposedAndClosed ();
int error = 0;
- Disconnect_internal (safe_handle, reuseSocket, out error);
+ Disconnect_internal (m_Handle, reuseSocket, out error);
if (error != 0) {
if (error == 50) {
#region Receive
- public int Receive (byte [] buffer)
- {
- return Receive (buffer, SocketFlags.None);
- }
-
- public int Receive (byte [] buffer, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
- SocketError error;
- int ret = Receive_nochecks (buffer, 0, buffer.Length, socketFlags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
- throw new SocketException ((int) error);
- }
-
- return ret;
- }
-
- public int Receive (byte [] buffer, int size, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, size);
-
- SocketError error;
- int ret = Receive_nochecks (buffer, 0, size, socketFlags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
- throw new SocketException ((int) error);
- }
-
- return ret;
- }
-
- public int Receive (byte [] buffer, int offset, int size, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, offset, size);
-
- SocketError error;
- int ret = Receive_nochecks (buffer, offset, size, socketFlags, out error);
-
- if (error != SocketError.Success) {
- if (error == SocketError.WouldBlock && is_blocking) // This might happen when ReceiveTimeout is set
- throw new SocketException ((int) error, TIMEOUT_EXCEPTION_MSG);
- throw new SocketException ((int) error);
- }
-
- return ret;
- }
-
public int Receive (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
- return Receive_nochecks (buffer, offset, size, socketFlags, out errorCode);
- }
-
- public int Receive (IList<ArraySegment<byte>> buffers)
- {
- SocketError error;
- int ret = Receive (buffers, SocketFlags.None, out error);
+ int nativeError;
+ int ret = Receive_internal (m_Handle, buffer, offset, size, socketFlags, out nativeError);
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ errorCode = (SocketError) nativeError;
+ if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+ is_connected = false;
+ is_bound = false;
+ } else {
+ is_connected = true;
+ }
return ret;
}
- [CLSCompliant (false)]
- public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- SocketError error;
- int ret = Receive (buffers, socketFlags, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return(ret);
- }
-
[CLSCompliant (false)]
public int Receive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode)
{
}
try {
- ret = Receive_internal (safe_handle, bufarray, socketFlags, out nativeError);
+ ret = Receive_internal (m_Handle, bufarray, socketFlags, out nativeError);
} finally {
for (int i = 0; i < numsegments; i++) {
if (gch[i].IsAllocated)
e.socket_async_result.Buffers = e.BufferList;
- QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, e.socket_async_result));
+ QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, e.socket_async_result));
} else {
InitSocketAsyncEventArgs (e, ReceiveAsyncCallback, e, SocketOperation.Receive);
e.socket_async_result.Offset = e.Offset;
e.socket_async_result.Size = e.Count;
- QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, e.socket_async_result));
+ QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, e.socket_async_result));
}
return true;
}
});
- public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
+ public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
+ /* As far as I can tell from the docs and from experimentation, a pointer to the
+ * SocketError parameter is not supposed to be saved for the async parts. And as we don't
+ * set any socket errors in the setup code, we just have to set it to Success. */
+ errorCode = SocketError.Success;
+
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Receive) {
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
+ SockFlags = socketFlags,
};
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveCallback, sockares));
return sockares;
}
- public IAsyncResult BeginReceive (byte[] buffer, int offset, int size, SocketFlags flags, out SocketError error, AsyncCallback callback, object state)
- {
- /* As far as I can tell from the docs and from experimentation, a pointer to the
- * SocketError parameter is not supposed to be saved for the async parts. And as we don't
- * set any socket errors in the setup code, we just have to set it to Success. */
- error = SocketError.Success;
- return BeginReceive (buffer, offset, size, flags, callback, state);
- }
-
static IOAsyncCallback BeginReceiveCallback = new IOAsyncCallback (ares => {
SocketAsyncResult sockares = (SocketAsyncResult) ares;
int total = 0;
try {
- total = Receive_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+ total = Receive_internal (sockares.socket.m_Handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
} catch (Exception e) {
sockares.Complete (e);
return;
});
[CLSCompliant (false)]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+ public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
if (buffers == null)
throw new ArgumentNullException ("buffers");
+ /* I assume the same SocketError semantics as above */
+ errorCode = SocketError.Success;
+
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.ReceiveGeneric) {
Buffers = buffers,
SockFlags = socketFlags,
};
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveGenericCallback, sockares));
return sockares;
}
- [CLSCompliant (false)]
- public IAsyncResult BeginReceive (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
- {
- /* I assume the same SocketError semantics as above */
- errorCode = SocketError.Success;
- return BeginReceive (buffers, socketFlags, callback, state);
- }
-
static IOAsyncCallback BeginReceiveGenericCallback = new IOAsyncCallback (ares => {
SocketAsyncResult sockares = (SocketAsyncResult) ares;
int total = 0;
sockares.Complete (total);
});
- public int EndReceive (IAsyncResult result)
+ public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
{
- SocketError error;
- int bytesReceived = EndReceive (result, out error);
+ ThrowIfDisposedAndClosed ();
- if (error != SocketError.Success) {
- if (error != SocketError.WouldBlock && error != SocketError.InProgress)
- is_connected = false;
- throw new SocketException ((int)error);
- }
-
- return bytesReceived;
- }
-
- public int EndReceive (IAsyncResult asyncResult, out SocketError errorCode)
- {
- ThrowIfDisposedAndClosed ();
-
- SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
+ SocketAsyncResult sockares = ValidateEndIAsyncResult (asyncResult, "EndReceive", "asyncResult");
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne ();
+ errorCode = sockares.ErrorCode;
+
+ if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress)
+ is_connected = false;
+
// If no socket error occurred, call CheckIfThrowDelayedException in case there are other
// kinds of exceptions that should be thrown.
- if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+ if (errorCode == SocketError.Success)
sockares.CheckIfThrowDelayedException();
return sockares.Total;
}
- int Receive_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
- {
- int nativeError;
- int ret = Receive_internal (safe_handle, buf, offset, size, flags, out nativeError);
-
- error = (SocketError) nativeError;
- if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
- is_connected = false;
- is_bound = false;
- } else {
- is_connected = true;
- }
-
- return ret;
- }
-
static int Receive_internal (SafeSocketHandle safeHandle, WSABUF[] bufarray, SocketFlags flags, out int error)
{
try {
#region ReceiveFrom
- public int ReceiveFrom (byte [] buffer, ref EndPoint remoteEP)
+ public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
- return ReceiveFrom (buffer, 0, buffer.Length, SocketFlags.None, ref remoteEP);
- }
+ if (remoteEP == null)
+ throw new ArgumentNullException ("remoteEP");
- public int ReceiveFrom (byte [] buffer, SocketFlags socketFlags, ref EndPoint remoteEP)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
+ SocketError errorCode;
+ int ret = ReceiveFrom (buffer, offset, size, socketFlags, ref remoteEP, out errorCode);
+
+ if (errorCode != SocketError.Success)
+ throw new SocketException (errorCode);
- return ReceiveFrom (buffer, 0, buffer.Length, socketFlags, ref remoteEP);
+ return ret;
}
- public int ReceiveFrom (byte [] buffer, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
+ internal int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP, out SocketError errorCode)
{
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, size);
+ SocketAddress sockaddr = remoteEP.Serialize();
- return ReceiveFrom (buffer, 0, size, socketFlags, ref remoteEP);
- }
+ int nativeError;
+ int cnt = ReceiveFrom_internal (m_Handle, buffer, offset, size, socketFlags, ref sockaddr, out nativeError);
- public int ReceiveFrom (byte [] buffer, int offset, int size, SocketFlags socketFlags, ref EndPoint remoteEP)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, offset, size);
+ errorCode = (SocketError) nativeError;
+ if (errorCode != SocketError.Success) {
+ if (errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+ is_connected = false;
+ } else if (errorCode == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
+ errorCode = SocketError.TimedOut;
+ }
- if (remoteEP == null)
- throw new ArgumentNullException ("remoteEP");
+ return 0;
+ }
- int error;
- return ReceiveFrom_nochecks_exc (buffer, offset, size, socketFlags, ref remoteEP, true, out error);
+ is_connected = true;
+ is_bound = true;
+
+ /* If sockaddr is null then we're a connection oriented protocol and should ignore the
+ * remoteEP parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
+ if (sockaddr != null) {
+ /* Stupidly, EndPoint.Create() is an instance method */
+ remoteEP = remoteEP.Create (sockaddr);
+ }
+
+ seed_endpoint = remoteEP;
+
+ return cnt;
}
public bool ReceiveFromAsync (SocketAsyncEventArgs e)
e.socket_async_result.EndPoint = e.RemoteEndPoint;
e.socket_async_result.SockFlags = e.SocketFlags;
- QueueIOSelectorJob (readQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, e.socket_async_result));
+ QueueIOSelectorJob (ReadSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, e.socket_async_result));
return true;
}
EndPoint = remote_end,
};
- QueueIOSelectorJob (readQ, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
+ QueueIOSelectorJob (ReadSem, sockares.Handle, new IOSelectorJob (IOOperation.Read, BeginReceiveFromCallback, sockares));
return sockares;
}
int total = 0;
try {
- int error;
- total = sockares.socket.ReceiveFrom_nochecks_exc (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, ref sockares.EndPoint, true, out error);
+ SocketError errorCode;
+ total = sockares.socket.ReceiveFrom (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, ref sockares.EndPoint, out errorCode);
+
+ if (errorCode != SocketError.Success) {
+ sockares.Complete (new SocketException (errorCode));
+ return;
+ }
} catch (Exception e) {
sockares.Complete (e);
return;
return sockares.Total;
}
- internal int ReceiveFrom_nochecks_exc (byte [] buf, int offset, int size, SocketFlags flags, ref EndPoint remote_end, bool throwOnError, out int error)
- {
- SocketAddress sockaddr = remote_end.Serialize();
-
- int cnt = ReceiveFrom_internal (safe_handle, buf, offset, size, flags, ref sockaddr, out error);
- SocketError err = (SocketError) error;
- if (err != 0) {
- if (err != SocketError.WouldBlock && err != SocketError.InProgress) {
- is_connected = false;
- } else if (err == SocketError.WouldBlock && is_blocking) { // This might happen when ReceiveTimeout is set
- if (throwOnError)
- throw new SocketException ((int) SocketError.TimedOut, TIMEOUT_EXCEPTION_MSG);
- error = (int) SocketError.TimedOut;
- return 0;
- }
-
- if (throwOnError)
- throw new SocketException (error);
-
- return 0;
- }
-
- is_connected = true;
- is_bound = true;
-
- /* If sockaddr is null then we're a connection oriented protocol and should ignore the
- * remote_end parameter (see MSDN documentation for Socket.ReceiveFrom(...) ) */
- if (sockaddr != null) {
- /* Stupidly, EndPoint.Create() is an instance method */
- remote_end = remote_end.Create (sockaddr);
- }
-
- seed_endpoint = remote_end;
-
- return cnt;
- }
static int ReceiveFrom_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, ref SocketAddress sockaddr, out int error)
{
#region Send
- public int Send (byte [] buffer)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
- SocketError error;
- int ret = Send_nochecks (buffer, 0, buffer.Length, SocketFlags.None, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return ret;
- }
-
- public int Send (byte [] buffer, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, buffer.Length);
-
- SocketError error;
- int ret = Send_nochecks (buffer, 0, buffer.Length, socketFlags, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return ret;
- }
-
- public int Send (byte [] buffer, int size, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, 0, size);
-
- SocketError error;
- int ret = Send_nochecks (buffer, 0, size, socketFlags, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return ret;
- }
-
- public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, offset, size);
-
- SocketError error;
- int ret = Send_nochecks (buffer, offset, size, socketFlags, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return ret;
- }
-
public int Send (byte [] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode)
{
ThrowIfDisposedAndClosed ();
ThrowIfBufferNull (buffer);
ThrowIfBufferOutOfRange (buffer, offset, size);
- return Send_nochecks (buffer, offset, size, socketFlags, out errorCode);
- }
-
- public
- int Send (IList<ArraySegment<byte>> buffers)
- {
- SocketError error;
- int ret = Send (buffers, SocketFlags.None, out error);
-
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
-
- return ret;
- }
-
- public
- int Send (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags)
- {
- SocketError error;
- int ret = Send (buffers, socketFlags, out error);
+ if (size == 0) {
+ errorCode = SocketError.Success;
+ return 0;
+ }
- if (error != SocketError.Success)
- throw new SocketException ((int) error);
+ int nativeError;
+ int sent = 0;
+ do {
+ sent += Send_internal (
+m_Handle, buffer, offset + sent, size - sent, socketFlags, out nativeError);
+ errorCode = (SocketError)nativeError;
+ if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress) {
+ is_connected = false;
+ is_bound = false;
+ break;
+ } else {
+ is_connected = true;
+ }
+ } while (sent < size);
- return ret;
+ return sent;
}
[CLSCompliant (false)]
}
try {
- ret = Send_internal (safe_handle, bufarray, socketFlags, out nativeError);
+ ret = Send_internal (m_Handle, bufarray, socketFlags, out nativeError);
} finally {
for(int i = 0; i < numsegments; i++) {
if (gch[i].IsAllocated) {
return ret;
}
- int Send_nochecks (byte [] buf, int offset, int size, SocketFlags flags, out SocketError error)
- {
- if (size == 0) {
- error = SocketError.Success;
- return 0;
- }
-
- int nativeError;
- int ret = Send_internal (safe_handle, buf, offset, size, flags, out nativeError);
-
- error = (SocketError)nativeError;
-
- if (error != SocketError.Success && error != SocketError.WouldBlock && error != SocketError.InProgress) {
- is_connected = false;
- is_bound = false;
- } else {
- is_connected = true;
- }
-
- return ret;
- }
-
public bool SendAsync (SocketAsyncEventArgs e)
{
// NO check is made whether e != null in MS.NET (NRE is thrown in such case)
e.socket_async_result.Buffers = e.BufferList;
- QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, e.socket_async_result));
+ QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, e.socket_async_result));
} else {
InitSocketAsyncEventArgs (e, SendAsyncCallback, e, SocketOperation.Send);
e.socket_async_result.Offset = e.Offset;
e.socket_async_result.Size = e.Count;
- QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
+ QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
}
return true;
public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
+ ThrowIfDisposedAndClosed ();
+ ThrowIfBufferNull (buffer);
+ ThrowIfBufferOutOfRange (buffer, offset, size);
+
if (!is_connected) {
errorCode = SocketError.NotConnected;
- throw new SocketException ((int) errorCode);
+ return null;
}
errorCode = SocketError.Success;
- return BeginSend (buffer, offset, size, socketFlags, callback, state);
- }
-
- public IAsyncResult BeginSend (byte[] buffer, int offset, int size, SocketFlags socket_flags, AsyncCallback callback, object state)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
- ThrowIfBufferOutOfRange (buffer, offset, size);
-
- if (!is_connected)
- throw new SocketException ((int)SocketError.NotConnected);
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.Send) {
Buffer = buffer,
Offset = offset,
Size = size,
- SockFlags = socket_flags,
+ SockFlags = socketFlags,
};
- QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
+ QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendCallback ((SocketAsyncResult) s, 0), sockares));
return sockares;
}
int total = 0;
try {
- total = Socket.Send_internal (sockares.socket.safe_handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
+ total = Socket.Send_internal (sockares.socket.m_Handle, sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, out sockares.error);
} catch (Exception e) {
sockares.Complete (e);
return;
sockares.Offset += total;
sockares.Size -= total;
- if (sockares.socket.is_disposed) {
+ if (sockares.socket.CleanedUp) {
sockares.Complete (total);
return;
}
sockares.Complete (total);
}
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
+ [CLSCompliant (false)]
+ public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
if (buffers == null)
throw new ArgumentNullException ("buffers");
- if (!is_connected)
- throw new SocketException ((int)SocketError.NotConnected);
+
+ if (!is_connected) {
+ errorCode = SocketError.NotConnected;
+ return null;
+ }
+
+ errorCode = SocketError.Success;
SocketAsyncResult sockares = new SocketAsyncResult (this, callback, state, SocketOperation.SendGeneric) {
Buffers = buffers,
SockFlags = socketFlags,
};
- QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
+ QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, BeginSendGenericCallback, sockares));
return sockares;
}
- [CLSCompliant (false)]
- public IAsyncResult BeginSend (IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
- {
- if (!is_connected) {
- errorCode = SocketError.NotConnected;
- throw new SocketException ((int)errorCode);
- }
-
- errorCode = SocketError.Success;
- return BeginSend (buffers, socketFlags, callback, state);
- }
-
static IOAsyncCallback BeginSendGenericCallback = new IOAsyncCallback (ares => {
SocketAsyncResult sockares = (SocketAsyncResult) ares;
int total = 0;
sockares.Complete (total);
});
- public int EndSend (IAsyncResult result)
- {
- SocketError error;
- int bytesSent = EndSend (result, out error);
-
- if (error != SocketError.Success) {
- if (error != SocketError.WouldBlock && error != SocketError.InProgress)
- is_connected = false;
- throw new SocketException ((int)error);
- }
-
- return bytesSent;
- }
-
public int EndSend (IAsyncResult asyncResult, out SocketError errorCode)
{
ThrowIfDisposedAndClosed ();
if (!sockares.IsCompleted)
sockares.AsyncWaitHandle.WaitOne ();
+ errorCode = sockares.ErrorCode;
+
+ if (errorCode != SocketError.Success && errorCode != SocketError.WouldBlock && errorCode != SocketError.InProgress)
+ is_connected = false;
+
/* If no socket error occurred, call CheckIfThrowDelayedException in
* case there are other kinds of exceptions that should be thrown.*/
- if ((errorCode = sockares.ErrorCode) == SocketError.Success)
+ if (errorCode == SocketError.Success)
sockares.CheckIfThrowDelayedException ();
return sockares.Total;
#region SendTo
- public int SendTo (byte [] buffer, EndPoint remoteEP)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
-
- return SendTo (buffer, 0, buffer.Length, SocketFlags.None, remoteEP);
- }
-
- public int SendTo (byte [] buffer, SocketFlags socketFlags, EndPoint remoteEP)
- {
- ThrowIfDisposedAndClosed ();
- ThrowIfBufferNull (buffer);
-
- return SendTo (buffer, 0, buffer.Length, socketFlags, remoteEP);
- }
-
- public int SendTo (byte [] buffer, int size, SocketFlags socketFlags, EndPoint remoteEP)
- {
- return SendTo (buffer, 0, size, socketFlags, remoteEP);
- }
-
public int SendTo (byte [] buffer, int offset, int size, SocketFlags socketFlags, EndPoint remoteEP)
{
ThrowIfDisposedAndClosed ();
if (remoteEP == null)
throw new ArgumentNullException("remoteEP");
- return SendTo_nochecks (buffer, offset, size, socketFlags, remoteEP);
+ int error;
+ int ret = SendTo_internal (m_Handle, buffer, offset, size, socketFlags, remoteEP.Serialize (), out error);
+
+ SocketError err = (SocketError) error;
+ if (err != 0) {
+ if (err != SocketError.WouldBlock && err != SocketError.InProgress)
+ is_connected = false;
+ throw new SocketException (error);
+ }
+
+ is_connected = true;
+ is_bound = true;
+ seed_endpoint = remoteEP;
+
+ return ret;
}
public bool SendToAsync (SocketAsyncEventArgs e)
e.socket_async_result.SockFlags = e.SocketFlags;
e.socket_async_result.EndPoint = e.RemoteEndPoint;
- QueueIOSelectorJob (writeQ, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
+ QueueIOSelectorJob (WriteSem, e.socket_async_result.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), e.socket_async_result));
return true;
}
EndPoint = remote_end,
};
- QueueIOSelectorJob (writeQ, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
+ QueueIOSelectorJob (WriteSem, sockares.Handle, new IOSelectorJob (IOOperation.Write, s => BeginSendToCallback ((SocketAsyncResult) s, 0), sockares));
return sockares;
}
{
int total = 0;
try {
- total = sockares.socket.SendTo_nochecks (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, sockares.EndPoint);
+ total = sockares.socket.SendTo (sockares.Buffer, sockares.Offset, sockares.Size, sockares.SockFlags, sockares.EndPoint);
if (sockares.error == 0) {
sent_so_far += total;
return sockares.Total;
}
- int SendTo_nochecks (byte [] buffer, int offset, int size, SocketFlags flags, EndPoint remote_end)
- {
- int error;
- int ret = SendTo_internal (safe_handle, buffer, offset, size, flags, remote_end.Serialize (), out error);
-
- SocketError err = (SocketError) error;
- if (err != 0) {
- if (err != SocketError.WouldBlock && err != SocketError.InProgress)
- is_connected = false;
- throw new SocketException (error);
- }
-
- is_connected = true;
- is_bound = true;
- seed_endpoint = remote_end;
-
- return ret;
- }
-
static int SendTo_internal (SafeSocketHandle safeHandle, byte[] buffer, int offset, int count, SocketFlags flags, SocketAddress sa, out int error)
{
try {
#region SendFile
- public void SendFile (string fileName)
- {
- ThrowIfDisposedAndClosed ();
-
- if (!is_connected)
- throw new NotSupportedException ();
- if (!is_blocking)
- throw new InvalidOperationException ();
-
- SendFile (fileName, null, null, 0);
- }
-
public void SendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags)
{
ThrowIfDisposedAndClosed ();
if (!is_blocking)
throw new InvalidOperationException ();
- if (!SendFile_internal (safe_handle, fileName, preBuffer, postBuffer, flags)) {
+ if (!SendFile_internal (m_Handle, fileName, preBuffer, postBuffer, flags)) {
SocketException exc = new SocketException ();
if (exc.ErrorCode == 2 || exc.ErrorCode == 3)
throw new FileNotFoundException ();
}
}
- public IAsyncResult BeginSendFile (string fileName, AsyncCallback callback, object state)
- {
- ThrowIfDisposedAndClosed ();
-
- if (!is_connected)
- throw new NotSupportedException ();
- if (!File.Exists (fileName))
- throw new FileNotFoundException ();
-
- return BeginSendFile (fileName, null, null, 0, callback, state);
- }
-
public IAsyncResult BeginSendFile (string fileName, byte[] preBuffer, byte[] postBuffer, TransmitFileOptions flags, AsyncCallback callback, object state)
{
ThrowIfDisposedAndClosed ();
#region DuplicateAndClose
-#if !MOBILE
[MonoLimitation ("We do not support passing sockets across processes, we merely allow this API to pass the socket across AppDomains")]
public SocketInformation DuplicateAndClose (int targetProcessId)
{
(is_listening ? SocketInformationOptions.Listening : 0) |
(is_connected ? SocketInformationOptions.Connected : 0) |
(is_blocking ? 0 : SocketInformationOptions.NonBlocking) |
- (use_overlapped_io ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
+ (useOverlappedIO ? SocketInformationOptions.UseOnlyOverlappedIO : 0);
- si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)address_family, (int)socket_type, (int)protocol_type, is_bound ? 1 : 0, (long)Handle);
- safe_handle = null;
+ si.ProtocolInformation = Mono.DataConverter.Pack ("iiiil", (int)addressFamily, (int)socketType, (int)protocolType, is_bound ? 1 : 0, (long)Handle);
+ m_Handle = null;
return si;
}
-#endif
#endregion
throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
int error;
- GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref optionValue, out error);
+ GetSocketOption_arr_internal (m_Handle, optionLevel, optionName, ref optionValue, out error);
if (error != 0)
throw new SocketException (error);
int error;
byte[] byte_val = new byte [optionLength];
- GetSocketOption_arr_internal (safe_handle, optionLevel, optionName, ref byte_val, out error);
+ GetSocketOption_arr_internal (m_Handle, optionLevel, optionName, ref byte_val, out error);
if (error != 0)
throw new SocketException (error);
int error;
object obj_val;
- GetSocketOption_obj_internal (safe_handle, optionLevel, optionName, out obj_val, out error);
+ GetSocketOption_obj_internal (m_Handle, optionLevel, optionName, out obj_val, out error);
if (error != 0)
throw new SocketException (error);
throw new SocketException ((int) SocketError.Fault, "Error trying to dereference an invalid pointer");
int error;
- SetSocketOption_internal (safe_handle, optionLevel, optionName, null, optionValue, 0, out error);
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, null, optionValue, 0, out error);
if (error != 0) {
if (error == (int) SocketError.InvalidArgument)
LingerOption linger = optionValue as LingerOption;
if (linger == null)
throw new ArgumentException ("A 'LingerOption' value must be specified.", "optionValue");
- SetSocketOption_internal (safe_handle, optionLevel, optionName, linger, null, 0, out error);
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, linger, null, 0, out error);
} else if (optionLevel == SocketOptionLevel.IP && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
MulticastOption multicast = optionValue as MulticastOption;
if (multicast == null)
throw new ArgumentException ("A 'MulticastOption' value must be specified.", "optionValue");
- SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, multicast, null, 0, out error);
} else if (optionLevel == SocketOptionLevel.IPv6 && (optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership)) {
IPv6MulticastOption multicast = optionValue as IPv6MulticastOption;
if (multicast == null)
throw new ArgumentException ("A 'IPv6MulticastOption' value must be specified.", "optionValue");
- SetSocketOption_internal (safe_handle, optionLevel, optionName, multicast, null, 0, out error);
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, multicast, null, 0, out error);
} else {
throw new ArgumentException ("Invalid value specified.", "optionValue");
}
{
ThrowIfDisposedAndClosed ();
- if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocol_type))
+ if (optionLevel == SocketOptionLevel.Socket && optionName == SocketOptionName.ReuseAddress && optionValue != 0 && !SupportsPortReuse (protocolType))
throw new SocketException ((int) SocketError.OperationNotSupported, "Operating system sockets do not support ReuseAddress.\nIf your socket is not intended to bind to the same address and port multiple times remove this option, otherwise you should ignore this exception inside a try catch and check that ReuseAddress is true before binding to the same address and port multiple times.");
int error;
- SetSocketOption_internal (safe_handle, optionLevel, optionName, null, null, optionValue, out error);
+ SetSocketOption_internal (m_Handle, optionLevel, optionName, null, null, optionValue, out error);
if (error != 0) {
if (error == (int) SocketError.InvalidArgument)
public int IOControl (int ioControlCode, byte [] optionInValue, byte [] optionOutValue)
{
- if (is_disposed)
+ if (CleanedUp)
throw new ObjectDisposedException (GetType ().ToString ());
int error;
- int result = IOControl_internal (safe_handle, ioControlCode, optionInValue, optionOutValue, out error);
+ int result = IOControl_internal (m_Handle, ioControlCode, optionInValue, optionOutValue, out error);
if (error != 0)
throw new SocketException (error);
return result;
}
- public int IOControl (IOControlCode ioControlCode, byte[] optionInValue, byte[] optionOutValue)
- {
- return IOControl ((int) ioControlCode, optionInValue, optionOutValue);
- }
-
static int IOControl_internal (SafeSocketHandle safeHandle, int ioctl_code, byte [] input, byte [] output, out int error)
{
bool release = false;
throw new SocketException (10057); // Not connected
int error;
- Shutdown_internal (safe_handle, how, out error);
+ Shutdown_internal (m_Handle, how, out error);
if (error != 0)
throw new SocketException (error);
protected virtual void Dispose (bool disposing)
{
- if (is_disposed)
+ if (CleanedUp)
return;
- is_disposed = true;
+ m_IntCleanedUp = 1;
bool was_connected = is_connected;
is_connected = false;
- if (safe_handle != null) {
+ if (m_Handle != null) {
is_closed = true;
IntPtr x = Handle;
if (was_connected)
Linger (x);
- safe_handle.Dispose ();
+ m_Handle.Dispose ();
}
}
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
void Linger (IntPtr handle)
{
if (!is_connected || linger_timeout <= 0)
void ThrowIfDisposedAndClosed (Socket socket)
{
- if (socket.is_disposed && socket.is_closed)
+ if (socket.CleanedUp && socket.is_closed)
throw new ObjectDisposedException (socket.GetType ().ToString ());
}
void ThrowIfDisposedAndClosed ()
{
- if (is_disposed && is_closed)
+ if (CleanedUp && is_closed)
throw new ObjectDisposedException (GetType ().ToString ());
}
void ThrowIfUdp ()
{
- if (protocol_type == ProtocolType.Udp)
+ if (protocolType == ProtocolType.Udp)
throw new SocketException ((int)SocketError.ProtocolOption);
}
return sockares;
}
- void QueueIOSelectorJob (Queue<KeyValuePair<IntPtr, IOSelectorJob>> queue, IntPtr handle, IOSelectorJob job)
+ void QueueIOSelectorJob (SemaphoreSlim sem, IntPtr handle, IOSelectorJob job)
{
- int count;
- lock (queue) {
- queue.Enqueue (new KeyValuePair<IntPtr, IOSelectorJob> (handle, job));
- count = queue.Count;
- }
+ sem.WaitAsync ().ContinueWith (t => {
+ if (CleanedUp) {
+ job.MarkDisposed ();
+ return;
+ }
- if (count == 1)
IOSelector.Add (handle, job);
+ });
}
void InitSocketAsyncEventArgs (SocketAsyncEventArgs e, AsyncCallback callback, object state, SocketOperation operation)
set;
}
-#if !MOBILE
public TransmitFileOptions SendPacketsFlags {
get;
set;
}
-#endif
[MonoTODO ("unused property")]
public int SendPacketsSendSize {
public void Complete ()
{
- if (operation != SocketOperation.Receive && socket.is_disposed)
+ if (operation != SocketOperation.Receive && socket.CleanedUp)
DelayedException = new ObjectDisposedException (socket.GetType ().ToString ());
IsCompleted = true;
ThreadPool.UnsafeQueueUserWorkItem (_ => callback (this), null);
}
- Queue<KeyValuePair<IntPtr, IOSelectorJob>> queue = null;
switch (operation) {
case SocketOperation.Receive:
case SocketOperation.ReceiveFrom:
case SocketOperation.ReceiveGeneric:
case SocketOperation.Accept:
- queue = socket.readQ;
+ socket.ReadSem.Release ();
break;
case SocketOperation.Send:
case SocketOperation.SendTo:
case SocketOperation.SendGeneric:
- queue = socket.writeQ;
+ socket.WriteSem.Release ();
break;
}
- if (queue != null) {
- lock (queue) {
- /* queue.Count will only be 0 if the socket is closed while receive/send/accept
- * operation(s) are pending and at least one call to this method is waiting
- * on the lock while another one calls CompleteAllOnDispose() */
- if (queue.Count > 0)
- queue.Dequeue (); /* remove ourselves */
- if (queue.Count > 0) {
- if (!socket.is_disposed) {
- IOSelector.Add (queue.Peek ().Key, queue.Peek ().Value);
- } else {
- /* CompleteAllOnDispose */
- KeyValuePair<IntPtr, IOSelectorJob> [] jobs = queue.ToArray ();
- for (int i = 0; i < jobs.Length; i++)
- ThreadPool.QueueUserWorkItem (j => ((IOSelectorJob) j).MarkDisposed (), jobs [i].Value);
- queue.Clear ();
- }
- }
- }
- }
-
// IMPORTANT: 'callback', if any is scheduled from unmanaged code
}
return client;
}
-
+
+ public void AllowNatTraversal (bool allowed)
+ {
+ if (active)
+ throw new InvalidOperationException (SR.GetString (SR.net_tcplistener_mustbestopped));
+
+ if (allowed)
+ server.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
+ else
+ server.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
+ }
+
+ public static TcpListener Create (int port)
+ {
+ if (port < 0 || port > 65535)
+ throw new ArgumentOutOfRangeException ("port");
+
+ TcpListener listener = new TcpListener (IPAddress.IPv6Any, port);
+ listener.Server.DualMode = true;
+
+ return listener;
+ }
+
/// <summary>
/// Destructor - stops the listener listening
/// </summary>
socket.Bind (localEP);
}
+ public void AllowNatTraversal (bool allowed)
+ {
+ if (allowed)
+ socket.SetIPProtectionLevel (IPProtectionLevel.Unrestricted);
+ else
+ socket.SetIPProtectionLevel (IPProtectionLevel.EdgeRestricted);
+ }
+
public void Close ()
{
Dispose ();
}
}
+ [MonoTODO]
+ internal static bool OSSupportsExtendedProtection {
+ get {
+ return false;
+ }
+ }
+
internal static void Clear ()
{
EnsureModules ();
using System.Collections;
using System.Threading;
using System.Threading.Tasks;
+using System.Security.Authentication.ExtendedProtection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
ArrayList wait_queue; // List<ListenerAsyncResult> wait_queue;
Hashtable connections;
+ ServiceNameStore defaultServiceNames;
+ ExtendedProtectionPolicy extendedProtectionPolicy;
+ ExtendedProtectionSelector extendedProtectionSelectorDelegate;
+
+ public delegate ExtendedProtectionPolicy ExtendedProtectionSelector (HttpListenerRequest request);
+
public HttpListener ()
{
prefixes = new HttpListenerPrefixCollection (this);
ctx_queue = new ArrayList ();
wait_queue = new ArrayList ();
auth_schemes = AuthenticationSchemes.Anonymous;
+ defaultServiceNames = new ServiceNameStore ();
+ extendedProtectionPolicy = new ExtendedProtectionPolicy (PolicyEnforcement.Never);
}
internal HttpListener (X509Certificate certificate, IMonoTlsProvider tlsProvider, MSI.MonoTlsSettings tlsSettings)
}
}
+ public ExtendedProtectionSelector ExtendedProtectionSelectorDelegate
+ {
+ get { return extendedProtectionSelectorDelegate; }
+ set {
+ CheckDisposed();
+ if (value == null)
+ throw new ArgumentNullException ();
+
+ if (!AuthenticationManager.OSSupportsExtendedProtection)
+ throw new PlatformNotSupportedException (SR.GetString (SR.security_ExtendedProtection_NoOSSupport));
+
+ extendedProtectionSelectorDelegate = value;
+ }
+ }
+
public bool IgnoreWriteExceptions {
get { return ignore_write_exceptions; }
set {
}
}
+ [MonoTODO]
+ public HttpListenerTimeoutManager TimeoutManager {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [MonoTODO ("not used anywhere in the implementation")]
+ public ExtendedProtectionPolicy ExtendedProtectionPolicy
+ {
+ get {
+ return extendedProtectionPolicy;
+ }
+ set {
+ CheckDisposed ();
+
+ if (value == null)
+ throw new ArgumentNullException ("value");
+
+ if (!AuthenticationManager.OSSupportsExtendedProtection && value.PolicyEnforcement == PolicyEnforcement.Always)
+ throw new PlatformNotSupportedException (SR.GetString(SR.security_ExtendedProtection_NoOSSupport));
+
+ if (value.CustomChannelBinding != null)
+ throw new ArgumentException (SR.GetString (SR.net_listener_cannot_set_custom_cbt), "CustomChannelBinding");
+
+ extendedProtectionPolicy = value;
+ }
+ }
+
+ public ServiceNameCollection DefaultServiceNames
+ {
+ get {
+ return defaultServiceNames.ServiceNames;
+ }
+ }
+
// TODO: use this
public string Realm {
get { return realm; }
}
}
+ [MonoTODO]
public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
+ public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, TimeSpan keepAliveInterval)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO]
public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval)
{
throw new NotImplementedException ();
}
+ [MonoTODO]
public Task<HttpListenerWebSocketContext> AcceptWebSocketAsync (string subProtocol, int receiveBufferSize, TimeSpan keepAliveInterval, ArraySegment<byte> internalBuffer)
{
throw new NotImplementedException ();
{
public class HttpListenerTimeoutManager
{
+ [MonoTODO]
+ public TimeSpan EntityBody
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+ [MonoTODO]
+ public TimeSpan DrainEntityBody
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public TimeSpan RequestQueue
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public TimeSpan IdleConnection
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public TimeSpan HeaderWait
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
+
+ [MonoTODO]
+ public long MinSendBytesPerSecond
+ {
+ get { throw new NotImplementedException (); }
+ set { throw new NotImplementedException (); }
+ }
}
}
\ No newline at end of file
internal set { actualUri = value; } // Used by Ftp+proxy
}
- public bool AllowAutoRedirect {
+ public virtual bool AllowAutoRedirect {
get { return allowAutoRedirect; }
set { this.allowAutoRedirect = value; }
}
- public bool AllowWriteStreamBuffering {
+ public virtual bool AllowWriteStreamBuffering {
get { return allowBuffering; }
set { allowBuffering = value; }
}
return EndGetRequestStream (asyncResult);
}
+ [MonoTODO]
+ public Stream GetRequestStream (out TransportContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
bool CheckIfForceWrite (SimpleAsyncResult result)
{
if (writeStream == null || writeStream.RequestWritten || !InternalAllowBuffering)
version = (Version) info.GetValue ("version", typeof (Version));
statusCode = (HttpStatusCode) info.GetValue ("statusCode", typeof (HttpStatusCode));
}
-
+
// Properties
public string CharacterSet {
}
}
+ [MonoTODO]
+ public static bool ReusePort {
+ get { return false; }
+ set { throw new NotImplementedException (); }
+ }
+
public static SecurityProtocolType SecurityProtocol {
get { return _securityProtocol; }
set { _securityProtocol = value; }
}
}
+ [MonoTODO ("Always returns EncryptionPolicy.RequireEncryption.")]
+ public static EncryptionPolicy EncryptionPolicy {
+ get {
+ return EncryptionPolicy.RequireEncryption;
+ }
+ }
+
public static bool Expect100Continue {
get { return expectContinue; }
set { expectContinue = value; }
+++ /dev/null
-//
-// ServiceNameCollection.cs
-//
-// Authors:
-// Atsushi Enomoto <atsushi@ximian.com>
-//
-
-//
-// Copyright (C) 2010 Novell, Inc (http://novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-using System;
-using System.Collections;
-
-namespace System.Security.Authentication.ExtendedProtection
-{
- [MonoTODO]
- [Serializable]
- public class ServiceNameCollection : ReadOnlyCollectionBase
- {
- public ServiceNameCollection (ICollection items)
- {
- throw new NotImplementedException ();
- }
-
- public ServiceNameCollection Merge (IEnumerable serviceNames)
- {
- throw new NotImplementedException ();
- }
-
- public ServiceNameCollection Merge (string serviceName)
- {
- throw new NotImplementedException ();
- }
-
- public bool Contains (string searchServiceName)
- {
- throw new NotImplementedException ();
- }
- }
-}
-
using System.IO;
using System.Text;
using System.Collections;
+using System.Runtime.Serialization;
namespace System.Security.Cryptography.X509Certificates {
{
}
+ protected X509Certificate2 (SerializationInfo info, StreamingContext context) : base (info, context)
+ {
+ }
+
internal X509Certificate2 (X509Certificate2Impl impl)
: base (impl)
{
System.Diagnostics/PerformanceCounterPermissionEntry.cs
System.Diagnostics/PerformanceCounterType.cs
System.Diagnostics/Process.cs
-System.Diagnostics/ProcessModuleCollection.cs
System.Diagnostics/ProcessModule.cs
System.Diagnostics/ProcessPriorityClass.cs
System.Diagnostics/ProcessStartInfo.cs
-System.Diagnostics/ProcessThreadCollection.cs
System.Diagnostics/ProcessThread.cs
System.Diagnostics/ProcessWindowStyle.cs
System.Diagnostics/Stopwatch.cs
../referencesource/System/net/System/Net/Sockets/SelectMode.cs
System.Net.Sockets/SendPacketsElement.cs
System.Net.Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
System.Net.Sockets/SocketAsyncEventArgs.cs
System.Net.Sockets/SocketAsyncOperation.cs
System.Net.Sockets/SocketAsyncResult.cs
System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs
System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs
System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs
-System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs
System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs
ReferenceSources/ConfigurationManagerInternalFactory.cs
ReferenceSources/CAPI.cs
ReferenceSources/EnvironmentHelpers.cs
-ReferenceSources/Internal.cs
ReferenceSources/HttpApi.cs
ReferenceSources/HttpSysSettings.cs
ReferenceSources/LocalAppContextSwitches.cs
ReferenceSources/SRCategoryAttribute.cs
ReferenceSources/Win32Exception.cs
-ReferenceSources/SSPIConfiguration.cs
-ReferenceSources/SSPISafeHandles.cs
-ReferenceSources/SSPIWrapper.cs
-ReferenceSources/SslStream.cs
-ReferenceSources/_SecureChannel.cs
-ReferenceSources/_SslState.cs
-ReferenceSources/_SslStream.cs
-
../referencesource/System/misc/PrivilegedConfigurationManager.cs
../referencesource/System/regex/system/text/regularexpressions/Regex.cs
../referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs
../referencesource/System/net/System/Net/_ProxyChain.cs
../referencesource/System/net/System/Net/_ScatterGatherBuffers.cs
../referencesource/System/net/System/Net/_Semaphore.cs
+../referencesource/System/net/System/Net/_ServiceNameStore.cs
../referencesource/System/net/System/Net/_TimerThread.cs
../referencesource/System/net/System/Net/_WebProxyDataBuilder.cs
../referencesource/System/net/System/Net/AuthenticationScheme.cs
../referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
../referencesource/System/security/system/security/Authentication/ExtendedProtection/TokenBinding.cs
+../referencesource/System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
../referencesource/System/security/system/security/cryptography/oid.cs
../referencesource/System/security/system/security/permissions/typedescriptorpermission.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
+
../referencesource/System/services/timers/system/timers/ElapsedEventHandler.cs
../referencesource/System/services/timers/system/timers/Timer.cs
../referencesource/System/services/timers/system/timers/TimersDescriptionAttribute.cs
[Test]
public void DnsEnabled ()
{
+ if (Environment.OSVersion.Platform == PlatformID.Win32NT)
+ Assert.Ignore ("IsDnsEnabled is not nessasarily enabled for all interfaces on windows.");
+
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces ();
foreach (NetworkInterface adapter in adapters)
{
listensock.Close ();
}
+ [Test]
+ public void ConcurrentExceedSocketLimit ()
+ {
+ var tasks = new Task[4];
+ for (int i = 0; i < 4; i++) {
+ tasks[i] = Task.Factory.StartNew (() => SendGenericExceedBuffer ());
+ }
+ Task.WaitAll (tasks);
+ }
+
+ [Test]
+ public void SendGenericExceedBuffer ()
+ {
+ // Create a buffer larger than the default max.
+ const int BUFFER_SIZE = 256 * 256 * 65;
+ int i;
+
+ IPEndPoint endpoint = new IPEndPoint(IPAddress.Loopback, NetworkHelpers.FindFreePort ());
+
+ Socket listensock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ listensock.Bind (endpoint);
+ listensock.Listen (1);
+
+ Socket sendsock = new Socket (AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
+ sendsock.Connect (endpoint);
+
+ Socket clientsock = listensock.Accept ();
+
+ byte[] sendbuf = new byte[BUFFER_SIZE];
+
+ for (i = 0; i < BUFFER_SIZE; i++) {
+ sendbuf[i] = (byte)i;
+ }
+
+ Task sendTask = Task.Factory.StartNew(() => {
+ int sent = sendsock.Send (sendbuf);
+
+ Assert.AreEqual (BUFFER_SIZE, sent, "#1");
+ });
+
+ byte[] recvbuf = new byte[BUFFER_SIZE];
+
+ Task recvTask = Task.Factory.StartNew(() => {
+ int totalReceived = 0;
+ byte[] buffer = new byte[256];
+ while (totalReceived < sendbuf.Length) {
+ int recvd = clientsock.Receive (buffer, 0, buffer.Length, SocketFlags.None);
+ Array.Copy (buffer, 0, recvbuf, totalReceived, recvd);
+ totalReceived += recvd;
+ }
+
+ Assert.AreEqual (BUFFER_SIZE, totalReceived, "#2");
+ });
+
+ Assert.IsTrue (Task.WaitAll (new []{sendTask, recvTask}, 15 * 1000), "#2a");
+
+ for (i = 0; i < BUFFER_SIZE; i++) {
+ Assert.AreEqual (recvbuf[i], sendbuf[i],
+ "#3/" + i.ToString());
+ }
+
+ sendsock.Close ();
+ clientsock.Close ();
+ listensock.Close ();
+ }
+
[Test]
public void ListenNotBound ()
{
System.Diagnostics/MonitoringDescriptionAttribute.cs
System.Diagnostics/Process.cs
System.Diagnostics/ProcessModule.cs
-System.Diagnostics/ProcessModuleCollection.cs
System.Diagnostics/ProcessPriorityClass.cs
System.Diagnostics/ProcessStartInfo.cs
System.Diagnostics/ProcessThread.cs
-System.Diagnostics/ProcessThreadCollection.cs
System.Diagnostics/ProcessWindowStyle.cs
System.Diagnostics/Stopwatch.cs
System.Diagnostics/ThreadPriorityLevel.cs
System.IO.Compression/GZipStream.cs
System.IO/InternalBufferOverflowException.cs
System.IO/InvalidDataException.cs
+System.IO/IODescriptionAttribute.cs
System.IO/ErrorEventArgs.cs
System.IO/ErrorEventHandler.cs
System.IO/FileSystemEventArgs.cs
../referencesource/System/net/System/Net/Sockets/SelectMode.cs
System.Net.Sockets/SendPacketsElement.cs
System.Net.Sockets/Socket.cs
+../referencesource/System/net/System/Net/Sockets/Socket.cs
System.Net.Sockets/SocketAsyncEventArgs.cs
System.Net.Sockets/SocketAsyncOperation.cs
System.Net.Sockets/SocketAsyncResult.cs
System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs
System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs
System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs
-System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs
System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs
System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs
System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs
ReferenceSources/CAPI.cs
ReferenceSources/EnvironmentHelpers.cs
ReferenceSources/HttpApi.cs
-ReferenceSources/Internal.cs
ReferenceSources/LocalAppContextSwitches.cs
ReferenceSources/HttpSysSettings.cs
ReferenceSources/Logging.cs
../referencesource/System/net/System/Net/_ProxyChain.cs
../referencesource/System/net/System/Net/_ScatterGatherBuffers.cs
../referencesource/System/net/System/Net/_Semaphore.cs
+../referencesource/System/net/System/Net/_ServiceNameStore.cs
../referencesource/System/net/System/Net/_TimerThread.cs
../referencesource/System/net/System/Net/_WebProxyDataBuilder.cs
../referencesource/System/net/System/Net/AuthenticationScheme.cs
../referencesource/System/sys/system/windows/markup/ValueSerializerAttribute.cs
../referencesource/System/security/system/security/Authentication/ExtendedProtection/TokenBinding.cs
+../referencesource/System/security/system/security/Authentication/ExtendedProtection/ServiceNameCollection.cs
../referencesource/System/security/system/security/cryptography/oid.cs
../referencesource/System/security/system/security/permissions/typedescriptorpermission.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessModuleCollection.cs
+../referencesource/System/services/monitoring/system/diagnosticts/ProcessThreadCollection.cs
+
../referencesource/System/services/timers/system/timers/ElapsedEventHandler.cs
../referencesource/System/services/timers/system/timers/Timer.cs
../referencesource/System/services/timers/system/timers/TimersDescriptionAttribute.cs
[assembly: InternalsVisibleTo ("Xamarin.Mac, PublicKey=0024000004800000940000000602000000240000525341310004000011000000438ac2a5acfbf16cbd2b2b47a62762f273df9cb2795ceccdf77d10bf508e69e7a362ea7a45455bbf3ac955e1f2e2814f144e5d817efc4c6502cc012df310783348304e3ae38573c6d658c234025821fda87a0be8a0d504df564e2c93b2b878925f42503e9d54dfef9f9586d9e6f38a305769587b1de01f6c0410328b2c9733db")]
#endif
-[assembly: InternalsVisibleTo ("Xamarin.BoringTls, PublicKey=002400000480000094000000060200000024000052534131000400001100000099dd12eda85767ae6f06023ee28e711c7e5a212462095c83868c29db75eddf6d8e296e03824c14fedd5f55553fed0b6173be3cc985a4b7f9fb7c83ccff8ba3938563b3d1f45a81122f12a1bcb73edcaad61a8456c7595a6da5184b4dd9d10f011b949ef1391fccfeab1ba62aa51c267ef8bd57ef1b6ba5a4c515d0badb81a78f")]
[assembly: Guid ("BED7F4EA-1A96-11D2-8F08-00A0C9A6186D")]
+++ /dev/null
-? s
-? en/System.Collections.Concurrent
-? en/ns-System.Threading.Tasks.xml
-? en/ns-System.Collections.Concurrent.xml
-? en/ns-System.Diagnostics.Contracts.xml
-? en/System.Threading.Tasks
-? en/ns-.xml
-? en/System.Diagnostics.Contracts.Internal
-? en/ns-System.Diagnostics.Contracts.Internal.xml
-? en/System.Diagnostics.Contracts
-M en/System.Runtime.InteropServices.Expando/IExpando.xml
-? en/System.Runtime.Versioning/TargetFrameworkAttribute.xml
-M en/System.Runtime.Versioning/ResourceScope.xml
-M en/System.Runtime.Versioning/VersioningHelper.xml
-M en/System.Runtime.Versioning/ResourceExposureAttribute.xml
-M en/System.Runtime.Versioning/ResourceConsumptionAttribute.xml
-? en/System.Threading/CountdownEvent.xml
-? en/System.Threading/CancellationTokenRegistration.xml
-? en/System.Threading/SpinWait.xml
-? en/System.Threading/ThreadLocal`1.xml
-? en/System.Threading/SemaphoreSlim.xml
-? en/System.Threading/SpinLock.xml
-? en/System.Threading/LazyInitializer.xml
-? en/System.Threading/SemaphoreFullException.xml
-? en/System.Threading/LazyThreadSafetyMode.xml
-? en/System.Threading/CancellationToken.xml
-? en/System.Threading/LockRecursionException.xml
-? en/System.Threading/ManualResetEventSlim.xml
-? en/System.Threading/CancellationTokenSource.xml
-M en/System.Threading/WaitHandle.xml
-M en/System.Threading/WaitCallback.xml
-M en/System.Threading/EventWaitHandle.xml
-M en/System.Threading/LockCookie.xml
-M en/System.Threading/SynchronizationLockException.xml
-M en/System.Threading/EventResetMode.xml
-M en/System.Threading/RegisteredWaitHandle.xml
-M en/System.Threading/ThreadPool.xml
-M en/System.Threading/Overlapped.xml
-M en/System.Threading/HostExecutionContextManager.xml
-M en/System.Threading/ParameterizedThreadStart.xml
-M en/System.Threading/ThreadStartException.xml
-M en/System.Threading/SynchronizationContext.xml
-M en/System.Threading/AsyncFlowControl.xml
-M en/System.Threading/HostExecutionContext.xml
-M en/System.Threading/Thread.xml
-M en/System.Threading/ExecutionContext.xml
-M en/System.Threading/ThreadState.xml
-M en/System.Threading/ThreadPriority.xml
-M en/System.Threading/ThreadInterruptedException.xml
-M en/System.Threading/IOCompletionCallback.xml
-M en/System.Threading/Timer.xml
-M en/System.Threading/ManualResetEvent.xml
-M en/System.Threading/WaitOrTimerCallback.xml
-M en/System.Threading/ThreadStart.xml
-M en/System.Threading/Timeout.xml
-M en/System.Threading/Monitor.xml
-M en/System.Threading/ThreadStateException.xml
-M en/System.Threading/CompressedStack.xml
-M en/System.Threading/ApartmentState.xml
-M en/System.Threading/TimerCallback.xml
-M en/System.Threading/ContextCallback.xml
-M en/System.Threading/Mutex.xml
-M en/System.Threading/Interlocked.xml
-M en/System.Threading/WaitHandleCannotBeOpenedException.xml
-M en/System.Threading/ReaderWriterLock.xml
-M en/System.Threading/NativeOverlapped.xml
-M en/System.Threading/SendOrPostCallback.xml
-M en/System.Threading/AbandonedMutexException.xml
-M en/System.Threading/AutoResetEvent.xml
-M en/System.Threading/ThreadAbortException.xml
-M en/System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.xml
-? en/System.Security/SecurityContextSource.xml
-? en/System.Security/SecurityRulesAttribute.xml
-? en/System.Security/SecurityRuleSet.xml
-? en/System.Security/SecurityState.xml
-M en/System.Security/SecurityElement.xml
-M en/System.Security/IEvidenceFactory.xml
-M en/System.Security/SecurityException.xml
-M en/System.Security/XmlSyntaxException.xml
-M en/System.Security/PolicyLevelType.xml
-M en/System.Security/UnverifiableCodeAttribute.xml
-M en/System.Security/IStackWalk.xml
-M en/System.Security/ISecurityPolicyEncodable.xml
-M en/System.Security/HostSecurityManager.xml
-M en/System.Security/IPermission.xml
-M en/System.Security/VerificationException.xml
-M en/System.Security/SecurityManager.xml
-M en/System.Security/HostProtectionException.xml
-M en/System.Security/SecurityZone.xml
-M en/System.Security/PermissionSet.xml
-M en/System.Security/CodeAccessPermission.xml
-M en/System.Security/AllowPartiallyTrustedCallersAttribute.xml
-M en/System.Security/SecuritySafeCriticalAttribute.xml
-M en/System.Security/SecurityCriticalAttribute.xml
-M en/System.Security/NamedPermissionSet.xml
-M en/System.Security/SuppressUnmanagedCodeSecurityAttribute.xml
-M en/System.Security/SecurityContext.xml
-M en/System.Security/HostSecurityManagerOptions.xml
-M en/System.Security/SecurityCriticalScope.xml
-M en/System.Security/SecureString.xml
-M en/System.Security/ISecurityEncodable.xml
-M en/System.Security/SecurityTransparentAttribute.xml
-M en/System.Security/SecurityTreatAsSafeAttribute.xml
-? en/System.Security.AccessControl/ObjectSecurity`1.xml
-M en/System.Security.AccessControl/ObjectAccessRule.xml
-M en/System.Security.AccessControl/RegistryAccessRule.xml
-M en/System.Security.AccessControl/MutexRights.xml
-M en/System.Security.AccessControl/CustomAce.xml
-M en/System.Security.AccessControl/DirectoryObjectSecurity.xml
-M en/System.Security.AccessControl/GenericAce.xml
-M en/System.Security.AccessControl/RegistryRights.xml
-M en/System.Security.AccessControl/MutexSecurity.xml
-M en/System.Security.AccessControl/AceQualifier.xml
-M en/System.Security.AccessControl/AceEnumerator.xml
-M en/System.Security.AccessControl/GenericAcl.xml
-M en/System.Security.AccessControl/EventWaitHandleAccessRule.xml
-M en/System.Security.AccessControl/ObjectSecurity.xml
-M en/System.Security.AccessControl/FileSystemAccessRule.xml
-M en/System.Security.AccessControl/RegistrySecurity.xml
-M en/System.Security.AccessControl/EventWaitHandleRights.xml
-M en/System.Security.AccessControl/SystemAcl.xml
-M en/System.Security.AccessControl/AuthorizationRuleCollection.xml
-M en/System.Security.AccessControl/AccessControlType.xml
-M en/System.Security.AccessControl/FileSystemRights.xml
-M en/System.Security.AccessControl/SecurityInfos.xml
-M en/System.Security.AccessControl/CommonObjectSecurity.xml
-M en/System.Security.AccessControl/RawAcl.xml
-M en/System.Security.AccessControl/AccessControlSections.xml
-M en/System.Security.AccessControl/EventWaitHandleSecurity.xml
-M en/System.Security.AccessControl/FileSystemSecurity.xml
-M en/System.Security.AccessControl/CommonSecurityDescriptor.xml
-M en/System.Security.AccessControl/CryptoKeySecurity.xml
-M en/System.Security.AccessControl/PrivilegeNotHeldException.xml
-M en/System.Security.AccessControl/AccessControlActions.xml
-M en/System.Security.AccessControl/RegistryAuditRule.xml
-M en/System.Security.AccessControl/AuthorizationRule.xml
-M en/System.Security.AccessControl/AccessControlModification.xml
-M en/System.Security.AccessControl/ResourceType.xml
-M en/System.Security.AccessControl/AccessRule.xml
-M en/System.Security.AccessControl/DirectorySecurity.xml
-M en/System.Security.AccessControl/CompoundAceType.xml
-M en/System.Security.AccessControl/DiscretionaryAcl.xml
-M en/System.Security.AccessControl/CommonAce.xml
-M en/System.Security.AccessControl/FileSystemAuditRule.xml
-M en/System.Security.AccessControl/AceFlags.xml
-M en/System.Security.AccessControl/CommonAcl.xml
-M en/System.Security.AccessControl/ObjectAce.xml
-M en/System.Security.AccessControl/AuditFlags.xml
-M en/System.Security.AccessControl/ObjectAceFlags.xml
-M en/System.Security.AccessControl/CompoundAce.xml
-M en/System.Security.AccessControl/CryptoKeyAccessRule.xml
-M en/System.Security.AccessControl/KnownAce.xml
-M en/System.Security.AccessControl/InheritanceFlags.xml
-M en/System.Security.AccessControl/CryptoKeyAuditRule.xml
-M en/System.Security.AccessControl/CryptoKeyRights.xml
-M en/System.Security.AccessControl/QualifiedAce.xml
-M en/System.Security.AccessControl/RawSecurityDescriptor.xml
-M en/System.Security.AccessControl/MutexAuditRule.xml
-M en/System.Security.AccessControl/ObjectAuditRule.xml
-M en/System.Security.AccessControl/AceType.xml
-M en/System.Security.AccessControl/ControlFlags.xml
-M en/System.Security.AccessControl/AuditRule.xml
-M en/System.Security.AccessControl/PropagationFlags.xml
-M en/System.Security.AccessControl/EventWaitHandleAuditRule.xml
-M en/System.Security.AccessControl/GenericSecurityDescriptor.xml
-M en/System.Security.AccessControl/NativeObjectSecurity.xml
-M en/System.Security.AccessControl/FileSecurity.xml
-M en/System.Security.AccessControl/MutexAccessRule.xml
-M en/System.Security.Permissions/PublisherIdentityPermission.xml
-M en/System.Security.Permissions/SecurityPermission.xml
-M en/System.Security.Permissions/KeyContainerPermissionFlags.xml
-M en/System.Security.Permissions/RegistryPermission.xml
-M en/System.Security.Permissions/StrongNameIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/IsolatedStoragePermissionAttribute.xml
-M en/System.Security.Permissions/IsolatedStorageFilePermissionAttribute.xml
-M en/System.Security.Permissions/PermissionState.xml
-M en/System.Security.Permissions/IsolatedStorageContainment.xml
-M en/System.Security.Permissions/PrincipalPermission.xml
-M en/System.Security.Permissions/FileDialogPermissionAttribute.xml
-M en/System.Security.Permissions/HostProtectionResource.xml
-M en/System.Security.Permissions/ReflectionPermissionFlag.xml
-M en/System.Security.Permissions/ZoneIdentityPermission.xml
-M en/System.Security.Permissions/EnvironmentPermissionAccess.xml
-M en/System.Security.Permissions/EnvironmentPermissionAttribute.xml
-M en/System.Security.Permissions/GacIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/FileIOPermissionAccess.xml
-M en/System.Security.Permissions/PublisherIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/KeyContainerPermission.xml
-M en/System.Security.Permissions/SecurityPermissionAttribute.xml
-M en/System.Security.Permissions/SecurityAction.xml
-M en/System.Security.Permissions/CodeAccessSecurityAttribute.xml
-M en/System.Security.Permissions/UrlIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/SecurityPermissionFlag.xml
-M en/System.Security.Permissions/SiteIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/EnvironmentPermission.xml
-M en/System.Security.Permissions/GacIdentityPermission.xml
-M en/System.Security.Permissions/PrincipalPermissionAttribute.xml
-M en/System.Security.Permissions/UIPermissionWindow.xml
-M en/System.Security.Permissions/FileIOPermission.xml
-M en/System.Security.Permissions/ZoneIdentityPermissionAttribute.xml
-M en/System.Security.Permissions/KeyContainerPermissionAccessEntryCollection.xml
-M en/System.Security.Permissions/StrongNamePublicKeyBlob.xml
-M en/System.Security.Permissions/UrlIdentityPermission.xml
-M en/System.Security.Permissions/UIPermission.xml
-M en/System.Security.Permissions/ReflectionPermissionAttribute.xml
-M en/System.Security.Permissions/SiteIdentityPermission.xml
-M en/System.Security.Permissions/PermissionSetAttribute.xml
-M en/System.Security.Permissions/KeyContainerPermissionAttribute.xml
-M en/System.Security.Permissions/FileDialogPermissionAccess.xml
-M en/System.Security.Permissions/SecurityAttribute.xml
-M en/System.Security.Permissions/IUnrestrictedPermission.xml
-M en/System.Security.Permissions/StrongNameIdentityPermission.xml
-M en/System.Security.Permissions/IsolatedStoragePermission.xml
-M en/System.Security.Permissions/IsolatedStorageFilePermission.xml
-M en/System.Security.Permissions/ReflectionPermission.xml
-M en/System.Security.Permissions/RegistryPermissionAccess.xml
-M en/System.Security.Permissions/FileIOPermissionAttribute.xml
-M en/System.Security.Permissions/RegistryPermissionAttribute.xml
-M en/System.Security.Permissions/UIPermissionClipboard.xml
-M en/System.Security.Permissions/KeyContainerPermissionAccessEntry.xml
-M en/System.Security.Permissions/FileDialogPermission.xml
-M en/System.Security.Permissions/HostProtectionAttribute.xml
-M en/System.Security.Permissions/KeyContainerPermissionAccessEntryEnumerator.xml
-M en/System.Security.Permissions/UIPermissionAttribute.xml
-M en/System.Runtime.Remoting.Messaging/CallContext.xml
-M en/System.Runtime.Remoting.Messaging/IRemotingFormatter.xml
-M en/System.Runtime.Remoting.Messaging/RemotingSurrogateSelector.xml
-M en/System.Runtime.Remoting.Messaging/InternalMessageWrapper.xml
-M en/System.Runtime.Remoting.Messaging/IMessageSink.xml
-M en/System.Runtime.Remoting.Messaging/IMessageCtrl.xml
-M en/System.Runtime.Remoting.Messaging/MethodCallMessageWrapper.xml
-M en/System.Runtime.Remoting.Messaging/ReturnMessage.xml
-M en/System.Runtime.Remoting.Messaging/HeaderHandler.xml
-M en/System.Runtime.Remoting.Messaging/ConstructionCall.xml
-M en/System.Runtime.Remoting.Messaging/MessageSurrogateFilter.xml
-M en/System.Runtime.Remoting.Messaging/MethodReturnMessageWrapper.xml
-M en/System.Runtime.Remoting.Messaging/OneWayAttribute.xml
-M en/System.Runtime.Remoting.Messaging/Header.xml
-M en/System.Runtime.Remoting.Messaging/IMethodCallMessage.xml
-M en/System.Runtime.Remoting.Messaging/IMessage.xml
-M en/System.Runtime.Remoting.Messaging/IMethodReturnMessage.xml
-M en/System.Runtime.Remoting.Messaging/IMethodMessage.xml
-M en/System.Runtime.Remoting.Messaging/MethodResponse.xml
-M en/System.Runtime.Remoting.Messaging/ILogicalThreadAffinative.xml
-M en/System.Runtime.Remoting.Messaging/ConstructionResponse.xml
-M en/System.Runtime.Remoting.Messaging/LogicalCallContext.xml
-M en/System.Runtime.Remoting.Messaging/AsyncResult.xml
-M en/System.Runtime.Remoting.Messaging/MethodCall.xml
-M en/System.Security.Principal/TokenImpersonationLevel.xml
-M en/System.Security.Principal/IdentityNotMappedException.xml
-M en/System.Security.Principal/WellKnownSidType.xml
-M en/System.Security.Principal/IdentityReferenceCollection.xml
-M en/System.Security.Principal/GenericIdentity.xml
-M en/System.Security.Principal/IPrincipal.xml
-M en/System.Security.Principal/WindowsPrincipal.xml
-M en/System.Security.Principal/NTAccount.xml
-M en/System.Security.Principal/PrincipalPolicy.xml
-M en/System.Security.Principal/IIdentity.xml
-M en/System.Security.Principal/WindowsBuiltInRole.xml
-M en/System.Security.Principal/WindowsIdentity.xml
-M en/System.Security.Principal/WindowsImpersonationContext.xml
-M en/System.Security.Principal/IdentityReference.xml
-M en/System.Security.Principal/WindowsAccountType.xml
-M en/System.Security.Principal/SecurityIdentifier.xml
-M en/System.Security.Principal/TokenAccessLevels.xml
-M en/System.Security.Principal/GenericPrincipal.xml
-M en/System.Diagnostics.SymbolStore/ISymbolBinder1.xml
-M en/System.Diagnostics.SymbolStore/ISymbolVariable.xml
-M en/System.Diagnostics.SymbolStore/SymAddressKind.xml
-M en/System.Diagnostics.SymbolStore/SymLanguageVendor.xml
-M en/System.Diagnostics.SymbolStore/ISymbolNamespace.xml
-M en/System.Diagnostics.SymbolStore/ISymbolReader.xml
-M en/System.Diagnostics.SymbolStore/ISymbolBinder.xml
-M en/System.Diagnostics.SymbolStore/SymbolToken.xml
-M en/System.Diagnostics.SymbolStore/ISymbolScope.xml
-M en/System.Diagnostics.SymbolStore/SymDocumentType.xml
-M en/System.Diagnostics.SymbolStore/ISymbolDocumentWriter.xml
-M en/System.Diagnostics.SymbolStore/ISymbolWriter.xml
-M en/System.Diagnostics.SymbolStore/ISymbolDocument.xml
-M en/System.Diagnostics.SymbolStore/SymLanguageType.xml
-M en/System.Diagnostics.SymbolStore/ISymbolMethod.xml
-M en/System.Runtime.Hosting/ApplicationActivator.xml
-M en/System.Runtime.Hosting/ActivationArguments.xml
-M en/System.Configuration.Assemblies/AssemblyHash.xml
-M en/System.Configuration.Assemblies/AssemblyHashAlgorithm.xml
-M en/System.Configuration.Assemblies/AssemblyVersionCompatibility.xml
-? en/Microsoft.Win32.SafeHandles/SafeRegistryHandle.xml
-M en/Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.xml
-M en/Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.xml
-M en/Microsoft.Win32.SafeHandles/SafeFileHandle.xml
-M en/Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.xml
-M en/Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.xml
-M en/Microsoft.Win32.SafeHandles/SafeWaitHandle.xml
-? en/System.Runtime.Serialization/SafeSerializationEventArgs.xml
-? en/System.Runtime.Serialization/ISafeSerializationData.xml
-M en/System.Runtime.Serialization/ISerializationSurrogate.xml
-M en/System.Runtime.Serialization/StreamingContextStates.xml
-M en/System.Runtime.Serialization/OnDeserializedAttribute.xml
-M en/System.Runtime.Serialization/ISurrogateSelector.xml
-M en/System.Runtime.Serialization/SerializationInfo.xml
-M en/System.Runtime.Serialization/ObjectIDGenerator.xml
-M en/System.Runtime.Serialization/FormatterConverter.xml
-M en/System.Runtime.Serialization/SerializationInfoEnumerator.xml
-M en/System.Runtime.Serialization/SerializationException.xml
-M en/System.Runtime.Serialization/IObjectReference.xml
-M en/System.Runtime.Serialization/StreamingContext.xml
-M en/System.Runtime.Serialization/SerializationEntry.xml
-M en/System.Runtime.Serialization/SerializationObjectManager.xml
-M en/System.Runtime.Serialization/OnSerializingAttribute.xml
-M en/System.Runtime.Serialization/ObjectManager.xml
-M en/System.Runtime.Serialization/SerializationBinder.xml
-M en/System.Runtime.Serialization/Formatter.xml
-M en/System.Runtime.Serialization/IFormatterConverter.xml
-M en/System.Runtime.Serialization/FormatterServices.xml
-M en/System.Runtime.Serialization/OnDeserializingAttribute.xml
-M en/System.Runtime.Serialization/OnSerializedAttribute.xml
-M en/System.Runtime.Serialization/IFormatter.xml
-M en/System.Runtime.Serialization/IDeserializationCallback.xml
-M en/System.Runtime.Serialization/SurrogateSelector.xml
-M en/System.Runtime.Serialization/OptionalFieldAttribute.xml
-M en/System.Runtime.Serialization/ISerializable.xml
-? en/System/Lazy`1.xml
-? en/System/Action`3.xml
-? en/System/Action`5.xml
-? en/System/Action`7.xml
-? en/System/Environment+SpecialFolderOption.xml
-? en/System/TypeAccessException.xml
-? en/System/Func`1.xml
-? en/System/Func`3.xml
-? en/System/Func`5.xml
-? en/System/Func`7.xml
-? en/System/Func`9.xml
-? en/System/Tuple`1.xml
-? en/System/TimeZoneInfo+TransitionTime.xml
-? en/System/Tuple`3.xml
-? en/System/IObservable`1.xml
-? en/System/Tuple`5.xml
-? en/System/InsufficientExecutionStackException.xml
-? en/System/Tuple`7.xml
-? en/System/TimeZoneInfo+AdjustmentRule.xml
-? en/System/Action.xml
-? en/System/Action`2.xml
-? en/System/Action`4.xml
-? en/System/Action`6.xml
-? en/System/Action`8.xml
-? en/System/IObserver`1.xml
-? en/System/TimeZoneNotFoundException.xml
-? en/System/Func`2.xml
-? en/System/Func`4.xml
-? en/System/Func`6.xml
-? en/System/Func`8.xml
-? en/System/Tuple.xml
-? en/System/GCNotificationStatus.xml
-? en/System/TimeZoneInfo.xml
-? en/System/Tuple`2.xml
-? en/System/Tuple`4.xml
-? en/System/Tuple`6.xml
-? en/System/InvalidTimeZoneException.xml
-? en/System/Tuple`8.xml
-? en/System/AggregateException.xml
-M en/System/UnhandledExceptionEventHandler.xml
-M en/System/ApplicationException.xml
-M en/System/UInt32.xml
-M en/System/InvalidOperationException.xml
-M en/System/ConsoleKeyInfo.xml
-M en/System/Activator.xml
-M en/System/Action`1.xml
-M en/System/Int32.xml
-M en/System/TypeLoadException.xml
-M en/System/LoaderOptimizationAttribute.xml
-M en/System/ConsoleColor.xml
-M en/System/Void.xml
-M en/System/Environment.xml
-M en/System/NullReferenceException.xml
-M en/System/Double.xml
-M en/System/AttributeUsageAttribute.xml
-M en/System/TypeCode.xml
-M en/System/Char.xml
-M en/System/IComparable.xml
-M en/System/MissingMemberException.xml
-M en/System/IndexOutOfRangeException.xml
-M en/System/Convert.xml
-M en/System/Random.xml
-M en/System/TimeSpan.xml
-M en/System/BadImageFormatException.xml
-M en/System/Predicate`1.xml
-M en/System/ArrayTypeMismatchException.xml
-M en/System/Version.xml
-M en/System/MissingMethodException.xml
-M en/System/TimeZone.xml
-M en/System/Comparison`1.xml
-M en/System/MTAThreadAttribute.xml
-M en/System/AttributeTargets.xml
-M en/System/InsufficientMemoryException.xml
-M en/System/StringComparer.xml
-M en/System/ContextBoundObject.xml
-M en/System/DateTimeOffset.xml
-M en/System/OutOfMemoryException.xml
-M en/System/TimeoutException.xml
-M en/System/ActivationContext.xml
-M en/System/TypeInitializationException.xml
-M en/System/MulticastNotSupportedException.xml
-M en/System/ObjectDisposedException.xml
-M en/System/OverflowException.xml
-M en/System/ParamArrayAttribute.xml
-M en/System/IServiceProvider.xml
-M en/System/IAsyncResult.xml
-M en/System/ResolveEventArgs.xml
-M en/System/IAppDomainSetup.xml
-M en/System/RuntimeFieldHandle.xml
-M en/System/SystemException.xml
-M en/System/ConsoleModifiers.xml
-M en/System/_AppDomain.xml
-M en/System/ExecutionEngineException.xml
-M en/System/ArithmeticException.xml
-M en/System/RankException.xml
-M en/System/Environment+SpecialFolder.xml
-M en/System/ConsoleSpecialKey.xml
-M en/System/EventHandler.xml
-M en/System/Boolean.xml
-M en/System/InvalidCastException.xml
-M en/System/Guid.xml
-M en/System/PlatformNotSupportedException.xml
-M en/System/MissingFieldException.xml
-M en/System/OperatingSystem.xml
-M en/System/AssemblyLoadEventArgs.xml
-M en/System/ObsoleteAttribute.xml
-M en/System/MulticastDelegate.xml
-M en/System/EventHandler`1.xml
-M en/System/RuntimeMethodHandle.xml
-M en/System/PlatformID.xml
-M en/System/AppDomainUnloadedException.xml
-M en/System/Byte.xml
-M en/System/Enum.xml
-M en/System/UIntPtr.xml
-M en/System/BitConverter.xml
-M en/System/CrossAppDomainDelegate.xml
-M en/System/FlagsAttribute.xml
-M en/System/DBNull.xml
-M en/System/ArraySegment`1.xml
-M en/System/ArgIterator.xml
-M en/System/FieldAccessException.xml
-M en/System/Math.xml
-M en/System/NonSerializedAttribute.xml
-M en/System/SerializableAttribute.xml
-M en/System/DateTime.xml
-M en/System/Exception.xml
-M en/System/OperationCanceledException.xml
-M en/System/ThreadStaticAttribute.xml
-M en/System/DllNotFoundException.xml
-M en/System/AppDomain.xml
-M en/System/StackOverflowException.xml
-M en/System/GCCollectionMode.xml
-M en/System/ActivationContext+ContextForm.xml
-M en/System/Delegate.xml
-M en/System/ApplicationId.xml
-M en/System/EnvironmentVariableTarget.xml
-M en/System/Single.xml
-M en/System/UnauthorizedAccessException.xml
-M en/System/NotSupportedException.xml
-M en/System/InvalidProgramException.xml
-M en/System/ICloneable.xml
-M en/System/StringSplitOptions.xml
-M en/System/ModuleHandle.xml
-M en/System/RuntimeTypeHandle.xml
-M en/System/StringComparison.xml
-M en/System/Console.xml
-M en/System/DateTimeKind.xml
-M en/System/NotImplementedException.xml
-M en/System/MarshalByRefObject.xml
-M en/System/WeakReference.xml
-M en/System/ConsoleCancelEventHandler.xml
-M en/System/ContextMarshalException.xml
-M en/System/CLSCompliantAttribute.xml
-M en/System/TypeUnloadedException.xml
-M en/System/Array.xml
-M en/System/DayOfWeek.xml
-M en/System/ValueType.xml
-M en/System/Nullable`1.xml
-M en/System/ResolveEventHandler.xml
-M en/System/ContextStaticAttribute.xml
-M en/System/MethodAccessException.xml
-M en/System/Type.xml
-M en/System/IConvertible.xml
-M en/System/SByte.xml
-M en/System/UInt16.xml
-M en/System/NotFiniteNumberException.xml
-M en/System/MidpointRounding.xml
-M en/System/GC.xml
-M en/System/AppDomainSetup.xml
-M en/System/AsyncCallback.xml
-M en/System/ArgumentOutOfRangeException.xml
-M en/System/ArgumentNullException.xml
-M en/System/IEquatable`1.xml
-M en/System/IDisposable.xml
-M en/System/UnhandledExceptionEventArgs.xml
-M en/System/Int16.xml
-M en/System/ArgumentException.xml
-M en/System/LocalDataStoreSlot.xml
-M en/System/Attribute.xml
-M en/System/AppDomainManager.xml
-M en/System/AccessViolationException.xml
-M en/System/ICustomFormatter.xml
-M en/System/IFormattable.xml
-M en/System/Buffer.xml
-M en/System/ConsoleKey.xml
-M en/System/IFormatProvider.xml
-M en/System/AppDomainInitializer.xml
-M en/System/LoaderOptimization.xml
-M en/System/ApplicationIdentity.xml
-M en/System/AssemblyLoadEventHandler.xml
-M en/System/CharEnumerator.xml
-M en/System/IntPtr.xml
-M en/System/DataMisalignedException.xml
-M en/System/AppDomainManagerInitializationOptions.xml
-M en/System/ConsoleCancelEventArgs.xml
-M en/System/Converter`2.xml
-M en/System/UInt64.xml
-M en/System/Base64FormattingOptions.xml
-M en/System/CannotUnloadAppDomainException.xml
-M en/System/Nullable.xml
-M en/System/EventArgs.xml
-M en/System/Decimal.xml
-M en/System/IComparable`1.xml
-M en/System/RuntimeArgumentHandle.xml
-M en/System/STAThreadAttribute.xml
-M en/System/Int64.xml
-M en/System/TypedReference.xml
-M en/System/DuplicateWaitObjectException.xml
-M en/System/Object.xml
-M en/System/String.xml
-M en/System/FormatException.xml
-M en/System/EntryPointNotFoundException.xml
-M en/System/MemberAccessException.xml
-M en/System/DivideByZeroException.xml
-? en/System.Runtime.InteropServices/SafeBuffer.xml
-? en/System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.xml
-M en/System.Runtime.InteropServices/ExporterEventKind.xml
-M en/System.Runtime.InteropServices/SafeArrayTypeMismatchException.xml
-M en/System.Runtime.InteropServices/TypeLibTypeFlags.xml
-M en/System.Runtime.InteropServices/UCOMIEnumString.xml
-M en/System.Runtime.InteropServices/InAttribute.xml
-M en/System.Runtime.InteropServices/_EventInfo.xml
-M en/System.Runtime.InteropServices/_PropertyInfo.xml
-M en/System.Runtime.InteropServices/FUNCKIND.xml
-M en/System.Runtime.InteropServices/BINDPTR.xml
-M en/System.Runtime.InteropServices/UCOMIEnumConnections.xml
-M en/System.Runtime.InteropServices/ComCompatibleVersionAttribute.xml
-M en/System.Runtime.InteropServices/ITypeLibConverter.xml
-M en/System.Runtime.InteropServices/_ILGenerator.xml
-M en/System.Runtime.InteropServices/FieldOffsetAttribute.xml
-M en/System.Runtime.InteropServices/TYPEDESC.xml
-M en/System.Runtime.InteropServices/_Type.xml
-M en/System.Runtime.InteropServices/ITypeLibImporterNotifySink.xml
-M en/System.Runtime.InteropServices/DefaultCharSetAttribute.xml
-M en/System.Runtime.InteropServices/ICustomMarshaler.xml
-M en/System.Runtime.InteropServices/_MemberInfo.xml
-M en/System.Runtime.InteropServices/ComDefaultInterfaceAttribute.xml
-M en/System.Runtime.InteropServices/HandleRef.xml
-M en/System.Runtime.InteropServices/ITypeLibExporterNotifySink.xml
-M en/System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.xml
-M en/System.Runtime.InteropServices/CurrencyWrapper.xml
-M en/System.Runtime.InteropServices/TypeLibVarFlags.xml
-M en/System.Runtime.InteropServices/TYPEFLAGS.xml
-M en/System.Runtime.InteropServices/SafeArrayRankMismatchException.xml
-M en/System.Runtime.InteropServices/UnknownWrapper.xml
-M en/System.Runtime.InteropServices/_ConstructorInfo.xml
-M en/System.Runtime.InteropServices/ComInterfaceType.xml
-M en/System.Runtime.InteropServices/CALLCONV.xml
-M en/System.Runtime.InteropServices/TypeLibVersionAttribute.xml
-M en/System.Runtime.InteropServices/LCIDConversionAttribute.xml
-M en/System.Runtime.InteropServices/AutomationProxyAttribute.xml
-M en/System.Runtime.InteropServices/GCHandleType.xml
-M en/System.Runtime.InteropServices/OptionalAttribute.xml
-M en/System.Runtime.InteropServices/VarEnum.xml
-M en/System.Runtime.InteropServices/UCOMIEnumConnectionPoints.xml
-M en/System.Runtime.InteropServices/IMPLTYPEFLAGS.xml
-M en/System.Runtime.InteropServices/PreserveSigAttribute.xml
-M en/System.Runtime.InteropServices/LayoutKind.xml
-M en/System.Runtime.InteropServices/CONNECTDATA.xml
-M en/System.Runtime.InteropServices/ObjectCreationDelegate.xml
-M en/System.Runtime.InteropServices/ITypeLibExporterNameProvider.xml
-M en/System.Runtime.InteropServices/ComSourceInterfacesAttribute.xml
-M en/System.Runtime.InteropServices/AssemblyRegistrationFlags.xml
-M en/System.Runtime.InteropServices/UCOMIBindCtx.xml
-M en/System.Runtime.InteropServices/SafeHandle.xml
-M en/System.Runtime.InteropServices/PARAMFLAG.xml
-M en/System.Runtime.InteropServices/UCOMITypeComp.xml
-M en/System.Runtime.InteropServices/_Exception.xml
-M en/System.Runtime.InteropServices/_FieldInfo.xml
-M en/System.Runtime.InteropServices/TypeLibConverter.xml
-M en/System.Runtime.InteropServices/ELEMDESC+DESCUNION.xml
-M en/System.Runtime.InteropServices/_CustomAttributeBuilder.xml
-M en/System.Runtime.InteropServices/ClassInterfaceAttribute.xml
-M en/System.Runtime.InteropServices/ComRegisterFunctionAttribute.xml
-M en/System.Runtime.InteropServices/RegistrationServices.xml
-M en/System.Runtime.InteropServices/ArrayWithOffset.xml
-M en/System.Runtime.InteropServices/ICustomAdapter.xml
-M en/System.Runtime.InteropServices/InterfaceTypeAttribute.xml
-M en/System.Runtime.InteropServices/DllImportAttribute.xml
-M en/System.Runtime.InteropServices/OutAttribute.xml
-M en/System.Runtime.InteropServices/InvalidComObjectException.xml
-M en/System.Runtime.InteropServices/_ConstructorBuilder.xml
-M en/System.Runtime.InteropServices/_ParameterInfo.xml
-M en/System.Runtime.InteropServices/COMException.xml
-M en/System.Runtime.InteropServices/DispIdAttribute.xml
-M en/System.Runtime.InteropServices/DispatchWrapper.xml
-M en/System.Runtime.InteropServices/ExternalException.xml
-M en/System.Runtime.InteropServices/INVOKEKIND.xml
-M en/System.Runtime.InteropServices/IDLFLAG.xml
-M en/System.Runtime.InteropServices/MarshalDirectiveException.xml
-M en/System.Runtime.InteropServices/StructLayoutAttribute.xml
-M en/System.Runtime.InteropServices/_Thread.xml
-M en/System.Runtime.InteropServices/RuntimeEnvironment.xml
-M en/System.Runtime.InteropServices/ComConversionLossAttribute.xml
-M en/System.Runtime.InteropServices/UCOMIRunningObjectTable.xml
-M en/System.Runtime.InteropServices/CallingConvention.xml
-M en/System.Runtime.InteropServices/_AssemblyName.xml
-M en/System.Runtime.InteropServices/ComUnregisterFunctionAttribute.xml
-M en/System.Runtime.InteropServices/EXCEPINFO.xml
-M en/System.Runtime.InteropServices/SYSKIND.xml
-M en/System.Runtime.InteropServices/_AssemblyBuilder.xml
-M en/System.Runtime.InteropServices/UCOMIPersistFile.xml
-M en/System.Runtime.InteropServices/_TypeBuilder.xml
-M en/System.Runtime.InteropServices/UCOMIStream.xml
-M en/System.Runtime.InteropServices/STATSTG.xml
-M en/System.Runtime.InteropServices/FUNCDESC.xml
-M en/System.Runtime.InteropServices/_MethodInfo.xml
-M en/System.Runtime.InteropServices/FILETIME.xml
-M en/System.Runtime.InteropServices/PARAMDESC.xml
-M en/System.Runtime.InteropServices/MarshalAsAttribute.xml
-M en/System.Runtime.InteropServices/_Attribute.xml
-M en/System.Runtime.InteropServices/DISPPARAMS.xml
-M en/System.Runtime.InteropServices/UCOMITypeLib.xml
-M en/System.Runtime.InteropServices/TypeLibVarAttribute.xml
-M en/System.Runtime.InteropServices/VARFLAGS.xml
-M en/System.Runtime.InteropServices/VariantWrapper.xml
-M en/System.Runtime.InteropServices/TypeLibFuncAttribute.xml
-M en/System.Runtime.InteropServices/ComAliasNameAttribute.xml
-M en/System.Runtime.InteropServices/TypeLibExporterFlags.xml
-M en/System.Runtime.InteropServices/ComVisibleAttribute.xml
-M en/System.Runtime.InteropServices/BIND_OPTS.xml
-M en/System.Runtime.InteropServices/TYPEKIND.xml
-M en/System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.xml
-M en/System.Runtime.InteropServices/IRegistrationServices.xml
-M en/System.Runtime.InteropServices/VARDESC.xml
-M en/System.Runtime.InteropServices/_ModuleBuilder.xml
-M en/System.Runtime.InteropServices/ComImportAttribute.xml
-M en/System.Runtime.InteropServices/TypeLibFuncFlags.xml
-M en/System.Runtime.InteropServices/UnmanagedType.xml
-M en/System.Runtime.InteropServices/TYPELIBATTR.xml
-M en/System.Runtime.InteropServices/IDLDESC.xml
-M en/System.Runtime.InteropServices/ProgIdAttribute.xml
-M en/System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.xml
-M en/System.Runtime.InteropServices/ComMemberType.xml
-M en/System.Runtime.InteropServices/VARDESC+DESCUNION.xml
-M en/System.Runtime.InteropServices/_MethodBase.xml
-M en/System.Runtime.InteropServices/CoClassAttribute.xml
-M en/System.Runtime.InteropServices/ICustomFactory.xml
-M en/System.Runtime.InteropServices/IDispatchImplAttribute.xml
-M en/System.Runtime.InteropServices/ExtensibleClassFactory.xml
-M en/System.Runtime.InteropServices/ELEMDESC.xml
-M en/System.Runtime.InteropServices/LIBFLAGS.xml
-M en/System.Runtime.InteropServices/ImportedFromTypeLibAttribute.xml
-M en/System.Runtime.InteropServices/_Module.xml
-M en/System.Runtime.InteropServices/UCOMIEnumVARIANT.xml
-M en/System.Runtime.InteropServices/_ParameterBuilder.xml
-M en/System.Runtime.InteropServices/Marshal.xml
-M en/System.Runtime.InteropServices/_EventBuilder.xml
-M en/System.Runtime.InteropServices/_FieldBuilder.xml
-M en/System.Runtime.InteropServices/ErrorWrapper.xml
-M en/System.Runtime.InteropServices/_Activator.xml
-M en/System.Runtime.InteropServices/RegistrationConnectionType.xml
-M en/System.Runtime.InteropServices/IDispatchImplType.xml
-M en/System.Runtime.InteropServices/SEHException.xml
-M en/System.Runtime.InteropServices/_LocalBuilder.xml
-M en/System.Runtime.InteropServices/RegistrationClassContext.xml
-M en/System.Runtime.InteropServices/GCHandle.xml
-M en/System.Runtime.InteropServices/UCOMIConnectionPoint.xml
-M en/System.Runtime.InteropServices/CriticalHandle.xml
-M en/System.Runtime.InteropServices/FUNCFLAGS.xml
-M en/System.Runtime.InteropServices/ImporterEventKind.xml
-M en/System.Runtime.InteropServices/_EnumBuilder.xml
-M en/System.Runtime.InteropServices/TypeLibImportClassAttribute.xml
-M en/System.Runtime.InteropServices/_Assembly.xml
-M en/System.Runtime.InteropServices/DESCKIND.xml
-M en/System.Runtime.InteropServices/ComEventInterfaceAttribute.xml
-M en/System.Runtime.InteropServices/_MethodRental.xml
-M en/System.Runtime.InteropServices/UCOMIEnumMoniker.xml
-M en/System.Runtime.InteropServices/_MethodBuilder.xml
-M en/System.Runtime.InteropServices/ClassInterfaceType.xml
-M en/System.Runtime.InteropServices/CharSet.xml
-M en/System.Runtime.InteropServices/UCOMITypeInfo.xml
-M en/System.Runtime.InteropServices/_PropertyBuilder.xml
-M en/System.Runtime.InteropServices/InvalidOleVariantTypeException.xml
-M en/System.Runtime.InteropServices/TypeLibTypeAttribute.xml
-M en/System.Runtime.InteropServices/BestFitMappingAttribute.xml
-M en/System.Runtime.InteropServices/_SignatureHelper.xml
-M en/System.Runtime.InteropServices/UCOMIMoniker.xml
-M en/System.Runtime.InteropServices/TypeLibImporterFlags.xml
-M en/System.Runtime.InteropServices/UCOMIConnectionPointContainer.xml
-M en/System.Runtime.InteropServices/BStrWrapper.xml
-M en/System.Runtime.InteropServices/TYPEATTR.xml
-M en/System.Runtime.InteropServices/GuidAttribute.xml
-M en/System.Runtime.Remoting.Activation/ActivatorLevel.xml
-M en/System.Runtime.Remoting.Activation/IConstructionCallMessage.xml
-M en/System.Runtime.Remoting.Activation/IActivator.xml
-M en/System.Runtime.Remoting.Activation/UrlAttribute.xml
-M en/System.Runtime.Remoting.Activation/IConstructionReturnMessage.xml
-M en/System.Resources/ResourceManager.xml
-M en/System.Resources/IResourceReader.xml
-M en/System.Resources/ResourceSet.xml
-M en/System.Resources/ResourceWriter.xml
-M en/System.Resources/UltimateResourceFallbackLocation.xml
-M en/System.Resources/MissingManifestResourceException.xml
-M en/System.Resources/ResourceReader.xml
-M en/System.Resources/IResourceWriter.xml
-M en/System.Resources/NeutralResourcesLanguageAttribute.xml
-M en/System.Resources/SatelliteContractVersionAttribute.xml
-M en/System.Resources/MissingSatelliteAssemblyException.xml
-M en/System.Runtime.Remoting.Contexts/IContributeClientContextSink.xml
-M en/System.Runtime.Remoting.Contexts/IContextAttribute.xml
-M en/System.Runtime.Remoting.Contexts/IContributeDynamicSink.xml
-M en/System.Runtime.Remoting.Contexts/Context.xml
-M en/System.Runtime.Remoting.Contexts/SynchronizationAttribute.xml
-M en/System.Runtime.Remoting.Contexts/IDynamicMessageSink.xml
-M en/System.Runtime.Remoting.Contexts/ContextProperty.xml
-M en/System.Runtime.Remoting.Contexts/CrossContextDelegate.xml
-M en/System.Runtime.Remoting.Contexts/IContributeEnvoySink.xml
-M en/System.Runtime.Remoting.Contexts/IContextProperty.xml
-M en/System.Runtime.Remoting.Contexts/IDynamicProperty.xml
-M en/System.Runtime.Remoting.Contexts/IContributeObjectSink.xml
-M en/System.Runtime.Remoting.Contexts/ContextAttribute.xml
-M en/System.Runtime.Remoting.Contexts/IContributeServerContextSink.xml
-M en/System.Runtime.Remoting.Contexts/IContextPropertyActivator.xml
-? en/System.Collections/StructuralComparisons.xml
-? en/System.Collections/IStructuralEquatable.xml
-? en/System.Collections/IStructuralComparable.xml
-M en/System.Collections/IDictionaryEnumerator.xml
-M en/System.Collections/IComparer.xml
-M en/System.Collections/IList.xml
-M en/System.Collections/Queue.xml
-M en/System.Collections/ReadOnlyCollectionBase.xml
-M en/System.Collections/CaseInsensitiveComparer.xml
-M en/System.Collections/CollectionBase.xml
-M en/System.Collections/DictionaryEntry.xml
-M en/System.Collections/IEnumerable.xml
-M en/System.Collections/IEnumerator.xml
-M en/System.Collections/Hashtable.xml
-M en/System.Collections/SortedList.xml
-M en/System.Collections/IEqualityComparer.xml
-M en/System.Collections/DictionaryBase.xml
-M en/System.Collections/IHashCodeProvider.xml
-M en/System.Collections/ICollection.xml
-M en/System.Collections/Stack.xml
-M en/System.Collections/CaseInsensitiveHashCodeProvider.xml
-M en/System.Collections/Comparer.xml
-M en/System.Collections/ArrayList.xml
-M en/System.Collections/BitArray.xml
-M en/System.Collections/IDictionary.xml
-M en/System.Runtime.ConstrainedExecution/Consistency.xml
-M en/System.Runtime.ConstrainedExecution/CriticalFinalizerObject.xml
-M en/System.Runtime.ConstrainedExecution/Cer.xml
-M en/System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.xml
-M en/System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.xml
-M en/System.Diagnostics.CodeAnalysis/SuppressMessageAttribute.xml
-M en/System.Reflection.Emit/TypeToken.xml
-M en/System.Reflection.Emit/MethodRental.xml
-M en/System.Reflection.Emit/AssemblyBuilder.xml
-M en/System.Reflection.Emit/TypeBuilder.xml
-M en/System.Reflection.Emit/OperandType.xml
-M en/System.Reflection.Emit/OpCodes.xml
-M en/System.Reflection.Emit/ConstructorBuilder.xml
-M en/System.Reflection.Emit/PackingSize.xml
-M en/System.Reflection.Emit/StringToken.xml
-M en/System.Reflection.Emit/OpCode.xml
-M en/System.Reflection.Emit/StackBehaviour.xml
-M en/System.Reflection.Emit/EnumBuilder.xml
-M en/System.Reflection.Emit/ILGenerator.xml
-M en/System.Reflection.Emit/ParameterToken.xml
-M en/System.Reflection.Emit/MethodToken.xml
-M en/System.Reflection.Emit/EventToken.xml
-M en/System.Reflection.Emit/FieldToken.xml
-M en/System.Reflection.Emit/PropertyToken.xml
-M en/System.Reflection.Emit/DynamicILInfo.xml
-M en/System.Reflection.Emit/DynamicMethod.xml
-M en/System.Reflection.Emit/GenericTypeParameterBuilder.xml
-M en/System.Reflection.Emit/ParameterBuilder.xml
-M en/System.Reflection.Emit/MethodBuilder.xml
-M en/System.Reflection.Emit/EventBuilder.xml
-M en/System.Reflection.Emit/FieldBuilder.xml
-M en/System.Reflection.Emit/PropertyBuilder.xml
-M en/System.Reflection.Emit/ModuleBuilder.xml
-M en/System.Reflection.Emit/PEFileKinds.xml
-M en/System.Reflection.Emit/SignatureHelper.xml
-M en/System.Reflection.Emit/LocalBuilder.xml
-M en/System.Reflection.Emit/SignatureToken.xml
-M en/System.Reflection.Emit/CustomAttributeBuilder.xml
-M en/System.Reflection.Emit/UnmanagedMarshal.xml
-M en/System.Reflection.Emit/AssemblyBuilderAccess.xml
-M en/System.Reflection.Emit/FlowControl.xml
-M en/System.Reflection.Emit/OpCodeType.xml
-M en/System.Reflection.Emit/Label.xml
-M en/System.Collections.Generic/IEqualityComparer`1.xml
-M en/System.Collections.Generic/KeyValuePair`2.xml
-M en/System.Collections.Generic/KeyNotFoundException.xml
-M en/System.Collections.Generic/ICollection`1.xml
-M en/System.Collections.Generic/Dictionary`2.xml
-M en/System.Collections.Generic/Dictionary`2+KeyCollection.xml
-M en/System.Collections.Generic/Dictionary`2+ValueCollection+Enumerator.xml
-M en/System.Collections.Generic/Comparer`1.xml
-M en/System.Collections.Generic/List`1.xml
-M en/System.Collections.Generic/IDictionary`2.xml
-M en/System.Collections.Generic/IComparer`1.xml
-M en/System.Collections.Generic/Dictionary`2+KeyCollection+Enumerator.xml
-M en/System.Collections.Generic/Dictionary`2+Enumerator.xml
-M en/System.Collections.Generic/IList`1.xml
-M en/System.Collections.Generic/EqualityComparer`1.xml
-M en/System.Collections.Generic/IEnumerable`1.xml
-M en/System.Collections.Generic/List`1+Enumerator.xml
-M en/System.Collections.Generic/IEnumerator`1.xml
-M en/System.Collections.Generic/Dictionary`2+ValueCollection.xml
-M en/System.Deployment.Internal/InternalActivationContextHelper.xml
-M en/System.Deployment.Internal/InternalApplicationIdentityHelper.xml
-? en/System.Globalization/TimeSpanStyles.xml
-? en/System.Globalization/CultureNotFoundException.xml
-M en/System.Globalization/JapaneseCalendar.xml
-M en/System.Globalization/DateTimeFormatInfo.xml
-M en/System.Globalization/CalendarAlgorithmType.xml
-M en/System.Globalization/DaylightTime.xml
-M en/System.Globalization/UnicodeCategory.xml
-M en/System.Globalization/IdnMapping.xml
-M en/System.Globalization/HijriCalendar.xml
-M en/System.Globalization/CultureInfo.xml
-M en/System.Globalization/TextElementEnumerator.xml
-M en/System.Globalization/KoreanLunisolarCalendar.xml
-M en/System.Globalization/DigitShapes.xml
-M en/System.Globalization/TaiwanLunisolarCalendar.xml
-M en/System.Globalization/GregorianCalendar.xml
-M en/System.Globalization/KoreanCalendar.xml
-M en/System.Globalization/JapaneseLunisolarCalendar.xml
-M en/System.Globalization/TaiwanCalendar.xml
-M en/System.Globalization/CalendarWeekRule.xml
-M en/System.Globalization/UmAlQuraCalendar.xml
-M en/System.Globalization/StringInfo.xml
-M en/System.Globalization/PersianCalendar.xml
-M en/System.Globalization/EastAsianLunisolarCalendar.xml
-M en/System.Globalization/NumberStyles.xml
-M en/System.Globalization/GregorianCalendarTypes.xml
-M en/System.Globalization/RegionInfo.xml
-M en/System.Globalization/SortKey.xml
-M en/System.Globalization/CharUnicodeInfo.xml
-M en/System.Globalization/DateTimeStyles.xml
-M en/System.Globalization/TextInfo.xml
-M en/System.Globalization/ChineseLunisolarCalendar.xml
-M en/System.Globalization/CompareInfo.xml
-M en/System.Globalization/CompareOptions.xml
-M en/System.Globalization/HebrewCalendar.xml
-M en/System.Globalization/ThaiBuddhistCalendar.xml
-M en/System.Globalization/CultureTypes.xml
-M en/System.Globalization/Calendar.xml
-M en/System.Globalization/JulianCalendar.xml
-M en/System.Globalization/NumberFormatInfo.xml
-M en/System.Runtime.Remoting.Channels/IClientChannelSinkProvider.xml
-M en/System.Runtime.Remoting.Channels/IChannel.xml
-M en/System.Runtime.Remoting.Channels/ClientChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/IChannelSender.xml
-M en/System.Runtime.Remoting.Channels/IServerChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/IChannelReceiverHook.xml
-M en/System.Runtime.Remoting.Channels/TransportHeaders.xml
-M en/System.Runtime.Remoting.Channels/IChannelDataStore.xml
-M en/System.Runtime.Remoting.Channels/IClientChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/IServerChannelSink.xml
-M en/System.Runtime.Remoting.Channels/IClientFormatterSink.xml
-M en/System.Runtime.Remoting.Channels/ITransportHeaders.xml
-M en/System.Runtime.Remoting.Channels/BaseChannelSinkWithProperties.xml
-M en/System.Runtime.Remoting.Channels/IChannelSinkBase.xml
-M en/System.Runtime.Remoting.Channels/IServerResponseChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/BaseChannelObjectWithProperties.xml
-M en/System.Runtime.Remoting.Channels/IServerFormatterSinkProvider.xml
-M en/System.Runtime.Remoting.Channels/ServerProcessing.xml
-M en/System.Runtime.Remoting.Channels/IClientChannelSink.xml
-M en/System.Runtime.Remoting.Channels/IChannelReceiver.xml
-M en/System.Runtime.Remoting.Channels/ISecurableChannel.xml
-M en/System.Runtime.Remoting.Channels/IServerChannelSinkProvider.xml
-M en/System.Runtime.Remoting.Channels/SinkProviderData.xml
-M en/System.Runtime.Remoting.Channels/IClientResponseChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/ServerChannelSinkStack.xml
-M en/System.Runtime.Remoting.Channels/IClientFormatterSinkProvider.xml
-M en/System.Runtime.Remoting.Channels/ChannelServices.xml
-M en/System.Runtime.Remoting.Channels/BaseChannelWithProperties.xml
-M en/System.Runtime.Remoting.Channels/ChannelDataStore.xml
-M en/System.Collections.ObjectModel/ReadOnlyCollection`1.xml
-M en/System.Collections.ObjectModel/Collection`1.xml
-M en/System.Collections.ObjectModel/KeyedCollection`2.xml
-M en/System.Diagnostics/StackFrame.xml
-M en/System.Diagnostics/DebuggableAttribute+DebuggingModes.xml
-M en/System.Diagnostics/Debugger.xml
-M en/System.Diagnostics/DebuggerHiddenAttribute.xml
-M en/System.Diagnostics/StackTrace.xml
-M en/System.Diagnostics/DebuggerBrowsableState.xml
-M en/System.Diagnostics/DebuggerVisualizerAttribute.xml
-M en/System.Diagnostics/ConditionalAttribute.xml
-M en/System.Diagnostics/DebuggerDisplayAttribute.xml
-M en/System.Diagnostics/DebuggableAttribute.xml
-M en/System.Diagnostics/DebuggerStepThroughAttribute.xml
-M en/System.Diagnostics/DebuggerBrowsableAttribute.xml
-M en/System.Diagnostics/DebuggerTypeProxyAttribute.xml
-M en/System.Diagnostics/DebuggerNonUserCodeAttribute.xml
-M en/System.Diagnostics/DebuggerStepperBoundaryAttribute.xml
-M en/System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.xml
-M en/System.Runtime.InteropServices.ComTypes/EXCEPINFO.xml
-M en/System.Runtime.InteropServices.ComTypes/ELEMDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/CONNECTDATA.xml
-M en/System.Runtime.InteropServices.ComTypes/LIBFLAGS.xml
-M en/System.Runtime.InteropServices.ComTypes/SYSKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.xml
-M en/System.Runtime.InteropServices.ComTypes/ITypeInfo2.xml
-M en/System.Runtime.InteropServices.ComTypes/IRunningObjectTable.xml
-M en/System.Runtime.InteropServices.ComTypes/STATSTG.xml
-M en/System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.xml
-M en/System.Runtime.InteropServices.ComTypes/FUNCDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/PARAMFLAG.xml
-M en/System.Runtime.InteropServices.ComTypes/FILETIME.xml
-M en/System.Runtime.InteropServices.ComTypes/PARAMDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/FUNCKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/IPersistFile.xml
-M en/System.Runtime.InteropServices.ComTypes/IEnumVARIANT.xml
-M en/System.Runtime.InteropServices.ComTypes/BINDPTR.xml
-M en/System.Runtime.InteropServices.ComTypes/DISPPARAMS.xml
-M en/System.Runtime.InteropServices.ComTypes/ITypeLib2.xml
-M en/System.Runtime.InteropServices.ComTypes/IStream.xml
-M en/System.Runtime.InteropServices.ComTypes/IEnumString.xml
-M en/System.Runtime.InteropServices.ComTypes/ELEMDESC+DESCUNION.xml
-M en/System.Runtime.InteropServices.ComTypes/IBindCtx.xml
-M en/System.Runtime.InteropServices.ComTypes/VARFLAGS.xml
-M en/System.Runtime.InteropServices.ComTypes/FUNCFLAGS.xml
-M en/System.Runtime.InteropServices.ComTypes/ITypeComp.xml
-M en/System.Runtime.InteropServices.ComTypes/IEnumConnections.xml
-M en/System.Runtime.InteropServices.ComTypes/TYPEDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/BIND_OPTS.xml
-M en/System.Runtime.InteropServices.ComTypes/ITypeLib.xml
-M en/System.Runtime.InteropServices.ComTypes/IConnectionPoint.xml
-M en/System.Runtime.InteropServices.ComTypes/DESCKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/TYPEKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/VARDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/TYPEFLAGS.xml
-M en/System.Runtime.InteropServices.ComTypes/VARKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/INVOKEKIND.xml
-M en/System.Runtime.InteropServices.ComTypes/CALLCONV.xml
-M en/System.Runtime.InteropServices.ComTypes/IEnumMoniker.xml
-M en/System.Runtime.InteropServices.ComTypes/IDLFLAG.xml
-M en/System.Runtime.InteropServices.ComTypes/TYPELIBATTR.xml
-M en/System.Runtime.InteropServices.ComTypes/ITypeInfo.xml
-M en/System.Runtime.InteropServices.ComTypes/IDLDESC.xml
-M en/System.Runtime.InteropServices.ComTypes/VARDESC+DESCUNION.xml
-M en/System.Runtime.InteropServices.ComTypes/TYPEATTR.xml
-M en/System.Runtime.InteropServices.ComTypes/IMoniker.xml
-M en/index.xml
-M en/System.Text/DecoderFallback.xml
-M en/System.Text/Encoding.xml
-M en/System.Text/EncoderFallbackBuffer.xml
-M en/System.Text/UTF7Encoding.xml
-M en/System.Text/UTF8Encoding.xml
-M en/System.Text/UnicodeEncoding.xml
-M en/System.Text/DecoderExceptionFallbackBuffer.xml
-M en/System.Text/EncoderFallback.xml
-M en/System.Text/DecoderReplacementFallbackBuffer.xml
-M en/System.Text/ASCIIEncoding.xml
-M en/System.Text/EncodingInfo.xml
-M en/System.Text/DecoderFallbackException.xml
-M en/System.Text/DecoderExceptionFallback.xml
-M en/System.Text/DecoderReplacementFallback.xml
-M en/System.Text/Decoder.xml
-M en/System.Text/EncoderExceptionFallbackBuffer.xml
-M en/System.Text/EncoderReplacementFallbackBuffer.xml
-M en/System.Text/NormalizationForm.xml
-M en/System.Text/UTF32Encoding.xml
-M en/System.Text/StringBuilder.xml
-M en/System.Text/EncoderFallbackException.xml
-M en/System.Text/EncoderExceptionFallback.xml
-M en/System.Text/EncoderReplacementFallback.xml
-M en/System.Text/Encoder.xml
-M en/System.Text/DecoderFallbackBuffer.xml
-M en/System.Runtime.Remoting.Metadata/SoapAttribute.xml
-M en/System.Runtime.Remoting.Metadata/SoapMethodAttribute.xml
-M en/System.Runtime.Remoting.Metadata/SoapParameterAttribute.xml
-M en/System.Runtime.Remoting.Metadata/SoapTypeAttribute.xml
-M en/System.Runtime.Remoting.Metadata/XmlFieldOrderOption.xml
-M en/System.Runtime.Remoting.Metadata/SoapFieldAttribute.xml
-M en/System.Runtime.Remoting.Metadata/SoapOption.xml
-M en/System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.xml
-M en/System.Security.Cryptography.X509Certificates/X509ContentType.xml
-M en/System.Security.Cryptography.X509Certificates/X509Certificate.xml
-M en/System.Runtime.Remoting.Proxies/ProxyAttribute.xml
-M en/System.Runtime.Remoting.Proxies/RealProxy.xml
-? en/System.IO.IsolatedStorage/IsolatedStorageSecurityState.xml
-? en/System.IO.IsolatedStorage/IsolatedStorageSecurityOptions.xml
-M en/System.IO.IsolatedStorage/IsolatedStorageScope.xml
-M en/System.IO.IsolatedStorage/IsolatedStorageFileStream.xml
-M en/System.IO.IsolatedStorage/IsolatedStorageException.xml
-M en/System.IO.IsolatedStorage/IsolatedStorage.xml
-M en/System.IO.IsolatedStorage/IsolatedStorageFile.xml
-M en/System.IO.IsolatedStorage/INormalizeForIsolatedStorage.xml
-? en/System.Runtime.CompilerServices/ConditionalWeakTable`2.xml
-? en/System.Runtime.CompilerServices/ReferenceAssemblyAttribute.xml
-? en/System.Runtime.CompilerServices/TypeForwardedFromAttribute.xml
-? en/System.Runtime.CompilerServices/ConditionalWeakTable`2+CreateValueCallback.xml
-M en/System.Runtime.CompilerServices/DiscardableAttribute.xml
-M en/System.Runtime.CompilerServices/IsConst.xml
-M en/System.Runtime.CompilerServices/IndexerNameAttribute.xml
-M en/System.Runtime.CompilerServices/RuntimeWrappedException.xml
-M en/System.Runtime.CompilerServices/MethodImplAttribute.xml
-M en/System.Runtime.CompilerServices/CompilationRelaxations.xml
-M en/System.Runtime.CompilerServices/DateTimeConstantAttribute.xml
-M en/System.Runtime.CompilerServices/IsLong.xml
-M en/System.Runtime.CompilerServices/LoadHint.xml
-M en/System.Runtime.CompilerServices/IsByValue.xml
-M en/System.Runtime.CompilerServices/NativeCppClassAttribute.xml
-M en/System.Runtime.CompilerServices/InternalsVisibleToAttribute.xml
-M en/System.Runtime.CompilerServices/IUnknownConstantAttribute.xml
-M en/System.Runtime.CompilerServices/TypeForwardedToAttribute.xml
-M en/System.Runtime.CompilerServices/IsImplicitlyDereferenced.xml
-M en/System.Runtime.CompilerServices/DefaultDependencyAttribute.xml
-M en/System.Runtime.CompilerServices/CallConvStdcall.xml
-M en/System.Runtime.CompilerServices/CompilerGlobalScopeAttribute.xml
-M en/System.Runtime.CompilerServices/ScopelessEnumAttribute.xml
-M en/System.Runtime.CompilerServices/CallConvFastcall.xml
-M en/System.Runtime.CompilerServices/RuntimeHelpers+TryCode.xml
-M en/System.Runtime.CompilerServices/CompilationRelaxationsAttribute.xml
-M en/System.Runtime.CompilerServices/IsExplicitlyDereferenced.xml
-M en/System.Runtime.CompilerServices/MethodImplOptions.xml
-M en/System.Runtime.CompilerServices/CompilerMarshalOverride.xml
-M en/System.Runtime.CompilerServices/IsCopyConstructed.xml
-M en/System.Runtime.CompilerServices/RuntimeHelpers+CleanupCode.xml
-M en/System.Runtime.CompilerServices/StringFreezingAttribute.xml
-M en/System.Runtime.CompilerServices/CallConvThiscall.xml
-M en/System.Runtime.CompilerServices/FixedAddressValueTypeAttribute.xml
-M en/System.Runtime.CompilerServices/IsUdtReturn.xml
-M en/System.Runtime.CompilerServices/RequiredAttributeAttribute.xml
-M en/System.Runtime.CompilerServices/CallConvCdecl.xml
-M en/System.Runtime.CompilerServices/DecimalConstantAttribute.xml
-M en/System.Runtime.CompilerServices/IsBoxed.xml
-M en/System.Runtime.CompilerServices/IsSignUnspecifiedByte.xml
-M en/System.Runtime.CompilerServices/HasCopySemanticsAttribute.xml
-M en/System.Runtime.CompilerServices/RuntimeCompatibilityAttribute.xml
-M en/System.Runtime.CompilerServices/DependencyAttribute.xml
-M en/System.Runtime.CompilerServices/SuppressIldasmAttribute.xml
-M en/System.Runtime.CompilerServices/AccessedThroughPropertyAttribute.xml
-M en/System.Runtime.CompilerServices/UnsafeValueTypeAttribute.xml
-M en/System.Runtime.CompilerServices/IsJitIntrinsic.xml
-M en/System.Runtime.CompilerServices/SpecialNameAttribute.xml
-M en/System.Runtime.CompilerServices/IDispatchConstantAttribute.xml
-M en/System.Runtime.CompilerServices/RuntimeHelpers.xml
-M en/System.Runtime.CompilerServices/CustomConstantAttribute.xml
-M en/System.Runtime.CompilerServices/IsPinned.xml
-M en/System.Runtime.CompilerServices/IsVolatile.xml
-M en/System.Runtime.CompilerServices/FixedBufferAttribute.xml
-M en/System.Runtime.CompilerServices/CompilerGeneratedAttribute.xml
-M en/System.Runtime.CompilerServices/MethodCodeType.xml
-? en/System.Security.Cryptography/Aes.xml
-M en/System.Security.Cryptography/MD5CryptoServiceProvider.xml
-M en/System.Security.Cryptography/RIPEMD160Managed.xml
-M en/System.Security.Cryptography/RC2.xml
-M en/System.Security.Cryptography/TripleDESCryptoServiceProvider.xml
-M en/System.Security.Cryptography/RSAOAEPKeyExchangeFormatter.xml
-M en/System.Security.Cryptography/CryptographicException.xml
-M en/System.Security.Cryptography/HMACSHA384.xml
-M en/System.Security.Cryptography/KeySizes.xml
-M en/System.Security.Cryptography/DSA.xml
-M en/System.Security.Cryptography/PasswordDeriveBytes.xml
-M en/System.Security.Cryptography/MaskGenerationMethod.xml
-M en/System.Security.Cryptography/KeyedHashAlgorithm.xml
-M en/System.Security.Cryptography/RSA.xml
-M en/System.Security.Cryptography/ICryptoTransform.xml
-M en/System.Security.Cryptography/HMACSHA1.xml
-M en/System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.xml
-M en/System.Security.Cryptography/Rijndael.xml
-M en/System.Security.Cryptography/SHA1CryptoServiceProvider.xml
-M en/System.Security.Cryptography/HashAlgorithm.xml
-M en/System.Security.Cryptography/TripleDES.xml
-M en/System.Security.Cryptography/HMACSHA512.xml
-M en/System.Security.Cryptography/SHA1.xml
-M en/System.Security.Cryptography/RandomNumberGenerator.xml
-M en/System.Security.Cryptography/RSAPKCS1KeyExchangeDeformatter.xml
-M en/System.Security.Cryptography/RSAOAEPKeyExchangeDeformatter.xml
-M en/System.Security.Cryptography/CryptographicUnexpectedOperationException.xml
-M en/System.Security.Cryptography/FromBase64Transform.xml
-M en/System.Security.Cryptography/SignatureDescription.xml
-M en/System.Security.Cryptography/CryptoAPITransform.xml
-M en/System.Security.Cryptography/RIPEMD160.xml
-M en/System.Security.Cryptography/DESCryptoServiceProvider.xml
-M en/System.Security.Cryptography/SHA256.xml
-M en/System.Security.Cryptography/PKCS1MaskGenerationMethod.xml
-M en/System.Security.Cryptography/Rfc2898DeriveBytes.xml
-M en/System.Security.Cryptography/CspKeyContainerInfo.xml
-M en/System.Security.Cryptography/AsymmetricKeyExchangeFormatter.xml
-M en/System.Security.Cryptography/HMACMD5.xml
-M en/System.Security.Cryptography/SHA512Managed.xml
-M en/System.Security.Cryptography/RSACryptoServiceProvider.xml
-M en/System.Security.Cryptography/RNGCryptoServiceProvider.xml
-M en/System.Security.Cryptography/RC2CryptoServiceProvider.xml
-M en/System.Security.Cryptography/SymmetricAlgorithm.xml
-M en/System.Security.Cryptography/RSAPKCS1KeyExchangeFormatter.xml
-M en/System.Security.Cryptography/SHA384Managed.xml
-M en/System.Security.Cryptography/DSAParameters.xml
-M en/System.Security.Cryptography/CryptoStream.xml
-M en/System.Security.Cryptography/AsymmetricSignatureDeformatter.xml
-M en/System.Security.Cryptography/HMACRIPEMD160.xml
-M en/System.Security.Cryptography/RijndaelManagedTransform.xml
-M en/System.Security.Cryptography/KeyNumber.xml
-M en/System.Security.Cryptography/RijndaelManaged.xml
-M en/System.Security.Cryptography/RSAPKCS1SignatureDeformatter.xml
-M en/System.Security.Cryptography/HMAC.xml
-M en/System.Security.Cryptography/RSAParameters.xml
-M en/System.Security.Cryptography/CspParameters.xml
-M en/System.Security.Cryptography/FromBase64TransformMode.xml
-M en/System.Security.Cryptography/SHA1Managed.xml
-M en/System.Security.Cryptography/SHA384.xml
-M en/System.Security.Cryptography/PaddingMode.xml
-M en/System.Security.Cryptography/DES.xml
-M en/System.Security.Cryptography/CipherMode.xml
-M en/System.Security.Cryptography/AsymmetricSignatureFormatter.xml
-M en/System.Security.Cryptography/ToBase64Transform.xml
-M en/System.Security.Cryptography/AsymmetricAlgorithm.xml
-M en/System.Security.Cryptography/MD5.xml
-M en/System.Security.Cryptography/DeriveBytes.xml
-M en/System.Security.Cryptography/SHA256Managed.xml
-M en/System.Security.Cryptography/DSASignatureDeformatter.xml
-M en/System.Security.Cryptography/RSAPKCS1SignatureFormatter.xml
-M en/System.Security.Cryptography/CryptoStreamMode.xml
-M en/System.Security.Cryptography/HMACSHA256.xml
-M en/System.Security.Cryptography/ICspAsymmetricAlgorithm.xml
-M en/System.Security.Cryptography/SHA512.xml
-M en/System.Security.Cryptography/DSACryptoServiceProvider.xml
-M en/System.Security.Cryptography/CryptoConfig.xml
-M en/System.Security.Cryptography/MACTripleDES.xml
-M en/System.Security.Cryptography/CspProviderFlags.xml
-M en/System.Security.Cryptography/DSASignatureFormatter.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYear.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapQName.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNcName.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/ISoapXsd.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapAnyUri.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtoken.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntity.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDay.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapToken.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNegativeInteger.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapName.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonthDay.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapLanguage.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDuration.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdref.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapBase64Binary.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonNegativeInteger.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNotation.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDateTime.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapInteger.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtokens.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapTime.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYearMonth.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdrefs.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDate.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapPositiveInteger.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntities.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonth.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinary.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonPositiveInteger.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNormalizedString.xml
-M en/System.Runtime.Remoting.Metadata.W3cXsd2001/SoapId.xml
-M en/System.Runtime.Remoting.Lifetime/ClientSponsor.xml
-M en/System.Runtime.Remoting.Lifetime/ILease.xml
-M en/System.Runtime.Remoting.Lifetime/LifetimeServices.xml
-M en/System.Runtime.Remoting.Lifetime/LeaseState.xml
-M en/System.Runtime.Remoting.Lifetime/ISponsor.xml
-M en/System.Security.Policy/PublisherMembershipCondition.xml
-M en/System.Security.Policy/ApplicationTrustCollection.xml
-M en/System.Security.Policy/Evidence.xml
-M en/System.Security.Policy/Hash.xml
-M en/System.Security.Policy/PolicyStatement.xml
-M en/System.Security.Policy/UrlMembershipCondition.xml
-M en/System.Security.Policy/ApplicationSecurityManager.xml
-M en/System.Security.Policy/ApplicationVersionMatch.xml
-M en/System.Security.Policy/SiteMembershipCondition.xml
-M en/System.Security.Policy/CodeGroup.xml
-M en/System.Security.Policy/FileCodeGroup.xml
-M en/System.Security.Policy/ApplicationDirectory.xml
-M en/System.Security.Policy/ZoneMembershipCondition.xml
-M en/System.Security.Policy/UnionCodeGroup.xml
-M en/System.Security.Policy/Url.xml
-M en/System.Security.Policy/Site.xml
-M en/System.Security.Policy/ApplicationTrust.xml
-M en/System.Security.Policy/HashMembershipCondition.xml
-M en/System.Security.Policy/CodeConnectAccess.xml
-M en/System.Security.Policy/ApplicationSecurityInfo.xml
-M en/System.Security.Policy/ApplicationTrustEnumerator.xml
-M en/System.Security.Policy/PolicyStatementAttribute.xml
-M en/System.Security.Policy/IApplicationTrustManager.xml
-M en/System.Security.Policy/IMembershipCondition.xml
-M en/System.Security.Policy/FirstMatchCodeGroup.xml
-M en/System.Security.Policy/StrongName.xml
-M en/System.Security.Policy/PolicyException.xml
-M en/System.Security.Policy/TrustManagerUIContext.xml
-M en/System.Security.Policy/TrustManagerContext.xml
-M en/System.Security.Policy/PolicyLevel.xml
-M en/System.Security.Policy/GacInstalled.xml
-M en/System.Security.Policy/AllMembershipCondition.xml
-M en/System.Security.Policy/Publisher.xml
-M en/System.Security.Policy/NetCodeGroup.xml
-M en/System.Security.Policy/StrongNameMembershipCondition.xml
-M en/System.Security.Policy/IIdentityPermissionFactory.xml
-M en/System.Security.Policy/PermissionRequestEvidence.xml
-M en/System.Security.Policy/ApplicationDirectoryMembershipCondition.xml
-M en/System.Security.Policy/Zone.xml
-M en/System.Security.Policy/GacMembershipCondition.xml
-M en/System.Runtime.Remoting/ObjectHandle.xml
-M en/System.Runtime.Remoting/ServerException.xml
-M en/System.Runtime.Remoting/InternalRemotingServices.xml
-M en/System.Runtime.Remoting/IEnvoyInfo.xml
-M en/System.Runtime.Remoting/WellKnownServiceTypeEntry.xml
-M en/System.Runtime.Remoting/ActivatedClientTypeEntry.xml
-M en/System.Runtime.Remoting/RemotingServices.xml
-M en/System.Runtime.Remoting/IObjectHandle.xml
-M en/System.Runtime.Remoting/IChannelInfo.xml
-M en/System.Runtime.Remoting/CustomErrorsModes.xml
-M en/System.Runtime.Remoting/RemotingException.xml
-M en/System.Runtime.Remoting/TypeEntry.xml
-M en/System.Runtime.Remoting/WellKnownClientTypeEntry.xml
-M en/System.Runtime.Remoting/SoapServices.xml
-M en/System.Runtime.Remoting/ObjRef.xml
-M en/System.Runtime.Remoting/ActivatedServiceTypeEntry.xml
-M en/System.Runtime.Remoting/RemotingTimeoutException.xml
-M en/System.Runtime.Remoting/IRemotingTypeInfo.xml
-M en/System.Runtime.Remoting/RemotingConfiguration.xml
-M en/System.Runtime.Remoting/WellKnownObjectMode.xml
-? en/System.IO/UnmanagedMemoryAccessor.xml
-M en/System.IO/DirectoryInfo.xml
-M en/System.IO/MemoryStream.xml
-M en/System.IO/FileMode.xml
-M en/System.IO/DriveInfo.xml
-M en/System.IO/IOException.xml
-M en/System.IO/FileAttributes.xml
-M en/System.IO/StringReader.xml
-M en/System.IO/Stream.xml
-M en/System.IO/FileStream.xml
-M en/System.IO/FileInfo.xml
-M en/System.IO/SearchOption.xml
-M en/System.IO/DirectoryNotFoundException.xml
-M en/System.IO/FileAccess.xml
-M en/System.IO/FileShare.xml
-M en/System.IO/StringWriter.xml
-M en/System.IO/Directory.xml
-M en/System.IO/BinaryReader.xml
-M en/System.IO/TextReader.xml
-M en/System.IO/StreamReader.xml
-M en/System.IO/File.xml
-M en/System.IO/BinaryWriter.xml
-M en/System.IO/TextWriter.xml
-M en/System.IO/EndOfStreamException.xml
-M en/System.IO/StreamWriter.xml
-M en/System.IO/FileOptions.xml
-M en/System.IO/Path.xml
-M en/System.IO/BufferedStream.xml
-M en/System.IO/FileLoadException.xml
-M en/System.IO/SeekOrigin.xml
-M en/System.IO/FileSystemInfo.xml
-M en/System.IO/UnmanagedMemoryStream.xml
-M en/System.IO/DriveNotFoundException.xml
-M en/System.IO/FileNotFoundException.xml
-M en/System.IO/DriveType.xml
-M en/System.IO/PathTooLongException.xml
-? en/System.Runtime/AssemblyTargetedPatchBandAttribute.xml
-? en/System.Runtime/TargetedPatchingOptOutAttribute.xml
-M en/System.Runtime/GCSettings.xml
-M en/System.Runtime/GCLatencyMode.xml
-M en/System.Runtime/MemoryFailPoint.xml
-? en/Microsoft.Win32/RegistryView.xml
-? en/Microsoft.Win32/RegistryOptions.xml
-M en/Microsoft.Win32/RegistryKey.xml
-M en/Microsoft.Win32/RegistryValueOptions.xml
-M en/Microsoft.Win32/RegistryHive.xml
-M en/Microsoft.Win32/Registry.xml
-M en/Microsoft.Win32/RegistryKeyPermissionCheck.xml
-M en/Microsoft.Win32/RegistryValueKind.xml
-M en/System.Runtime.Serialization.Formatters/ISoapMessage.xml
-M en/System.Runtime.Serialization.Formatters/ServerFault.xml
-M en/System.Runtime.Serialization.Formatters/InternalST.xml
-M en/System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.xml
-M en/System.Runtime.Serialization.Formatters/FormatterTypeStyle.xml
-M en/System.Runtime.Serialization.Formatters/SoapMessage.xml
-M en/System.Runtime.Serialization.Formatters/IFieldInfo.xml
-M en/System.Runtime.Serialization.Formatters/InternalRM.xml
-M en/System.Runtime.Serialization.Formatters/SoapFault.xml
-M en/System.Runtime.Serialization.Formatters/TypeFilterLevel.xml
-M en/System.Runtime.Remoting.Services/EnterpriseServicesHelper.xml
-M en/System.Runtime.Remoting.Services/TrackingServices.xml
-M en/System.Runtime.Remoting.Services/ITrackingHandler.xml
-M en/System.Reflection/Pointer.xml
-M en/System.Reflection/MemberInfo.xml
-M en/System.Reflection/TypeFilter.xml
-M en/System.Reflection/EventAttributes.xml
-M en/System.Reflection/IReflect.xml
-M en/System.Reflection/FieldInfo.xml
-M en/System.Reflection/CallingConventions.xml
-M en/System.Reflection/ObfuscationAttribute.xml
-M en/System.Reflection/AssemblyTitleAttribute.xml
-M en/System.Reflection/MethodImplAttributes.xml
-M en/System.Reflection/MethodBase.xml
-M en/System.Reflection/AssemblyKeyFileAttribute.xml
-M en/System.Reflection/MemberFilter.xml
-M en/System.Reflection/AssemblyName.xml
-M en/System.Reflection/AssemblyFlagsAttribute.xml
-M en/System.Reflection/GenericParameterAttributes.xml
-M en/System.Reflection/Module.xml
-M en/System.Reflection/ParameterAttributes.xml
-M en/System.Reflection/AssemblyAlgorithmIdAttribute.xml
-M en/System.Reflection/BindingFlags.xml
-M en/System.Reflection/TypeAttributes.xml
-M en/System.Reflection/PropertyAttributes.xml
-M en/System.Reflection/ParameterInfo.xml
-M en/System.Reflection/AssemblyCopyrightAttribute.xml
-M en/System.Reflection/ResourceAttributes.xml
-M en/System.Reflection/TargetInvocationException.xml
-M en/System.Reflection/DefaultMemberAttribute.xml
-M en/System.Reflection/PropertyInfo.xml
-M en/System.Reflection/ConstructorInfo.xml
-M en/System.Reflection/PortableExecutableKinds.xml
-M en/System.Reflection/AssemblyDelaySignAttribute.xml
-M en/System.Reflection/AssemblyCultureAttribute.xml
-M en/System.Reflection/Missing.xml
-M en/System.Reflection/ReflectionTypeLoadException.xml
-M en/System.Reflection/LocalVariableInfo.xml
-M en/System.Reflection/InterfaceMapping.xml
-M en/System.Reflection/ResourceLocation.xml
-M en/System.Reflection/AssemblyDefaultAliasAttribute.xml
-M en/System.Reflection/ModuleResolveEventHandler.xml
-M en/System.Reflection/CustomAttributeFormatException.xml
-M en/System.Reflection/AmbiguousMatchException.xml
-M en/System.Reflection/CustomAttributeData.xml
-M en/System.Reflection/FieldAttributes.xml
-M en/System.Reflection/AssemblyCompanyAttribute.xml
-M en/System.Reflection/AssemblyInformationalVersionAttribute.xml
-M en/System.Reflection/EventInfo.xml
-M en/System.Reflection/AssemblyNameFlags.xml
-M en/System.Reflection/MethodBody.xml
-M en/System.Reflection/InvalidFilterCriteriaException.xml
-M en/System.Reflection/AssemblyTrademarkAttribute.xml
-M en/System.Reflection/ObfuscateAssemblyAttribute.xml
-M en/System.Reflection/StrongNameKeyPair.xml
-M en/System.Reflection/Binder.xml
-M en/System.Reflection/AssemblyProductAttribute.xml
-M en/System.Reflection/CustomAttributeTypedArgument.xml
-M en/System.Reflection/TypeDelegator.xml
-M en/System.Reflection/ExceptionHandlingClauseOptions.xml
-M en/System.Reflection/AssemblyKeyNameAttribute.xml
-M en/System.Reflection/TargetParameterCountException.xml
-M en/System.Reflection/ProcessorArchitecture.xml
-M en/System.Reflection/ICustomAttributeProvider.xml
-M en/System.Reflection/AssemblyNameProxy.xml
-M en/System.Reflection/MethodAttributes.xml
-M en/System.Reflection/ManifestResourceInfo.xml
-M en/System.Reflection/AssemblyConfigurationAttribute.xml
-M en/System.Reflection/MethodInfo.xml
-M en/System.Reflection/MemberTypes.xml
-M en/System.Reflection/ParameterModifier.xml
-M en/System.Reflection/ExceptionHandlingClause.xml
-M en/System.Reflection/TargetException.xml
-M en/System.Reflection/CustomAttributeNamedArgument.xml
-M en/System.Reflection/ImageFileMachine.xml
-M en/System.Reflection/AssemblyDescriptionAttribute.xml
-M en/System.Reflection/AssemblyFileVersionAttribute.xml
-M en/System.Reflection/AssemblyVersionAttribute.xml
-M en/System.Reflection/Assembly.xml
unsafe String ReplaceInternal (char oldChar, char newChar)
{
-#if !BOOTSTRAP_BASIC
if (this.m_stringLength == 0 || oldChar == newChar)
return this;
-#endif
+
int start_pos = IndexOfUnchecked (oldChar, 0, this.m_stringLength);
-#if !BOOTSTRAP_BASIC
if (start_pos == -1)
return this;
-#endif
+
if (start_pos < 4)
start_pos = 0;
throw new ArgumentException ("oldValue is the empty string.");
if (this.Length == 0)
-#if BOOTSTRAP_BASIC
- throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
return this;
-#endif
+
if (newValue == null)
newValue = Empty;
private unsafe String ReplaceUnchecked (String oldValue, String newValue)
{
if (oldValue.m_stringLength > m_stringLength)
-#if BOOTSTRAP_BASIC
- throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
return this;
-#endif
if (oldValue.m_stringLength == 1 && newValue.m_stringLength == 1) {
return Replace (oldValue[0], newValue[0]);
i = found + oldValue.m_stringLength;
}
if (count == 0)
-#if BOOTSTRAP_BASIC
- throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
- return this;
-#endif
+ return this;
+
int nlen = 0;
checked {
try {
if (totalWidth < 0)
throw new ArgumentOutOfRangeException ("totalWidth", "Non-negative number required");
if (totalWidth <= m_stringLength)
-#if BOOTSTRAP_BASIC
- throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
return this;
-#endif
+
string result = FastAllocateString (totalWidth);
fixed (char *dest = result, src = &m_firstChar) {
internal bool StartsWithOrdinalUnchecked (String value)
{
-#if BOOTSTRAP_BASIC
- throw new NotImplementedException ("BOOTSTRAP_BASIC");
-#else
return m_stringLength >= value.m_stringLength && CompareOrdinalUnchecked (this, 0, value.m_stringLength, value, 0, value.m_stringLength) == 0;
-#endif
}
internal unsafe bool IsAscii ()
+++ /dev/null
-//
-// EventSourceException.cs
-//
-// Authors:
-// Alexander Köplinger <alexander.koeplinger@xamarin.com>
-//
-// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-
-namespace System.Diagnostics.Tracing
-{
- public class EventSourceException : Exception
- {
- [MonoTODO]
- public EventSourceException ()
- {
- }
-
- [MonoTODO]
- public EventSourceException (string message)
- {
- }
-
- [MonoTODO]
- public EventSourceException (string message, Exception innerException)
- {
- }
- }
-}
using System.Security;
using System.Text;
using System.Runtime.InteropServices;
-
-#if !MOBILE
using System.Security.AccessControl;
-#endif
namespace System.IO
{
FileShare.None, bufferSize, options);
}
-#if !MOBILE
[MonoLimitation ("FileOptions and FileSecurity are ignored")]
public static FileStream Create (string path, int bufferSize,
FileOptions options,
return new FileStream (path, FileMode.Create, FileAccess.ReadWrite,
FileShare.None, bufferSize, options);
}
-#endif
public static StreamWriter CreateText (string path)
{
return MonoIO.ExistsFile (path, out error);
}
-#if !MOBILE
public static FileSecurity GetAccessControl (string path)
{
// AccessControlSections.Audit requires special permissions.
{
return new FileSecurity (path, includeSections);
}
-#endif
public static FileAttributes GetAttributes (string path)
{
}
}
-#if !MOBILE
public static void SetAccessControl (string path,
FileSecurity fileSecurity)
{
fileSecurity.PersistModifications (path);
}
-#endif
public static void SetAttributes (string path,
FileAttributes fileAttributes)
using System.Runtime.InteropServices;
using System.Runtime.Remoting.Messaging;
using System.Security;
+using System.Security.AccessControl;
using System.Security.Permissions;
using System.Threading;
-using Microsoft.Win32.SafeHandles;
-
-#if MOBILE
-using System.IO.IsolatedStorage;
-#else
-using System.Security.AccessControl;
-#endif
-
using System.Threading.Tasks;
+using Microsoft.Win32.SafeHandles;
namespace System.IO
{
Init (handle, access, false, bufferSize, isAsync, false);
}
-#if !MOBILE
[MonoLimitation ("This ignores the rights parameter")]
public FileStream (string path, FileMode mode,
FileSystemRights rights, FileShare share,
: this (path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), share, bufferSize, false, options)
{
}
-#endif
internal FileStream (string path, FileMode mode, FileAccess access, FileShare share, int bufferSize, FileOptions options, string msgPath, bool bFromProxy, bool useLongPath = false, bool checkHost = false)
: this (path, mode, access, share, bufferSize, false, options)
throw exc;
}
-#if !MOBILE
public FileSecurity GetAccessControl ()
{
if (safeHandle.IsClosed)
fileSecurity.PersistModifications (SafeFileHandle);
}
-#endif
public override Task FlushAsync (CancellationToken cancellationToken)
{
return null;
}
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Type create_modified_type (TypeBuilder tb, string modifiers);
-
private TypeBuilder GetMaybeNested (TypeBuilder t, IEnumerable<TypeName> nested) {
TypeBuilder result = t;
if ((result == null) && throwOnError)
throw new TypeLoadException (className);
if (result != null && (ts.HasModifiers || ts.IsByRef)) {
- string modifiers = ts.ModifierString ();
- Type mt = create_modified_type (result, modifiers);
+ Type mt = result;
+ if (result is TypeBuilder) {
+ var tb = result as TypeBuilder;
+ if (tb.is_created)
+ mt = tb.CreateType ();
+ }
+ foreach (var mod in ts.Modifiers) {
+ if (mod is PointerSpec)
+ mt = mt.MakePointerType ();
+ else if (mod is ArraySpec) {
+ var spec = mod as ArraySpec;
+ if (spec.IsBound)
+ return null;
+ if (spec.Rank == 1)
+ mt = mt.MakeArrayType ();
+ else
+ mt = mt.MakeArrayType (spec.Rank);
+ }
+ }
+ if (ts.IsByRef)
+ mt = mt.MakeByRefType ();
result = mt as TypeBuilder;
if (result == null)
return mt;
[ClassInterface(ClassInterfaceType.None)]
[StructLayout (LayoutKind.Sequential)]
#if MOBILE
- public partial class Assembly : ICustomAttributeProvider {
+ public partial class Assembly : ICustomAttributeProvider, ISerializable
#else
- public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable {
+ public abstract class Assembly : ICustomAttributeProvider, _Assembly, IEvidenceFactory, ISerializable
#endif
- internal class ResolveEventHolder {
+ {
+ internal class ResolveEventHolder {
#pragma warning disable 67
public event ModuleResolveEventHandler ModuleResolve;
#pragma warning restore
// We can't store the event directly in this class, since the
// compiler would silently insert the fields before _mono_assembly
//
- public event ModuleResolveEventHandler ModuleResolve {
+ public virtual event ModuleResolveEventHandler ModuleResolve {
[SecurityPermission (SecurityAction.LinkDemand, ControlAppDomain = true)]
add {
resolve_event_holder.ModuleResolve += value;
public virtual PermissionSet PermissionSet {
get { return this.GrantedPermissionSet; }
}
-
+#endif
+
public virtual SecurityRuleSet SecurityRuleSet {
get { throw CreateNIE (); }
}
-#endif
-
static Exception CreateNIE ()
{
return new NotImplementedException ("Derived classes must implement it");
+++ /dev/null
-//
-// System.Reflection.TargetException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Globalization;
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
- [ComVisible (true)]
- [Serializable]
-#if MOBILE
- public class TargetException : Exception {
-#else
- public class TargetException : ApplicationException {
-#endif
- public TargetException ()
- : base (Locale.GetText ("Unable to invoke an invalid target."))
- {
- }
-
- public TargetException (string message)
- : base (message)
- {
- }
-
- public TargetException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- protected TargetException (SerializationInfo info, StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Reflection.TargetInvocationException
-//
-// Sean MacIsaac (macisaac@ximian.com)
-// Duncan Mak (duncan@ximian.com)
-//
-// (C) 2001 Ximian, Inc.
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
- [ComVisible (true)]
- [Serializable]
-#if MOBILE
- public sealed class TargetInvocationException : Exception {
-#else
- public sealed class TargetInvocationException : ApplicationException {
-#endif
- public TargetInvocationException (Exception inner)
- : base ("Exception has been thrown by the target of an invocation.", inner)
- {
- }
-
- public TargetInvocationException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- internal TargetInvocationException (SerializationInfo info, StreamingContext sc)
- : base (info, sc)
- {
- }
- }
-}
+++ /dev/null
-//
-// System.Reflection.TargetParameterCountException.cs
-//
-// Author: Duncan Mak (duncan@ximian.com)
-//
-// (C) Ximian, Inc. http://www.ximian.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System.Runtime.Serialization;
-using System.Globalization;
-using System.Runtime.InteropServices;
-
-namespace System.Reflection
-{
- [ComVisible (true)]
- [Serializable]
-#if MOBILE
- public sealed class TargetParameterCountException : Exception {
-#else
- public sealed class TargetParameterCountException : ApplicationException {
-#endif
- public TargetParameterCountException ()
- : base (Locale.GetText ("Number of parameter does not match expected count."))
- {
- }
-
- public TargetParameterCountException (string message)
- : base (message)
- {
- }
-
- public TargetParameterCountException (string message, Exception inner)
- : base (message, inner)
- {
- }
-
- internal TargetParameterCountException (SerializationInfo info,
- StreamingContext context)
- : base (info, context)
- {
- }
- }
-}
Batch = 0,
Interactive = 1,
LowLatency = 2,
- SustainedLowLatency = 3
+ SustainedLowLatency = 3,
+ NoGCRegion = 4
}
}
{
SetAuditRule((AuditRule)rule);
}
+
+ internal void Persist (SafeHandle handle)
+ {
+ PersistModifications (handle);
+ }
}
}
{
Persist (name, includeSections, null);
}
-
- internal void Persist (SafeHandle handle)
- {
- PersistModifications (handle);
- }
-
+
internal void PersistModifications (SafeHandle handle)
{
WriteLock();
SetAuditRule((AuditRule)rule);
}
- protected new void Persist (SafeHandle handle)
+ protected void Persist (SafeHandle handle)
{
WriteLock ();
try {
private IntPtr thread_pinning_ref;
private IntPtr abort_protected_block_count;
private int priority = (int) ThreadPriority.Normal;
+ private IntPtr owned_mutex;
/*
* These fields are used to avoid having to increment corlib versions
* when a new field is added to the unmanaged MonoThread structure.
{
throw new PlatformNotSupportedException ("Thread.ResetAbort is not supported on the current platform.");
}
+
+ internal object AbortReason {
+ get {
+ throw new PlatformNotSupportedException ("Thread.ResetAbort is not supported on the current platform.");
+ }
+ }
#endif // MONO_FEATURE_THREAD_ABORT
[MethodImplAttribute (MethodImplOptions.InternalCall)]
throw new PlatformNotSupportedException ("Thread.Resume is not supported on the current platform.");
}
#endif
+
+ public void DisableComObjectEagerCleanup ()
+ {
+ throw new PlatformNotSupportedException ();
+ }
}
}
* of icalls, do not require an increment.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 156;
+ private const int mono_corlib_version = 157;
#pragma warning restore 169
[ComVisible (true)]
return trace.ToString ();
}
}
-#if !MOBILE
+
/// <summary>
/// Get a fully qualified path to the system directory
/// </summary>
return GetFolderPath (SpecialFolder.System);
}
}
-#endif
+
/// <summary>
/// Get the number of milliseconds that have elapsed since the system was booted
/// </summary>
case 'O': // logical
int second = stack.Pop().Int32; // it's a stack... the second value was pushed last
int first = stack.Pop().Int32;
- char c = format[pos];
- stack.Push(
- c == '+' ? (first + second) :
- c == '-' ? (first - second) :
- c == '*' ? (first * second) :
- c == '/' ? (first / second) :
- c == 'm' ? (first % second) :
- c == '^' ? (first ^ second) :
- c == '&' ? (first & second) :
- c == '|' ? (first | second) :
- c == '=' ? AsInt(first == second) :
- c == '>' ? AsInt(first > second) :
- c == '<' ? AsInt(first < second) :
- c == 'A' ? AsInt(AsBool(first) && AsBool(second)) :
- c == 'O' ? AsInt(AsBool(first) || AsBool(second)) :
- 0); // not possible; we just validated above
+ int res;
+ switch (format[pos]) {
+ case '+':
+ res = first + second;
+ break;
+ case '-':
+ res = first - second;
+ break;
+ case '*':
+ res = first * second;
+ break;
+ case '/':
+ res = first / second;
+ break;
+ case 'm':
+ res = first % second;
+ break;
+ case '^':
+ res = first ^ second;
+ break;
+ case '&':
+ res = first & second;
+ break;
+ case '|':
+ res = first | second;
+ break;
+ case '=':
+ res = AsInt(first == second);
+ break;
+ case '>':
+ res = AsInt(first > second);
+ break;
+ case '<':
+ res = AsInt(first < second);
+ break;
+ case 'A':
+ res = AsInt(AsBool(first) && AsBool(second));
+ break;
+ case 'O':
+ res = AsInt(AsBool(first) || AsBool(second));
+ break;
+ default:
+ res = 0;
+ break;
+ }
+ stack.Push(res);
break;
// Unary operations
{
return Append (new Text.StringBuilder ()).ToString ();
}
+
+ public int Rank {
+ get {
+ return dimensions;
+ }
+ }
+
+ public bool IsBound {
+ get {
+ return bound;
+ }
+ }
}
internal class PointerSpec : ModifierSpec
// ArgumentNullException should not occur.
module.GetConstructorToken (method, null);
}
+
+ [Test]
+ public void GetType ()
+ {
+ AssemblyBuilder ab = genAssembly ();
+ ModuleBuilder module = ab.DefineDynamicModule ("foo.dll", "foo.dll", true);
+ TypeBuilder tb = module.DefineType ("t1", TypeAttributes.Public);
+
+ Assert.AreEqual ("t1[]", module.GetType ("t1[]").FullName);
+ Assert.AreEqual ("t1*", module.GetType ("t1*").FullName);
+ Assert.AreEqual ("t1&", module.GetType ("t1&").FullName);
+ Assert.AreEqual ("t1[]&", module.GetType ("t1[]&").FullName);
+ }
}
}
[Test]
+ // Casts don't work with unfinished types
+ [Category ("NotWorking")]
[Category ("NotDotNet")]
public void IsAssignableFrom_NotCreated_Array ()
{
--- /dev/null
+//
+// GCTest.cs - NUnit Test Cases for GC
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Threading.Tasks;
+
+using NUnit.Framework;
+
+namespace MonoTests.System {
+
+ [TestFixture]
+ public class GCTest {
+
+ class MyFinalizeObject
+ {
+ public volatile static int finalized;
+
+ ~MyFinalizeObject ()
+ {
+ if (finalized++ == 0) {
+ GC.ReRegisterForFinalize (this);
+ }
+ }
+ }
+
+ static void Run_ReRegisterForFinalizeTest ()
+ {
+ var m = new WeakReference<MyFinalizeObject> (new MyFinalizeObject ());
+ m.SetTarget (null);
+ }
+
+ [Test]
+ public void ReRegisterForFinalizeTest ()
+ {
+ Run_ReRegisterForFinalizeTest ();
+ var t = Task.Factory.StartNew (() => {
+ do {
+ GC.Collect ();
+ GC.WaitForPendingFinalizers ();
+ Task.Yield ();
+ } while (MyFinalizeObject.finalized != 2);
+ });
+
+ Assert.IsTrue (t.Wait (5000));
+ }
+ }
+}
\ No newline at end of file
System.Diagnostics.Tracing/EventFieldTags.cs
System.Diagnostics.Tracing/EventIgnoreAttribute.cs
System.Diagnostics.Tracing/EventManifestOptions.cs
-System.Diagnostics.Tracing/EventSourceException.cs
System.Diagnostics.SymbolStore/ISymbolBinder.cs
System.Diagnostics.SymbolStore/ISymbolBinder1.cs
System.Diagnostics.SymbolStore/ISymbolDocument.cs
System.Reflection/PropertyInfo.cs
System.Reflection/ReflectionTypeLoadException.cs
System.Reflection/StrongNameKeyPair.cs
-System.Reflection/TargetException.cs
-System.Reflection/TargetInvocationException.cs
-System.Reflection/TargetParameterCountException.cs
System.Reflection.Emit/AssemblyBuilder.cs
System.Reflection.Emit/AssemblyBuilderAccess.cs
System.Reflection.Emit/ConstructorBuilder.cs
../referencesource/mscorlib/system/diagnostics/contracts/contractsbcl.cs
../referencesource/mscorlib/system/diagnostics/eventing/eventactivityoptions.cs
+../referencesource/mscorlib/system/diagnostics/eventing/eventsourceexception.cs
../referencesource/mscorlib/system/diagnostics/eventing/winmeta.cs
../referencesource/mscorlib/system/diagnostics/eventing/TraceLogging/EventSourceOptions.cs
../referencesource/mscorlib/system/reflection/reflectioncontext.cs
../referencesource/mscorlib/system/reflection/resourceattributes.cs
../referencesource/mscorlib/system/reflection/RuntimeReflectionExtensions.cs
+../referencesource/mscorlib/system/reflection/targetexception.cs
+../referencesource/mscorlib/system/reflection/targetinvocationexception.cs
+../referencesource/mscorlib/system/reflection/targetparametercountexception.cs
../referencesource/mscorlib/system/reflection/typeattributes.cs
../referencesource/mscorlib/system/reflection/typedelegator.cs
../referencesource/mscorlib/system/reflection/typefilter.cs
../referencesource/mscorlib/system/runtime/compilerservices/FormattableStringFactory.cs
../referencesource/mscorlib/system/runtime/compilerservices/hascopysemanticsattribute.cs
../referencesource/mscorlib/system/runtime/compilerservices/IAsyncStateMachine.cs
+../referencesource/mscorlib/system/runtime/compilerservices/idispatchconstantattribute.cs
../referencesource/mscorlib/system/runtime/compilerservices/indexernameattribute.cs
../referencesource/mscorlib/system/runtime/compilerservices/INotifyCompletion.cs
../referencesource/mscorlib/system/runtime/compilerservices/internalsvisibletoattribute.cs
System/CharEnumeratorTest.cs
System/CharTest.cs
System/DelegateTest.cs
+System/GCTest.cs
System/ModuleHandleTest.cs
System/NullableTest.cs
System/ObsoleteAttributeTest.cs
+++ /dev/null
-#include corlib.dll.sources
-../referencesource/mscorlib/system/runtime/compilerservices/idispatchconstantattribute.cs
public static DebugInfoGenerator CreatePdbGenerator() {
return new SymbolDocumentGenerator();
}
+#else
+ public static DebugInfoGenerator CreatePdbGenerator() {
+ throw new PlatformNotSupportedException();
+ }
#endif
/// <summary>
/// Marks a sequence point.
private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TLeftKey> m_leftSource; // Left data source.
private QueryOperatorEnumerator<Pair<TInputOutput, NoKeyMemoizationRequired>, TRightKey> m_rightSource; // Right data source.
+#if !MONO
private readonly int m_partitionIndex; // The current partition.
+#endif
private Set<TInputOutput> m_hashLookup; // The hash lookup, used to produce the union.
private CancellationToken m_cancellationToken;
private Shared<int> m_outputLoopCount;
m_leftSource = leftSource;
m_rightSource = rightSource;
+#if !MONO
m_partitionIndex = partitionIndex;
+#endif
m_comparer = comparer;
m_cancellationToken = cancellationToken;
}
/// <typeparam name="TSource"></typeparam>
internal sealed class OrderingQueryOperator<TSource> : QueryOperator<TSource>
{
+#if !MONO
// Turns on order (AsOrdered) or turns off order (AsUnordered)
private bool m_orderOn;
+#endif
private QueryOperator<TSource> m_child;
private OrdinalIndexState m_ordinalIndexState;
{
m_child = child;
m_ordinalIndexState = m_child.OrdinalIndexState;
+#if !MONO
m_orderOn = orderOn;
+#endif
}
internal override QueryResults<TSource> Open(QuerySettings settings, bool preferStriping)
class ConcatQueryOperatorResults : BinaryQueryOperatorResults
{
+#if !MONO
ConcatQueryOperator<TSource> m_concatOp; // Operator that generated the results
+#endif
int m_leftChildCount; // The number of elements in the left child result set
int m_rightChildCount; // The number of elements in the right child result set
bool preferStriping)
: base(leftChildQueryResults, rightChildQueryResults, concatOp, settings, preferStriping)
{
+#if !MONO
m_concatOp = concatOp;
+#endif
Contract.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible);
m_leftChildCount = leftChildQueryResults.ElementsCount;
protected QueryResults<TInputOutput> m_childQueryResults; // Results of the child query
private SortQueryOperator<TInputOutput, TSortKey> m_op; // Operator that generated these results
private QuerySettings m_settings; // Settings collected from the query
+#if !MONO
private bool m_preferStriping; // If the results are indexible, should we use striping when partitioning them
+#endif
internal SortQueryOperatorResults(
QueryResults<TInputOutput> childQueryResults, SortQueryOperator<TInputOutput, TSortKey> op,
m_childQueryResults = childQueryResults;
m_op = op;
m_settings = settings;
+#if !MONO
m_preferStriping = preferStriping;
+#endif
}
internal override bool IsIndexible
class OrderPreservingPipeliningSpoolingTask<TOutput, TKey> : SpoolingTaskBase
{
private readonly QueryTaskGroupState m_taskGroupState; // State shared among tasks.
+#if !MONO
private readonly TaskScheduler m_taskScheduler; // The task manager to execute the query.
+#endif
private readonly QueryOperatorEnumerator<TOutput, TKey> m_partition; // The source partition.
private readonly bool[] m_consumerWaiting; // Whether a consumer is waiting on a particular producer
private readonly bool[] m_producerWaiting; // Whether a particular producer is waiting on the consumer
m_partitionIndex = partitionIndex;
m_buffers = buffers;
m_bufferLock = bufferLock;
+#if !MONO
m_taskScheduler = taskScheduler;
+#endif
m_autoBuffered = autoBuffered;
}
Contract.Assert(sharedkeys != null);
Contract.Assert(sharedValues != null);
Contract.Assert(sharedBarriers != null);
+#if !MONO
Contract.Assert(groupState.CancellationState.MergedCancellationToken != null);
+#endif
Contract.Assert(sharedIndices.Length <= sharedkeys.Length);
Contract.Assert(sharedIndices.Length == sharedValues.Length);
Contract.Assert(sharedIndices.Length == sharedBarriers.GetLength(1));
+#if !MONO
Contract.Assert(groupState.CancellationState.MergedCancellationToken != null);
+#endif
m_source = source;
m_partitionCount = partitionCount;
object IQueryProvider.Execute(Expression expression){
if (expression == null)
throw Error.ArgumentNull("expression");
+#if !MONO
Type execType = typeof(EnumerableExecutor<>).MakeGenericType(expression.Type);
+#endif
return EnumerableExecutor.Create(expression).ExecuteBoxed();
}
// check for args changed
if (obj != m.Object || args != m.Arguments) {
+#if !MONO
Expression[] argArray = args.ToArray();
+#endif
Type[] typeArgs = (m.Method.IsGenericMethod) ? m.Method.GetGenericArguments() : null;
if ((m.Method.IsStatic || m.Method.DeclaringType.IsAssignableFrom(obj.Type))
nodes[i].WriteTo(xmlWriter);
}
-#if !MOBILE
internal static string AddDefaultSchemaMethodName = "AddDefaultSchema";
public static void AddDefaultSchema(XmlSchemaSet schemas, XmlQualifiedName typeQName)
{
throw System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("typeQName");
SchemaExporter.AddDefaultXmlType(schemas, typeQName.Name, typeQName.Namespace);
}
-#endif
}
}
// </copyright>
//------------------------------------------------------------------------------
+#if MONO
+#undef FEATURE_PAL
+#endif
+
namespace System.Net.Sockets {
using System.Collections;
using System.Collections.Generic;
/// interface.</para>
/// </devdoc>
-
- public class Socket : IDisposable
+ public partial class Socket : IDisposable
{
+#if !MONO
internal const int DefaultCloseTimeout = -1; // don't change for default, otherwise breaking change
// AcceptQueue - queued list of accept requests for BeginAccept or async Result for Begin Connect
//
// Overlapped constants.
//
-#if !FEATURE_PAL || CORIOLIS
+#if !(FEATURE_PAL && !MONO) || CORIOLIS
internal static volatile bool UseOverlappedIO;
#else
// Disable the I/O completion port for Rotor
internal static volatile bool UseOverlappedIO = true;
-#endif // !FEATURE_PAL || CORIOLIS
+#endif // !(FEATURE_PAL && !MONO) || CORIOLIS
private bool useOverlappedIO;
// Bool marked true if the native socket m_Handle was bound to the ThreadPool
#if !FEATURE_PAL // perfcounter
internal static volatile bool s_PerfCountersEnabled;
#endif
+#endif // !MONO
//************* constructors *************************
DualMode = true;
}
+#if !MONO
/// <devdoc>
/// <para>
/// Initializes a new instance of the <see cref='Sockets.Socket'/> class.
return m_RemoteEndPoint;
}
}
+#endif // !MONO
/// <devdoc>
/// <para>
/// </devdoc>
public IntPtr Handle {
get {
+#if !MONO
ExceptionHelper.UnmanagedPermission.Demand();
+#endif
return m_Handle.DangerousGetHandle();
}
}
+#if !MONO
internal SafeCloseSocket SafeHandle {
get {
return m_Handle;
willBlock = current;
}
}
+#endif // !MONO
public bool UseOnlyOverlappedIO{
get {
}
set {
-
+#if !MONO
if (m_BoundToThreadPool) {
throw new InvalidOperationException(SR.GetString(SR.net_io_completionportwasbound));
}
+#endif
useOverlappedIO = value;
}
}
-
+#if !MONO
/// <devdoc>
/// <para>
/// Gets the connection state of the Socket. This property will return the latest
return m_IsConnected;
}
}
+#endif // !MONO
/// <devdoc>
/// <para>
}
}
-
+#if !MONO
public bool IsBound{
get{
return (m_RightEndPoint != null);
}
}
-
+#endif // !MONO
public bool ExclusiveAddressUse{
get {
}
}
+#if !MONO
public bool NoDelay {
get {
return (int)GetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay) != 0 ? true : false;
SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, value ? 1 : 0);
}
}
+#endif // !MONO
public short Ttl{
get {
}
}
+#if !MONO
public bool MulticastLoopback{
get {
if (addressFamily == AddressFamily.InterNetwork) {
}
}
-
public bool EnableBroadcast{
get {
return (int)GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast) != 0 ? true : false;
SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, value ? 1 : 0);
}
}
-
+#endif // !MONO
+
public bool DualMode {
get {
if (AddressFamily != AddressFamily.InterNetworkV6) {
-
+#if !MONO
/// <devdoc>
/// <para>Associates a socket with an end point.</para>
/// </devdoc>
}
return socket;
}
-
+#endif // !MONO
/// <devdoc>
/// <para>Sends a data buffer to a connected socket.</para>
return bytesTransferred;
}
-
+#if !MONO
public int Send(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Send", "");
if (CleanedUp) {
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "Send", bytesTransferred);
return bytesTransferred;
}
-
-
+#endif // !MONO
/// <devdoc>
/// <para>Sends a file to
SendFile(fileName,null,null,TransmitFileOptions.UseDefaultWorkerThread);
}
-
-
+#if !MONO
/// <devdoc>
/// <para>Sends a file to
/// a connected socket.</para>
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "SendFile", errorCode);
return;
}
+#endif // !MONO
#endif // !FEATURE_PAL
return bytesTransferred;
}
-
-
+#if !MONO
public int Send(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Send", "");
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "SendTo", bytesTransferred);
return bytesTransferred;
}
+#endif // !MONO
/// <devdoc>
/// <para>Sends data to a specific end point, starting at the indicated location in the data.</para>
public int SendTo(byte[] buffer, int size, SocketFlags socketFlags, EndPoint remoteEP) {
return SendTo(buffer, 0, size, socketFlags, remoteEP);
}
+
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public int SendTo(byte[] buffer, SocketFlags socketFlags, EndPoint remoteEP) {
return SendTo(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags, remoteEP);
}
+
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
return bytesTransferred;
}
-
+#if !MONO
public int Receive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Receive", "");
if (CleanedUp) {
return bytesTransferred;
}
-
+#endif // !MONO
public int Receive(IList<ArraySegment<byte>> buffers) {
return Receive(buffers,SocketFlags.None);
return bytesTransferred;
}
+#if !MONO
public int Receive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "Receive", "");
if (CleanedUp) {
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "ReceiveFrom", bytesTransferred);
return bytesTransferred;
}
-
-
+#endif // !MONO
/// <devdoc>
/// <para>Receives a datagram and stores the source end point.</para>
return ReceiveFrom(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None, ref remoteEP);
}
+#if !MONO
// UE
/// <devdoc>
/// <para>[To be supplied.]</para>
return realOptionLength;
}
+#endif // !MONO
// UE
/// <devdoc>
return IOControl(unchecked((int)ioControlCode),optionInValue,optionOutValue);
}
+#if !MONO
internal int IOControl( IOControlCode ioControlCode,
IntPtr optionInValue,
int inValueSize,
return realOptionLength;
}
+#endif // !MONO
public void SetIPProtectionLevel(IPProtectionLevel level) {
if (level == IPProtectionLevel.Unspecified) {
}
}
+#if !MONO
/// <devdoc>
/// <para>
/// Sets the specified option to the specified value.
SelectFileDescriptor(checkWrite, writefileDescriptorSet);
SelectFileDescriptor(checkError, errfileDescriptorSet);
}
+#endif // !MONO
#if !FEATURE_PAL
/// <devdoc>
}
#endif
-
+#if !MONO
//
// Async Winsock Support, the following functions use either
// the Async Winsock support to do overlapped I/O WSASend/WSARecv
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "BeginConnect", result);
return result;
}
+#endif // !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginConnect(IPAddress address, int port, AsyncCallback requestCallback, object state){
return result;
}
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginConnect(IPAddress[] addresses, int port, AsyncCallback requestCallback, object state)
{
GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::DoBeginDisconnect() ");
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
#endif
throw new ObjectDisposedException(this.GetType().FullName);
}
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinXPRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::Disconnect() ");
throw new ObjectDisposedException(this.GetType().FullName);
}
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
if (asyncResult==null) {
throw new ArgumentNullException("asyncResult");
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndDisconnect", null);
return;
}
-
+#endif // !MONO
/*++
return result;
}
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginSend(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
throw new ObjectDisposedException(this.GetType().FullName);
}
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
if (!Connected) {
}
#endif // !FEATURE_PAL
-
+#endif // !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
return result;
}
-
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginSend(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
}
return errorCode;
}
-
+#endif // !MONO
/*++
return bytesTransferred;
}
-
+#if !MONO
public int EndSend(IAsyncResult asyncResult, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndSend", asyncResult);
if (CleanedUp) {
throw new ObjectDisposedException(this.GetType().FullName);
}
-#if FEATURE_PAL
+#if FEATURE_PAL && !MONO
throw new PlatformNotSupportedException(SR.GetString(SR.WinNTRequired));
-#endif // FEATURE_PAL
+#endif // FEATURE_PAL && !MONO
//
// parameter validation
//
if(s_LoggingEnabled)Logging.Exit(Logging.Sockets, this, "EndSendTo", bytesTransferred);
return bytesTransferred;
}
-
+#endif // !MONO
/*++
}
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(byte[] buffer, int offset, int size, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
return errorCode;
}
-
+#endif // !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, AsyncCallback callback, object state)
return result;
}
-
+#if !MONO
[HostProtection(ExternalThreading=true)]
public IAsyncResult BeginReceive(IList<ArraySegment<byte>> buffers, SocketFlags socketFlags, out SocketError errorCode, AsyncCallback callback, object state)
{
private int m_LastReceiveTick;
#endif
+#endif // !MONO
+
/*++
Routine Description:
return bytesTransferred;
}
-
+#if !MONO
public int EndReceive(IAsyncResult asyncResult, out SocketError errorCode) {
if(s_LoggingEnabled)Logging.Enter(Logging.Sockets, this, "EndReceive", asyncResult);
if (CleanedUp) {
}
}
}
+#endif // !MONO
#if !FEATURE_PAL
+#if !MONO
private bool CanUseAcceptEx
{
get
(Thread.CurrentThread.IsThreadPoolThread || SettingsSectionInternal.Section.AlwaysUseCompletionPortsForAccept || m_IsDisconnected);
}
}
+#endif // !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// This is the true async version that uses AcceptEx
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
throw socketException;
}
}
-
+#endif // !MONO
#endif // !FEATURE_PAL
-
/*++
Routine Description:
--*/
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
}
return acceptedSocket;
}
+#endif // !MONO
#if !FEATURE_PAL
-
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
return socket;
}
+#if !MONO
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
}
return socket;
}
-
+#endif // !MONO
#endif // !FEATURE_PAL
-
+#if !MONO
/// <devdoc>
/// <para>
/// Disables sends and receives on a socket.
Interlocked.CompareExchange(ref m_AcceptQueueOrConnectResult, new Queue(16), null);
return (Queue)m_AcceptQueueOrConnectResult;
}
+#endif // !MONO
internal bool CleanedUp {
get {
}
}
+#if !MONO
internal TransportType Transport {
get {
return
m_AsyncEvent.Close();
}
}
+#endif // !MONO
public void Dispose() {
Dispose(true);
Dispose(false);
}
+#if !MONO
// this version does not throw.
internal void InternalShutdown(SocketShutdown how) {
GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::InternalShutdown() how:" + how.ToString());
return retval;
}
-
+#endif // !MONO
} // end of class Socket
-
+#if !MONO
internal class ConnectAsyncResult:ContextAwareResult{
private EndPoint m_EndPoint;
internal ConnectAsyncResult(object myObject, EndPoint endPoint, object myState, AsyncCallback myCallBack):base(myObject, myState, myCallBack) {
}
}
#endif // SOCKETTHREADPOOL
+#endif // !MONO
}
}
#if NETSTANDARD
+ [CLSCompliant (false)]
protected IDictionary Caps
{
get
}
}
+ [CLSCompliant (false)]
protected IDictionary CapNames
{
get
return newcached;
}
-#if !(SILVERLIGHT||FULL_AOT_RUNTIME)
+#if !SILVERLIGHT
/*
* True if the O option was set
*/
protected bool UseOptionC() {
/* Mono: Set to false until we investigate https://bugzilla.xamarin.com/show_bug.cgi?id=25671 */
return false;
+#if FULL_AOT_RUNTIME
+ return false;
+#else
return(roptions & RegexOptions.Compiled) != 0;
+#endif
}
#endif
public void CopyTo(ProcessModule[] array, int index) {
InnerList.CopyTo(array, index);
}
+
+#if MOBILE
+ [Obsolete ("This API is no longer available", true)]
+ public int Capacity {
+ get {
+ throw new NotSupportedException ();
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Add (ProcessModule item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void AddRange (System.Collections.Generic.IEnumerable<ProcessModule> collection)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.ObjectModel.ReadOnlyCollection<ProcessModule> AsReadOnly()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(int index, int count, ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(ProcessModule item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(ProcessModule item, System.Collections.Generic.IComparer<ProcessModule> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Clear()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessModule,TOutput> converter)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void CopyTo(ProcessModule[] array)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void CopyTo(int index, ProcessModule[] array, int arrayIndex, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public bool Exists(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessModule Find(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<ProcessModule> FindAll(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(int startIndex, Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(int startIndex, int count, Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessModule FindLast(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(int startIndex, Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(int startIndex, int count, Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void ForEach(Action<ProcessModule> action)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<ProcessModule> GetRange(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int IndexOf(ProcessModule item, int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int IndexOf(ProcessModule item, int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Insert(int index, ProcessModule item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessModule> collection)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessModule item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessModule item, int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessModule item, int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public bool Remove(ProcessModule item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int RemoveAll(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void RemoveAt(int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void RemoveRange(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Reverse()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Reverse(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(System.Collections.Generic.IComparer<ProcessModule> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessModule> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(Comparison<ProcessModule> comparison)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessModule[] ToArray()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void TrimExcess()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public bool TrueForAll(Predicate<ProcessModule> match)
+ {
+ throw new NotSupportedException ();
+ }
+#endif
}
}
public void CopyTo(ProcessThread[] array, int index) {
InnerList.CopyTo(array, index);
}
+
+#if MOBILE
+ [Obsolete ("This API is no longer available", true)]
+ public int Capacity {
+ get {
+ throw new NotSupportedException ();
+ }
+ set {
+ throw new NotSupportedException ();
+ }
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void AddRange (System.Collections.Generic.IEnumerable<ProcessThread> collection)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.ObjectModel.ReadOnlyCollection<ProcessThread> AsReadOnly()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(int index, int count, ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(ProcessThread item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int BinarySearch(ProcessThread item, System.Collections.Generic.IComparer<ProcessThread> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Clear()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<TOutput> ConvertAll<TOutput>(Converter<ProcessThread,TOutput> converter)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void CopyTo(ProcessThread[] array)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void CopyTo(int index, ProcessThread[] array, int arrayIndex, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public bool Exists(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessThread Find(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<ProcessThread> FindAll(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(int startIndex, Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindIndex(int startIndex, int count, Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessThread FindLast(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(int startIndex, Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int FindLastIndex(int startIndex, int count, Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void ForEach(Action<ProcessThread> action)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public System.Collections.Generic.List<ProcessThread> GetRange(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int IndexOf(ProcessThread item, int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int IndexOf(ProcessThread item, int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void InsertRange(int index, System.Collections.Generic.IEnumerable<ProcessThread> collection)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessThread item)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessThread item, int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int LastIndexOf(ProcessThread item, int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public int RemoveAll(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void RemoveAt(int index)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void RemoveRange(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Reverse()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Reverse(int index, int count)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(System.Collections.Generic.IComparer<ProcessThread> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(int index, int count, System.Collections.Generic.IComparer<ProcessThread> comparer)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void Sort(Comparison<ProcessThread> comparison)
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public ProcessThread[] ToArray()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public void TrimExcess()
+ {
+ throw new NotSupportedException ();
+ }
+
+ [Obsolete ("This API is no longer available", true)]
+ public bool TrueForAll(Predicate<ProcessThread> match)
+ {
+ throw new NotSupportedException ();
+ }
+#endif
}
}
using System.Security.Permissions;
[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
public abstract class ContextBoundObject : MarshalByRefObject {
#else // FEATURE_REMOTING
public abstract class ContextBoundObject {
===========================================================*/
using System;
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
using System.Security.AccessControl;
#endif
using System.Security.Permissions;
}
}
-#if FEATURE_MACL
+#if FEATURE_MACL || MONO
[ResourceExposure(ResourceScope.None)]
[ResourceConsumption(ResourceScope.Machine, ResourceScope.Machine)]
public FileSecurity GetAccessControl()
[FileIOPermissionAttribute(SecurityAction.InheritanceDemand,Unrestricted=true)]
#endif
[ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
#else // FEATURE_REMOTING
public abstract class FileSystemInfo : ISerializable {
#if CONTRACTS_FULL
[ContractClass(typeof(StreamContract))]
#endif
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
public abstract class Stream : MarshalByRefObject, IDisposable {
#else // FEATURE_REMOTING
public abstract class Stream : IDisposable {
// There are methods on the Stream class for reading bytes.
[Serializable]
[ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
public abstract class TextReader : MarshalByRefObject, IDisposable {
#else // FEATURE_REMOTING
public abstract class TextReader : IDisposable {
// There are methods on the Stream class for writing bytes.
[Serializable]
[ComVisible(true)]
-#if FEATURE_REMOTING
+#if FEATURE_REMOTING || MONO
public abstract class TextWriter : MarshalByRefObject, IDisposable {
#else // FEATURE_REMOTING
public abstract class TextWriter : IDisposable {
[System.Runtime.InteropServices.ComVisible(true)]
sealed public class BinaryFormatter :
-#if !FEATURE_REMOTING
+#if !FEATURE_REMOTING && !MONO
IFormatter
#else
IRemotingFormatter
{
#pragma warning disable 618 // We still use SecurityCriticalScope for v2 compat
-#if !FEATURE_CORECLR && !MOBILE
+#if !FEATURE_CORECLR
private SecurityCriticalScope _val;
#endif // FEATURE_CORECLR
public SecurityCriticalAttribute () {}
-#if !FEATURE_CORECLR && !MOBILE
+#if !FEATURE_CORECLR
public SecurityCriticalAttribute(SecurityCriticalScope scope)
{
_val = scope;
: base(info, context)
{
}
-#if !MOBILE
+
public Object ExceptionState
{
[System.Security.SecuritySafeCritical] // auto-generated
get {return Thread.CurrentThread.AbortReason;}
}
-#endif
}
}
expt_attr : { $$ = 0; } /* EMPTY */\r
| expt_attr K_PRIVATE { $$ = (TypeAttr)$1 | TypeAttr.Private; }\r
| expt_attr K_PUBLIC { $$ = (TypeAttr)$1 | TypeAttr.Public; }\r
+ | expt_attr K_FORWARDER { $$ = (TypeAttr)$1 | TypeAttr.Forwarder; }\r
| expt_attr K_NESTED K_PUBLIC { $$ = (TypeAttr)$1 | TypeAttr.NestedPublic; }\r
| expt_attr K_NESTED K_PRIVATE { $$ = (TypeAttr)$1 | TypeAttr.NestedPrivate; }\r
| expt_attr K_NESTED K_FAMILY { $$ = (TypeAttr)$1 | TypeAttr.NestedFamily; }\r
| expt_attr K_NESTED K_ASSEMBLY { $$ = (TypeAttr)$1 | TypeAttr.NestedAssembly;}\r
| expt_attr K_NESTED K_FAMANDASSEM { $$ = (TypeAttr)$1 | TypeAttr.NestedFamAndAssem; }\r
| expt_attr K_NESTED K_FAMORASSEM { $$ = (TypeAttr)$1 | TypeAttr.NestedFamOrAssem; }\r
- | K_FORWARDER { $$ = TypeAttr.Forwarder; }\r
;\r
\r
exptype_decls : /* EMPTY */\r
// is no better expression conversion
//
if (candidate_pd.Count < best_pd.Count) {
- if (!candidate_params && !candidate_pd.FixedParameters [j - j].HasDefaultValue) {
+ if (!candidate_params && !candidate_pd.FixedParameters [j - 1].HasDefaultValue) {
return true;
}
} else if (candidate_pd.Count == best_pd.Count) {
var ga_u = u.TypeArguments;
var ga_v = v.TypeArguments;
- if (u.TypeArguments.Length != u.TypeArguments.Length)
+ if (u.TypeArguments.Length != v.TypeArguments.Length)
return 0;
int score = 0;
compiled_types = new Dictionary<MetaType, TypeSpec> (40, ReferenceEquality<MetaType>.Default);
assembly_2_definition = new Dictionary<Assembly, IAssemblyDefinition> (ReferenceEquality<Assembly>.Default);
IgnorePrivateMembers = true;
+ IgnoreCompilerGeneratedField = true;
}
#region Properties
public bool IgnorePrivateMembers { get; set; }
+ public bool IgnoreCompilerGeneratedField { get; set; }
+
#endregion
public abstract void AddCompiledType (TypeBuilder builder, TypeSpec spec);
break;
default:
// Ignore private fields (even for error reporting) to not require extra dependencies
- if ((IgnorePrivateMembers && !declaringType.IsStruct) ||
- HasAttribute (CustomAttributeData.GetCustomAttributes (fi), "CompilerGeneratedAttribute", CompilerServicesNamespace))
+ if (IgnorePrivateMembers && !declaringType.IsStruct)
+ return null;
+
+ if (IgnoreCompilerGeneratedField && HasAttribute (CustomAttributeData.GetCustomAttributes (fi), "CompilerGeneratedAttribute", CompilerServicesNamespace))
return null;
mod = Modifiers.PRIVATE;
backing_field = new Field (Parent,
new TypeExpression (MemberType, Location),
- Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
+ Modifiers.BACKING_FIELD | Modifiers.COMPILER_GENERATED | Modifiers.DEBUGGER_HIDDEN | Modifiers.PRIVATE | (ModFlags & (Modifiers.STATIC | Modifiers.UNSAFE)),
MemberName, null);
Parent.PartialContainer.Members.Add (backing_field);
backing_field.Initializer = Initializer;
- backing_field.ModFlags &= ~Modifiers.COMPILER_GENERATED;
// Call define because we passed fields definition
backing_field.Define ();
--- /dev/null
+.assembly bz16628.typeforwarder2 {}
+.assembly extern mscorlib {}
+.assembly extern bz16628.typeforwardee2 {}
+
+.class extern public forwarder NSwForwardee2.Foo_SPECIAL{
+ .assembly extern bz16628.typeforwardee2
+}
+
+.class public auto ansi beforefieldinit NSwForwardee2.Bar_SPECIAL
+ extends [mscorlib]System.Object
+{
+ .field public static int32 A
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Foo::.ctor
+
+ .method private hidebysig specialname rtspecialname static
+ void .cctor() cil managed
+ {
+ // Code size 8 (0x8)
+ .maxstack 8
+ IL_0000: ldc.i4.s 320
+ IL_0002: stsfld int32 NSwForwardee2.Bar_SPECIAL::A
+ IL_0007: ret
+ } // end of method Foo::.cctor
+}
+
using System;
using System.Reflection;
+using System.Runtime.CompilerServices;
[assembly: Test]
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), false, 44);
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 45);
FieldInfo fi = typeof(Test_3).GetField ("e_1", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
- Assert (fi.GetCustomAttributes (true), true, 46);
+ Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 46);
+ Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), true, 47);
ei = typeof(Test_3).GetEvent ("e_2");
Assert (ei.GetCustomAttributes (true), false, 51);
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), true, 54);
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 55);
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
- Assert (fi.GetCustomAttributes (true), false, 56);
+ Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 56);
+ Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 57);
ei = typeof(Test_4).GetEvent ("e_2");
Assert (ei.GetCustomAttributes (true), false, 71);
Assert (ei.GetRemoveMethod ().GetCustomAttributes (true), false, 74);
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), true, 75);
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
- Assert (fi.GetCustomAttributes (true), false, 76);
+ Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 76);
+ Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 77);
ei = typeof(Test_4).GetEvent ("e_3");
Assert (ei.GetCustomAttributes (true), false, 81);
Assert (ei.GetRemoveMethod ().ReturnTypeCustomAttributes.GetCustomAttributes (true), false, 86);
Assert (ei.GetRemoveMethod ().GetParameters ()[0].GetCustomAttributes (true), true, 87);
fi = typeof(Test_3).GetField ("e_2", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
- Assert (fi.GetCustomAttributes (true), false, 88);
+ Assert (fi.GetCustomAttributes (typeof (CompilerGeneratedAttribute), true), true, 86);
+ Assert (fi.GetCustomAttributes (typeof (TestAttribute), true), false, 87);
return failed ? 1 : 0;
}
<size>80</size>
</method>
<method name="Int32 Main()" attrs="150">
- <size>1169</size>
+ <size>1309</size>
</method>
<method name="Void .ctor()" attrs="6278">
<size>7</size>
string direction = first && HasExtensionParameter ? "this" : "in";
first = false;
- if (parameter.ParameterType is ByReferenceType)
+ var pt = parameter.ParameterType;
+ var brt = pt as ByReferenceType;
+ if (brt != null) {
direction = parameter.IsOut ? "out" : "ref";
+ pt = brt.ElementType;
+ }
- TypeReference t = parameter.ParameterType;
- AddAttribute ("type", Utils.CleanupTypeName (t));
+ AddAttribute ("type", Utils.CleanupTypeName (pt));
if (parameter.IsOptional) {
AddAttribute ("optional", "true");
ParameterDefinition info = infos [i];
+ string modifier = string.Empty;
if (info.ParameterType.IsByReference) {
- string modifier;
- if ((info.Attributes & (ParameterAttributes.Out | ParameterAttributes.In)) == ParameterAttributes.Out)
+ if ((info.Attributes & ParameterAttributes.In) != 0)
+ modifier = "in";
+ else if ((info.Attributes & ParameterAttributes.Out) != 0)
modifier = "out";
- else
- modifier = "ref";
+ }
+ if (modifier.Length > 0) {
signature.Append (modifier);
signature.Append (" ");
}
SUBDIRS =
include ../../build/rules.make
-LIB_REFS = Mono.Security
-LOCAL_MCS_FLAGS = -unsafe
+LIB_REFS = System Mono.Security System.Security
+LOCAL_MCS_FLAGS = -unsafe -define:NO_SYMBOL_WRITER
PROGRAM = gacutil.exe
using System.IO;
using System.Diagnostics;
using System.Text;
-using System.Reflection;
using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
using Mono.Security;
using Mono.Security.Cryptography;
+using IKVM.Reflection;
+
namespace Mono.Tools {
public class Driver {
private static bool silent;
static bool in_bootstrap;
+ private static Universe _universe;
public static int Main (string [] args)
{
AssemblyName an = null;
try {
- assembly = Assembly.LoadFrom (name);
+ assembly = ReflectionOnlyLoadFrom (name);
} catch {
WriteLine (string.Format (failure_msg, name) + "The file specified is not a valid assembly.");
return false;
}
}
+ private static Universe GetUniverse () {
+ if (_universe == null) {
+ _universe = new Universe (UniverseOptions.MetadataOnly);
+ }
+ return _universe;
+ }
+
+ private static Assembly ReflectionOnlyLoadFrom (string fileName)
+ {
+ return GetUniverse ().LoadFile (fileName);
+ }
+ private static AssemblyName GetCorlibName ()
+ {
+ return GetUniverse ().Mscorlib.GetName ();
+ }
+
private static bool CheckReferencedAssemblies (AssemblyName an)
{
- AppDomain d = null;
try {
- Assembly a = Assembly.LoadFrom (an.CodeBase);
- AssemblyName corlib = typeof (object).Assembly.GetName ();
+ Assembly a = ReflectionOnlyLoadFrom (an.CodeBase);
+ AssemblyName corlib = GetCorlibName ();
foreach (AssemblyName ref_an in a.GetReferencedAssemblies ()) {
if (ref_an.Name == corlib.Name) // Just do a string compare so we can install on diff versions
} catch (Exception e) {
WriteLine (e.ToString ()); // This should be removed pre beta3
return false;
- } finally {
- if (d != null) {
- try {
- AppDomain.Unload (d);
- } catch { }
- }
}
return true;
static bool LoadConfig (bool quiet)
{
- MethodInfo config = typeof (System.Environment).GetMethod ("GetMachineConfigPath",
- BindingFlags.Static | BindingFlags.NonPublic);
+ System.Reflection.MethodInfo config = typeof (System.Environment).GetMethod ("GetMachineConfigPath",
+ System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic);
if (config != null) {
string path = (string) config.Invoke (null, null);
// Note: MustVerify is based on the original token (by design). Public key
// remapping won't affect if the assembly is verified or not.
- if (StrongNameManager.MustVerify (an)) {
+ if (StrongNameManager.MustVerify (new System.Reflection.AssemblyName (an.FullName))) {
RSA rsa = CryptoConvert.FromCapiPublicKeyBlob (publicKey, 12);
StrongName sn = new StrongName (rsa);
if (sn.Verify (assemblyFile)) {
public static extern int symlink (string oldpath, string newpath);
private static string GetGacDir () {
- PropertyInfo gac = typeof (System.Environment).GetProperty ("GacPath",
- BindingFlags.Static|BindingFlags.NonPublic);
+ System.Reflection.PropertyInfo gac = typeof (System.Environment).GetProperty ("GacPath",
+ System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.NonPublic);
if (gac == null) {
WriteLine ("ERROR: Mono runtime not detected, please use " +
"the mono runtime for gacutil.exe");
Environment.Exit (1);
}
- MethodInfo get_gac = gac.GetGetMethod (true);
+ System.Reflection.MethodInfo get_gac = gac.GetGetMethod (true);
return (string) get_gac.Invoke (null, null);
}
private static string GetLibDir () {
- MethodInfo libdir = typeof (System.Environment).GetMethod ("internalGetGacPath",
- BindingFlags.Static|BindingFlags.NonPublic);
+ System.Reflection.MethodInfo libdir = typeof (System.Environment).GetMethod ("internalGetGacPath",
+ System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.NonPublic);
if (libdir == null) {
WriteLine ("ERROR: Mono runtime not detected, please use " +
"the mono runtime for gacutil.exe");
driver.cs
../security/StrongNameManager.cs
+../../../external/ikvm/reflect/*.cs
+../../../external/ikvm/reflect/Metadata/*.cs
+../../../external/ikvm/reflect/Emit/*.cs
+../../../external/ikvm/reflect/Reader/*.cs
+../../../external/ikvm/reflect/Writer/*.cs
+../../../external/ikvm/reflect/Impl/ITypeOwner.cs
+../../../external/ikvm/reflect/Impl/SymbolSupport.cs
using System.Text;
using IKVM.Reflection;
using System.Linq;
-using System.Diagnostics;
using System.Net;
using System.Threading.Tasks;
static string output = "a.out";
static string object_out = null;
static List<string> link_paths = new List<string> ();
+ static Dictionary<string,string> libraries = new Dictionary<string,string> ();
static bool autodeps = false;
static bool keeptemp = false;
static bool compile_only = false;
cross_target = args [++i];
break;
+ case "--library":
+ if (i+1 == top){
+ Help ();
+ return 1;
+ }
+ if (custom_mode){
+ Console.Error.WriteLine ("--library can only be used with --simple/--runtime/--cross mode");
+ Help ();
+ return 1;
+ }
+ var lspec = args [++i];
+ var p = lspec.IndexOf (",");
+ string alias, path;
+ if (p == -1){
+ alias = Path.GetFileName (lspec);
+ path = lspec;
+ } else {
+ alias = lspec.Substring (0, p);
+ path = lspec.Substring (p+1);
+ }
+ if (!File.Exists (path)){
+ Console.Error.WriteLine ($"The specified library file {path} does not exist");
+ return 1;
+ }
+ libraries [alias] = path;
+ break;
+
case "--fetch-target":
if (i+1 == top){
Help ();
return 1;
}
var env = args [++i];
- var p = env.IndexOf ('=');
+ p = env.IndexOf ('=');
if (p == -1)
environment.Add (env, "");
else
foreach (var key in environment.Keys)
maker.AddStringPair ("env:" + key, key, environment [key]);
}
+ if (libraries.Count > 0){
+ foreach (var alias_and_path in libraries){
+ maker.Add ("library:" + alias_and_path.Key, alias_and_path.Value);
+ }
+ }
maker.Dump ();
maker.Close ();
return true;
string monoPath = GetEnv("MONOPREFIX", @"C:\Program Files (x86)\Mono");
string[] includes = new string[] {winsdkPath + @"\Include\um", winsdkPath + @"\Include\shared", vsPath + @"\include", monoPath + @"\include\mono-2.0", "." };
- string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
+ // string[] libs = new string[] { winsdkPath + @"\Lib\winv6.3\um\x86" , vsPath + @"\lib" };
var linkLibraries = new string[] { "kernel32.lib",
"version.lib",
"Ws2_32.lib",
{
Console.WriteLine ("Usage is: mkbundle [options] assembly1 [assembly2...]\n\n" +
"Options:\n" +
- " --config F Bundle system config file `F'\n" +
- " --config-dir D Set MONO_CFG_DIR to `D'\n" +
- " --deps Turns on automatic dependency embedding (default on simple)\n" +
- " -L path Adds `path' to the search path for assemblies\n" +
- " --machine-config F Use the given file as the machine.config for the application.\n" +
- " -o out Specifies output filename\n" +
- " --nodeps Turns off automatic dependency embedding (default on custom)\n" +
- " --skip-scan Skip scanning assemblies that could not be loaded (but still embed them).\n" +
- " --i18n ENCODING none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
- " -v Verbose output\n" +
+ " --config F Bundle system config file `F'\n" +
+ " --config-dir D Set MONO_CFG_DIR to `D'\n" +
+ " --deps Turns on automatic dependency embedding (default on simple)\n" +
+ " -L path Adds `path' to the search path for assemblies\n" +
+ " --machine-config F Use the given file as the machine.config for the application.\n" +
+ " -o out Specifies output filename\n" +
+ " --nodeps Turns off automatic dependency embedding (default on custom)\n" +
+ " --skip-scan Skip scanning assemblies that could not be loaded (but still embed them).\n" +
+ " --i18n ENCODING none, all or comma separated list of CJK, MidWest, Other, Rare, West.\n" +
+ " -v Verbose output\n" +
"\n" +
"--simple Simple mode does not require a C toolchain and can cross compile\n" +
- " --cross TARGET Generates a binary for the given TARGET\n"+
- " --local-targets Lists locally available targets\n" +
- " --list-targets Lists available targets on the remote server\n" +
- " --options OPTIONS Embed the specified Mono command line options on target\n" +
- " --runtime RUNTIME Manually specifies the Mono runtime to use\n" +
- " --target-server URL Specified a server to download targets from, default is " + target_server + "\n" +
- " --env KEY=VALUE Hardcodes an environment variable for the target\n" +
+ " --cross TARGET Generates a binary for the given TARGET\n"+
+ " --env KEY=VALUE Hardcodes an environment variable for the target\n" +
+ " --library [LIB,]PATH Bundles the specified dynamic library to be used at runtime\n" +
+ " LIB is optional shortname for file located at PATH\n" +
+ " --list-targets Lists available targets on the remote server\n" +
+ " --local-targets Lists locally available targets\n" +
+ " --options OPTIONS Embed the specified Mono command line options on target\n" +
+ " --runtime RUNTIME Manually specifies the Mono runtime to use\n" +
+ " --target-server URL Specified a server to download targets from, default is " + target_server + "\n" +
"\n" +
"--custom Builds a custom launcher, options for --custom\n" +
- " -c Produce stub only, do not compile\n" +
- " -oo obj Specifies output filename for helper object file\n" +
+ " -c Produce stub only, do not compile\n" +
+ " -oo obj Specifies output filename for helper object file\n" +
" --dos2unix[=true|false]\n" +
- " When no value provided, or when `true` specified\n" +
- " `dos2unix` will be invoked to convert paths on Windows.\n" +
- " When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
- " --keeptemp Keeps the temporary files\n" +
- " --static Statically link to mono libs\n" +
- " --nomain Don't include a main() function, for libraries\n" +
- " --custom-main C Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
- " -z Compress the assemblies before embedding.\n" +
- " --static-ctor ctor Add a constructor call to the supplied function.\n" +
- " You need zlib development headers and libraries.\n");
+ " When no value provided, or when `true` specified\n" +
+ " `dos2unix` will be invoked to convert paths on Windows.\n" +
+ " When `--dos2unix=false` used, dos2unix is NEVER used.\n" +
+ " --keeptemp Keeps the temporary files\n" +
+ " --static Statically link to mono libs\n" +
+ " --nomain Don't include a main() function, for libraries\n" +
+ " --custom-main C Link the specified compilation unit (.c or .obj) with entry point/init code\n" +
+ " -z Compress the assemblies before embedding.\n" +
+ " --static-ctor ctor Add a constructor call to the supplied function.\n" +
+ " You need zlib development headers and libraries.\n");
}
[DllImport ("libc")]
../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
../../../external/cecil/symbols/mdb/Mono.Cecil.Mdb/MdbWriter.cs
../../../external/cecil/symbols/mdb/Mono.CompilerServices.SymbolWriter/*.cs
+../../../external/cecil/symbols/pdb/Microsoft.Cci.Pdb/*.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedDocumentWriter.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ISymUnmanagedWriter2.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/ModuleMetadata.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbHelper.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbReader.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/PdbWriter.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymDocumentWriter.cs
+../../../external/cecil/symbols/pdb/Mono.Cecil.Pdb/SymWriter.cs
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" >
+
+ <ItemGroup>
+ <Input Include="test.vb" />
+ <Output Include="test.exe" />
+ </ItemGroup>
+
+ <Target Name="Compile1" >
+ <Vbc
+ Sources="@(Input)"
+ OutputAssembly="@(Output)"
+ />
+ </Target>
+
+ <Target Name="Clean" >
+ <Delete Files="@(Output)" />
+ </Target>
+
+ <Target Name="Execute" >
+ <Exec Command="@(Output)" />
+ </Target>
+</Project>
--- /dev/null
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTarget="Build">
+
+ <ItemGroup>
+ <Input Include="test.vb" />
+ <Output Include="test.exe" />
+ </ItemGroup>
+
+ <Target Name="Build" >
+ <Vbc
+ Sources="@(Input)"
+ />
+ </Target>
+</Project>
--- /dev/null
+Imports System
+
+Public Module mainmod
+ Sub Main()
+ Console.WriteLine("Hello, world!")
+ End sub
+End Module
common_sources = \
$(platform_sources) \
assembly.c \
+ assembly-internals.h \
attach.h \
attach.c \
cil-coff.h \
handle.c \
handle.h \
w32mutex.h \
- w32mutex-utils.h \
w32semaphore.h \
w32event.h \
w32handle-namespace.h \
* Changes which are already detected at runtime, like the addition
* of icalls, do not require an increment.
*/
-#define MONO_CORLIB_VERSION 156
+#define MONO_CORLIB_VERSION 157
typedef struct
{
--- /dev/null
+/*
+ * Copyright 2015 Xamarin Inc
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
+ */
+#ifndef __MONO_METADATA_ASSEMBLY_INTERNALS_H__
+#define __MONO_METADATA_ASSEMBLY_INTERNALS_H__
+
+#include <mono/metadata/assembly.h>
+
+MONO_API MonoImage* mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error);
+
+#endif /* __MONO_METADATA_ASSEMBLY_INTERNALS_H__ */
#include <string.h>
#include <stdlib.h>
#include "assembly.h"
+#include "assembly-internals.h"
#include "image.h"
+#include "image-internals.h"
#include "object-internals.h"
#include <mono/metadata/loader.h>
#include <mono/metadata/tabledefs.h>
MonoImage*
mono_assembly_load_module (MonoAssembly *assembly, guint32 idx)
{
- return mono_image_load_file_for_image (assembly->image, idx);
+ MonoError error;
+ MonoImage *result = mono_assembly_load_module_checked (assembly, idx, &error);
+ mono_error_assert_ok (&error);
+ return result;
}
+MONO_API MonoImage*
+mono_assembly_load_module_checked (MonoAssembly *assembly, uint32_t idx, MonoError *error)
+{
+ return mono_image_load_file_for_image_checked (assembly->image, idx, error);
+}
+
+
/**
* mono_assembly_foreach:
* @func: function to invoke for each assembly loaded
#ifndef _MONONET_METADATA_ASSEMBLY_H_
#define _MONONET_METADATA_ASSEMBLY_H_
+#include <mono/utils/mono-error.h>
#include <mono/metadata/image.h>
MONO_BEGIN_DECLS
MONO_API void mono_assembly_get_assemblyref (MonoImage *image, int index, MonoAssemblyName *aname);
MONO_API void mono_assembly_load_reference (MonoImage *image, int index);
MONO_API void mono_assembly_load_references (MonoImage *image, MonoImageOpenStatus *status);
-MONO_API MonoImage* mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
+MONO_RT_EXTERNAL_ONLY MONO_API MonoImage* mono_assembly_load_module (MonoAssembly *assembly, uint32_t idx);
MONO_API void mono_assembly_close (MonoAssembly *assembly);
MONO_API void mono_assembly_setrootdir (const char *root_dir);
MONO_API MONO_CONST_RETURN char *mono_assembly_getrootdir (void);
mono_counters_init ();
+#ifndef HOST_WIN32
+ mono_w32handle_init ();
+#endif
+
/*
* Handle the case when we are called from a thread different from the main thread,
* confusing libgc.
MonoGenericClass*
mono_class_get_generic_class (MonoClass *klass);
+gpointer
+mono_class_alloc (MonoClass *klass, int size);
+
+gpointer
+mono_class_alloc0 (MonoClass *klass, int size);
+
void
mono_class_alloc_ext (MonoClass *klass);
#include <string.h>
#include <stdlib.h>
#include <mono/metadata/image.h>
+#include <mono/metadata/image-internals.h>
#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/metadata.h>
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/profiler-private.h>
goto done;
case MONO_RESOLUTION_SCOPE_MODULEREF:
- module = mono_image_load_module (image, idx);
+ module = mono_image_load_module_checked (image, idx, error);
if (module)
res = mono_class_from_name_checked (module, nspace, name, error);
goto done;
result->sre_method = FALSE;
result->signature = NULL;
+ if (method->wrapper_type) {
+ MonoMethodWrapper *mw = (MonoMethodWrapper*)method;
+ MonoMethodWrapper *resw = (MonoMethodWrapper*)result;
+ int len = GPOINTER_TO_INT (((void**)mw->method_data) [0]);
+
+ resw->method_data = (void **)g_malloc (sizeof (gpointer) * (len + 1));
+ memcpy (resw->method_data, mw->method_data, sizeof (gpointer) * (len + 1));
+ }
+
if (iresult->context.method_inst) {
/* Set the generic_container of the result to the generic_container of method */
MonoGenericContainer *generic_container = mono_method_get_generic_container (method);
* Allocate memory for some data belonging to CLASS, either from its image's mempool,
* or from the heap.
*/
-static gpointer
+gpointer
mono_class_alloc (MonoClass *klass, int size)
{
if (klass->generic_class)
return mono_image_alloc (klass->image, size);
}
-static gpointer
+gpointer
mono_class_alloc0 (MonoClass *klass, int size)
{
gpointer res;
if (cols [MONO_FILE_FLAGS] == FILE_CONTAINS_NO_METADATA)
continue;
- file_image = mono_image_load_file_for_image (image, i + 1);
+ file_image = mono_image_load_file_for_image_checked (image, i + 1, error);
if (file_image) {
klass = mono_class_from_name_checked (file_image, name_space, name, error);
if (klass || !is_ok (error))
impl = cols [MONO_EXP_TYPE_IMPLEMENTATION];
if ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_FILE) {
- loaded_image = mono_assembly_load_module (image->assembly, impl >> MONO_IMPLEMENTATION_BITS);
+ loaded_image = mono_assembly_load_module_checked (image->assembly, impl >> MONO_IMPLEMENTATION_BITS, error);
if (!loaded_image)
return NULL;
klass = mono_class_from_name_checked_aux (loaded_image, name_space, name, visited_images, error);
ICALL(GC_1, "GetTotalMemory", ves_icall_System_GC_GetTotalMemory)
ICALL(GC_2, "InternalCollect", ves_icall_System_GC_InternalCollect)
ICALL(GC_3, "KeepAlive", ves_icall_System_GC_KeepAlive)
-ICALL(GC_4, "ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize)
ICALL(GC_4a, "RecordPressure", mono_gc_add_memory_pressure)
ICALL(GC_6, "WaitForPendingFinalizers", ves_icall_System_GC_WaitForPendingFinalizers)
+ICALL(GC_6b, "_ReRegisterForFinalize", ves_icall_System_GC_ReRegisterForFinalize)
ICALL(GC_7, "_SuppressFinalize", ves_icall_System_GC_SuppressFinalize)
ICALL(GC_9, "get_ephemeron_tombstone", ves_icall_System_GC_get_ephemeron_tombstone)
ICALL(GC_8, "register_ephemeron_array", ves_icall_System_GC_register_ephemeron_array)
ICALL(MODULEB_1, "WriteToFile", ves_icall_ModuleBuilder_WriteToFile)
ICALL(MODULEB_2, "basic_init", ves_icall_ModuleBuilder_basic_init)
ICALL(MODULEB_3, "build_metadata", ves_icall_ModuleBuilder_build_metadata)
-ICALL(MODULEB_4, "create_modified_type", ves_icall_ModuleBuilder_create_modified_type)
ICALL(MODULEB_5, "getMethodToken", ves_icall_ModuleBuilder_getMethodToken)
ICALL(MODULEB_6, "getToken", ves_icall_ModuleBuilder_getToken)
ICALL(MODULEB_7, "getUSIndex", ves_icall_ModuleBuilder_getUSIndex)
#include <mono/metadata/threadpool-ms-io.h>
#include <mono/metadata/monitor.h>
#include <mono/metadata/reflection.h>
+#include <mono/metadata/image-internals.h>
#include <mono/metadata/assembly.h>
+#include <mono/metadata/assembly-internals.h>
#include <mono/metadata/tabledefs.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/exception-internals.h>
/* if we have no info we are optimistic and assume there is enough room */
if (!stack_addr)
return TRUE;
-#ifdef HOST_WIN32
- // FIXME: Windows dynamically extends the stack, so stack_addr might be close
- // to the current sp
- return TRUE;
-#endif
current = (guint8 *)&stack_addr;
if (current > stack_addr) {
if ((current - stack_addr) < min_size)
g_assert ((impl & MONO_IMPLEMENTATION_MASK) == MONO_IMPLEMENTATION_FILE);
file_idx = impl >> MONO_IMPLEMENTATION_BITS;
- module = mono_image_load_file_for_image (assembly->assembly->image, file_idx);
- if (!module)
+ module = mono_image_load_file_for_image_checked (assembly->assembly->image, file_idx, &error);
+ if (mono_error_set_pending_exception (&error) || !module)
return NULL;
}
else
mono_array_setref (res, j, rm);
}
else {
- MonoImage *m = mono_image_load_file_for_image (image, i + 1);
+ MonoImage *m = mono_image_load_file_for_image_checked (image, i + 1, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
if (!m) {
MonoString *fname = mono_string_new (mono_domain_get (), mono_metadata_string_heap (image, cols [MONO_FILE_NAME]));
mono_set_pending_exception (mono_get_exception_file_not_found2 (NULL, fname));
/* Append data from all modules in the assembly */
for (i = 0; i < table->rows; ++i) {
if (!(mono_metadata_decode_row_col (table, i, MONO_FILE_FLAGS) & FILE_CONTAINS_NO_METADATA)) {
- MonoImage *loaded_image = mono_assembly_load_module (image->assembly, i + 1);
+ MonoImage *loaded_image = mono_assembly_load_module_checked (image->assembly, i + 1, &error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
if (loaded_image) {
MonoArray *ex2;
MonoArray *res2;
MonoImage *
mono_find_image_owner (void *ptr);
+MonoImage*
+mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError *error);
+
+MonoImage*
+mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error);
+
#endif /* __MONO_METADATA_IMAGE_INTERNALS_H__ */
};
static GHashTable *loaded_images_hashes [4] = {NULL, NULL, NULL, NULL};
-static GHashTable *get_loaded_images_hash (gboolean refonly)
+static GHashTable *
+get_loaded_images_hash (gboolean refonly)
{
int idx = refonly ? IMAGES_HASH_PATH_REFONLY : IMAGES_HASH_PATH;
return loaded_images_hashes [idx];
}
-static GHashTable *get_loaded_images_by_name_hash (gboolean refonly)
+static GHashTable *
+get_loaded_images_by_name_hash (gboolean refonly)
{
int idx = refonly ? IMAGES_HASH_NAME_REFONLY : IMAGES_HASH_NAME;
return loaded_images_hashes [idx];
}
+// Change the assembly set in `image` to the assembly set in `assemblyImage`. Halt if overwriting is attempted.
+// Can be used on modules loaded through either the "file" or "module" mechanism
+static gboolean
+assign_assembly_parent_for_netmodule (MonoImage *image, MonoImage *assemblyImage, MonoError *error)
+{
+ // Assembly to assign
+ MonoAssembly *assembly = assemblyImage->assembly;
+
+ while (1) {
+ // Assembly currently assigned
+ MonoAssembly *assemblyOld = image->assembly;
+ if (assemblyOld) {
+ if (assemblyOld == assembly)
+ return TRUE;
+ mono_error_set_bad_image (error, assemblyImage, "Attempted to load module %s which has already been loaded by assembly %s. This is not supported in Mono.", image->name, assemblyOld->image->name);
+ return FALSE;
+ }
+ gpointer result = InterlockedExchangePointer((gpointer *)&image->assembly, assembly);
+ if (result == assembly)
+ return TRUE;
+ }
+}
+
static gboolean debug_assembly_unload = FALSE;
#define mono_images_lock() if (mutex_inited) mono_os_mutex_lock (&images_mutex)
}
/**
- * mono_image_load_module:
+ * mono_image_load_module_checked:
*
* Load the module with the one-based index IDX from IMAGE and return it. Return NULL if
- * it cannot be loaded.
+ * it cannot be loaded. NULL without MonoError being set will be interpreted as "not found".
*/
MonoImage*
-mono_image_load_module (MonoImage *image, int idx)
+mono_image_load_module_checked (MonoImage *image, int idx, MonoError *error)
{
MonoTableInfo *t;
MonoTableInfo *file_table;
GList *list_iter, *valid_modules = NULL;
MonoImageOpenStatus status;
+ mono_error_init (error);
+
if ((image->module_count == 0) || (idx > image->module_count || idx <= 0))
return NULL;
if (image->modules_loaded [idx - 1])
}
if (valid) {
module_ref = g_build_filename (base_dir, name, NULL);
- image->modules [idx - 1] = mono_image_open_full (module_ref, &status, refonly);
- if (image->modules [idx - 1]) {
- mono_image_addref (image->modules [idx - 1]);
- image->modules [idx - 1]->assembly = image->assembly;
+ MonoImage *moduleImage = mono_image_open_full (module_ref, &status, refonly);
+ if (moduleImage) {
+ if (!assign_assembly_parent_for_netmodule (moduleImage, image, error)) {
+ mono_image_close (moduleImage);
+ g_free (module_ref);
+ g_free (base_dir);
+ g_list_free (valid_modules);
+ return NULL;
+ }
+
+ image->modules [idx - 1] = image;
+
#ifdef HOST_WIN32
if (image->modules [idx - 1]->is_module_handle)
mono_image_fixup_vtable (image->modules [idx - 1]);
return image->modules [idx - 1];
}
+MonoImage*
+mono_image_load_module (MonoImage *image, int idx)
+{
+ MonoError error;
+ MonoImage *result = mono_image_load_module_checked (image, idx, &error);
+ mono_error_assert_ok (&error);
+ return result;
+}
+
static gpointer
class_key_extract (gpointer value)
{
free_hash (cache->thunk_invoke_cache);
}
+static void
+mono_image_close_except_pools_all (MonoImage**images, int image_count)
+{
+ for (int i = 0; i < image_count; ++i) {
+ if (images [i]) {
+ if (!mono_image_close_except_pools (images [i]))
+ images [i] = NULL;
+ }
+ }
+}
+
/*
* Returns whether mono_image_close_finish() must be called as well.
* We must unload images in two steps because clearing the domain in
g_free (image->name);
g_free (image->guid);
g_free (image->version);
- g_free (image->files);
}
if (image->method_cache)
g_free (image->image_info);
}
- for (i = 0; i < image->module_count; ++i) {
- if (image->modules [i]) {
- if (!mono_image_close_except_pools (image->modules [i]))
- image->modules [i] = NULL;
- }
- }
+ mono_image_close_except_pools_all (image->files, image->file_count);
+ mono_image_close_except_pools_all (image->modules, image->module_count);
if (image->modules_loaded)
g_free (image->modules_loaded);
return TRUE;
}
+static void
+mono_image_close_all (MonoImage**images, int image_count)
+{
+ for (int i = 0; i < image_count; ++i) {
+ if (images [i])
+ mono_image_close_finish (images [i]);
+ }
+ if (images)
+ g_free (images);
+}
+
void
mono_image_close_finish (MonoImage *image)
{
image->references = NULL;
}
- for (i = 0; i < image->module_count; ++i) {
- if (image->modules [i])
- mono_image_close_finish (image->modules [i]);
- }
- if (image->modules)
- g_free (image->modules);
+ mono_image_close_all (image->files, image->file_count);
+ mono_image_close_all (image->modules, image->module_count);
#ifndef DISABLE_PERFCOUNTERS
mono_perfcounters->loader_bytes -= mono_mempool_get_allocated (image->mempool);
return data;
}
+// Returning NULL with no error set will be interpeted as "not found"
MonoImage*
-mono_image_load_file_for_image (MonoImage *image, int fileidx)
+mono_image_load_file_for_image_checked (MonoImage *image, int fileidx, MonoError *error)
{
char *base_dir, *name;
MonoImage *res;
const char *fname;
guint32 fname_id;
+ mono_error_init (error);
+
if (fileidx < 1 || fileidx > t->rows)
return NULL;
} else {
int i;
/* g_print ("loaded file %s from %s (%p)\n", name, image->name, image->assembly); */
- res->assembly = image->assembly;
+ if (!assign_assembly_parent_for_netmodule (res, image, error)) {
+ mono_image_unlock (image);
+ mono_image_close (res);
+ return NULL;
+ }
+
for (i = 0; i < res->module_count; ++i) {
if (res->modules [i] && !res->modules [i]->assembly)
res->modules [i]->assembly = image->assembly;
}
- if (!image->files)
+ if (!image->files) {
image->files = g_new0 (MonoImage*, t->rows);
+ image->file_count = t->rows;
+ }
image->files [fileidx - 1] = res;
mono_image_unlock (image);
/* vtable fixup can't happen with the image lock held */
return res;
}
+MonoImage*
+mono_image_load_file_for_image (MonoImage *image, int fileidx)
+{
+ MonoError error;
+ MonoImage *result = mono_image_load_file_for_image_checked (image, fileidx, &error);
+ mono_error_assert_ok (&error);
+ return result;
+}
+
/**
* mono_image_get_strong_name:
* @image: a MonoImage
#include <stdio.h>
#include <mono/utils/mono-publib.h>
+#include <mono/utils/mono-error.h>
MONO_BEGIN_DECLS
MONO_API uint32_t mono_image_get_entry_point (MonoImage *image);
MONO_API const char *mono_image_get_resource (MonoImage *image, uint32_t offset, uint32_t *size);
-MONO_API MonoImage* mono_image_load_file_for_image (MonoImage *image, int fileidx);
+MONO_RT_EXTERNAL_ONLY MONO_API MonoImage* mono_image_load_file_for_image (MonoImage *image, int fileidx);
-MONO_API MonoImage* mono_image_load_module (MonoImage *image, int idx);
+MONO_RT_EXTERNAL_ONLY MONO_API MonoImage* mono_image_load_module (MonoImage *image, int idx);
MONO_API const char* mono_image_get_name (MonoImage *image);
MONO_API const char* mono_image_get_filename (MonoImage *image);
return res;
}
+void
+mono_loader_register_module (const char *name, MonoDl *module)
+{
+ if (!global_module_map)
+ global_module_map = g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_insert (global_module_map, g_strdup (name), module);
+}
+
static MonoDl *internal_module;
static gboolean
g_assert (method != NULL);
g_assert (method->wrapper_type != MONO_WRAPPER_NONE);
- if (method->is_inflated)
- method = ((MonoMethodInflated *) method)->declaring;
data = (void **)((MonoMethodWrapper *)method)->method_data;
g_assert (data != NULL);
g_assert (id <= GPOINTER_TO_UINT (*data));
#include <mono/metadata/metadata.h>
#include <mono/metadata/image.h>
#include <mono/utils/mono-error.h>
+#include <mono/utils/mono-dl.h>
MONO_BEGIN_DECLS
void*
mono_lookup_internal_call_full (MonoMethod *method, mono_bool *uses_handles);
+void
+mono_loader_register_module (const char *name, MonoDl *module);
MONO_API const char*
mono_lookup_icall_symbol (MonoMethod *m);
return info->d.runtime_invoke.method;
else
return NULL;
+ case MONO_WRAPPER_DELEGATE_INVOKE:
+ if (info)
+ return info->d.delegate_invoke.method;
+ else
+ return NULL;
default:
return NULL;
}
struct _MonoImage {
/*
- * The number of assemblies which reference this MonoImage though their 'image'
- * field plus the number of images which reference this MonoImage through their
- * 'modules' field, plus the number of threads holding temporary references to
- * this image between calls of mono_image_open () and mono_image_close ().
+ * This count is incremented during these situations:
+ * - An assembly references this MonoImage though its 'image' field
+ * - This MonoImage is present in the 'files' field of an image
+ * - This MonoImage is present in the 'modules' field of an image
+ * - A thread is holding a temporary reference to this MonoImage between
+ * calls to mono_image_open and mono_image_close ()
*/
int ref_count;
MonoAssembly **references;
int nreferences;
- /* Code files in the assembly. */
+ /* Code files in the assembly. The main assembly has a "file" table and also a "module"
+ * table, where the module table is a subset of the file table. We track both lists,
+ * and because we can lazy-load them at different times we reference-increment both.
+ */
MonoImage **modules;
guint32 module_count;
gboolean *modules_loaded;
- /*
- * Files in the assembly. Items are either NULL or alias items in modules, so this does not impact ref_count.
- * Protected by the image lock.
- */
MonoImage **files;
+ guint32 file_count;
gpointer aot_module;
if (method->signature)
mono_metadata_free_inflated_signature (method->signature);
+ if (method->wrapper_type)
+ g_free (((MonoMethodWrapper*)method)->method_data);
+
g_free (method);
}
mono_counters_init ();
+#ifndef HOST_WIN32
+ mono_w32handle_init ();
+#endif
+
memset (&cb, 0, sizeof (cb));
/* TODO: This casts away an incompatible pointer type warning in the same
manner that boehm-gc does it. This is probably worth investigating
gpointer thread_pinning_ref;
gsize abort_protected_block_count;
gint32 priority;
+ GPtrArray *owned_mutexes;
/*
* These fields are used to avoid having to increment corlib versions
* when a new field is added to this structure.
ves_icall_EnumBuilder_setup_enum_type (MonoReflectionType *enumtype,
MonoReflectionType *t);
-MonoReflectionType*
-ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, MonoString *smodifiers);
-
void
ves_icall_ModuleBuilder_basic_init (MonoReflectionModuleBuilder *moduleb);
info->client_info.signal = 0;
#endif
- /* On win32, stack_start_limit should be 0, since the stack can grow dynamically */
mono_thread_info_get_stack_bounds (&staddr, &stsize);
if (staddr) {
-#ifndef HOST_WIN32
info->client_info.stack_start_limit = staddr;
-#endif
info->client_info.stack_end = staddr + stsize;
} else {
gsize stack_bottom = (gsize)stack_bottom_fallback;
mono_counters_init ();
+#ifndef HOST_WIN32
+ mono_w32handle_init ();
+#endif
+
#ifdef HEAVY_STATISTICS
mono_counters_register ("los marked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_marked_cards);
mono_counters_register ("los array cards scanned ", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_array_cards);
CloseHandle (handle);
- return result != (DWORD)-1;
+ return result != (DWORD)-1 && result > 0;
}
gboolean
MonoSafeHandle *safe_handle;
MonoClassField *field;
- field = mono_class_get_field_from_name (sockobj->vtable->klass, "safe_handle");
+ field = mono_class_get_field_from_name (sockobj->vtable->klass, "m_Handle");
safe_handle = ((MonoSafeHandle *)(*(gpointer *)(((char *)sockobj) + field->offset)));
if (safe_handle == NULL)
enumtype->type = t->type;
}
-MonoReflectionType*
-ves_icall_ModuleBuilder_create_modified_type (MonoReflectionTypeBuilder *tb, MonoString *smodifiers)
-{
- MonoError error;
- MonoReflectionType *ret;
- MonoClass *klass;
- int isbyref = 0, rank;
- char *p;
- char *str = mono_string_to_utf8_checked (smodifiers, &error);
- if (mono_error_set_pending_exception (&error))
- return NULL;
-
- klass = mono_class_from_mono_type (tb->type.type);
- p = str;
- /* logic taken from mono_reflection_parse_type(): keep in sync */
- while (*p) {
- switch (*p) {
- case '&':
- if (isbyref) { /* only one level allowed by the spec */
- g_free (str);
- return NULL;
- }
- isbyref = 1;
- p++;
-
- g_free (str);
-
- ret = mono_type_get_object_checked (mono_object_domain (tb), &klass->this_arg, &error);
- mono_error_set_pending_exception (&error);
-
- return ret;
- case '*':
- klass = mono_ptr_class_get (&klass->byval_arg);
- mono_class_init (klass);
- p++;
- break;
- case '[':
- rank = 1;
- p++;
- while (*p) {
- if (*p == ']')
- break;
- if (*p == ',')
- rank++;
- else if (*p != '*') { /* '*' means unknown lower bound */
- g_free (str);
- return NULL;
- }
- ++p;
- }
- if (*p != ']') {
- g_free (str);
- return NULL;
- }
- p++;
- klass = mono_array_class_get (klass, rank);
- mono_class_init (klass);
- break;
- default:
- break;
- }
- }
-
- g_free (str);
-
- ret = mono_type_get_object_checked (mono_object_domain (tb), &klass->byval_arg, &error);
- mono_error_set_pending_exception (&error);
-
- return ret;
-}
-
void
ves_icall_ModuleBuilder_basic_init (MonoReflectionModuleBuilder *moduleb)
{
typedef struct {
gint32 ref;
- MonoCoopSem sem;
+ MonoCoopCond cond;
} ThreadPoolDomainCleanupSemaphore;
typedef enum {
ThreadPoolDomainCleanupSemaphore *cleanup_semaphore;
cleanup_semaphore = g_new0 (ThreadPoolDomainCleanupSemaphore, 1);
cleanup_semaphore->ref = 2;
- mono_coop_sem_init (&cleanup_semaphore->sem, 0);
+ mono_coop_cond_init (&cleanup_semaphore->cond);
g_assert(!domain->cleanup_semaphore);
domain->cleanup_semaphore = cleanup_semaphore;
g_assert (removed);
cleanup_semaphore = (ThreadPoolDomainCleanupSemaphore*) tpdomain->domain->cleanup_semaphore;
+ g_assert (cleanup_semaphore);
+
+ mono_coop_cond_signal (&cleanup_semaphore->cond);
- g_assert(cleanup_semaphore);
- mono_coop_sem_post (&cleanup_semaphore->sem);
if (InterlockedDecrement (&cleanup_semaphore->ref) == 0) {
- mono_coop_sem_destroy (&cleanup_semaphore->sem);
+ mono_coop_cond_destroy (&cleanup_semaphore->cond);
g_free (cleanup_semaphore);
tpdomain->domain->cleanup_semaphore = NULL;
}
gboolean
mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout)
{
- gint res;
- gint64 now, end;
+ gint64 end;
ThreadPoolDomain *tpdomain;
ThreadPoolDomainCleanupSemaphore *cleanup_semaphore;
+ gboolean ret;
g_assert (domain);
g_assert (timeout >= -1);
return TRUE;
}
- mono_coop_mutex_unlock(&threadpool->domains_lock);
-
g_assert (domain->cleanup_semaphore);
-
cleanup_semaphore = (ThreadPoolDomainCleanupSemaphore*) domain->cleanup_semaphore;
- if (timeout == -1) {
- res = mono_coop_sem_wait (&cleanup_semaphore->sem, MONO_SEM_FLAGS_NONE);
- g_assert (res == MONO_SEM_TIMEDWAIT_RET_SUCCESS);
- } else {
- now = mono_msec_ticks();
- if (now > end)
- return FALSE;
- res = mono_coop_sem_timedwait (&cleanup_semaphore->sem, end - now, MONO_SEM_FLAGS_NONE);
- }
+ ret = TRUE;
+
+ do {
+ if (timeout == -1) {
+ mono_coop_cond_wait (&cleanup_semaphore->cond, &threadpool->domains_lock);
+ } else {
+ gint64 now;
+ gint res;
+
+ now = mono_msec_ticks();
+ if (now > end) {
+ ret = FALSE;
+ break;
+ }
+
+ res = mono_coop_cond_timedwait (&cleanup_semaphore->cond, &threadpool->domains_lock, end - now);
+ if (res != 0) {
+ ret = FALSE;
+ break;
+ }
+ }
+ } while (tpdomain->outstanding_request != 0);
if (InterlockedDecrement (&cleanup_semaphore->ref) == 0) {
- mono_coop_sem_destroy (&cleanup_semaphore->sem);
+ mono_coop_cond_destroy (&cleanup_semaphore->cond);
g_free (cleanup_semaphore);
domain->cleanup_semaphore = NULL;
}
- return res == MONO_SEM_TIMEDWAIT_RET_SUCCESS;
+ mono_coop_mutex_unlock(&threadpool->domains_lock);
+
+ return ret;
}
void
void
mono_thread_internal_describe (MonoInternalThread *internal, GString *str);
+gboolean
+mono_thread_internal_is_current (MonoInternalThread *internal);
+
#endif /* _MONO_METADATA_THREADS_TYPES_H_ */
#include <mono/utils/mono-error-internals.h>
#include <mono/utils/w32handle.h>
#include <mono/metadata/w32event.h>
+#include <mono/metadata/w32mutex.h>
#include <mono/metadata/gc-internals.h>
#include <mono/metadata/reflection-internals.h>
THREAD_DEBUG (g_message ("%s: mono_thread_detach for %p (%"G_GSIZE_FORMAT")", __func__, thread, (gsize)thread->tid));
+#ifndef HOST_WIN32
+ mono_w32mutex_abandon ();
+#endif
+
thread_cleanup (thread);
SET_CURRENT_OBJECT (NULL);
void
mono_thread_internal_describe (MonoInternalThread *internal, GString *text)
{
- MonoThreadInfo *info;
-
g_string_append_printf (text, ", thread handle : %p", internal->handle);
- info = (MonoThreadInfo*) internal->thread_info;
- if (!info)
- return;
-
- g_string_append (text, ", state : ");
- mono_thread_info_describe_interrupt_token (info, text);
+ if (internal->thread_info) {
+ g_string_append (text, ", state : ");
+ mono_thread_info_describe_interrupt_token ((MonoThreadInfo*) internal->thread_info, text);
+ }
- if (info->owned_mutexes) {
+ if (internal->owned_mutexes) {
int i;
g_string_append (text, ", owns : [");
- for (i = 0; i < info->owned_mutexes->len; i++)
- g_string_append_printf (text, i == 0 ? "%p" : ", %p", g_ptr_array_index (info->owned_mutexes, i));
+ for (i = 0; i < internal->owned_mutexes->len; i++)
+ g_string_append_printf (text, i == 0 ? "%p" : ", %p", g_ptr_array_index (internal->owned_mutexes, i));
g_string_append (text, "]");
}
}
+
+gboolean
+mono_thread_internal_is_current (MonoInternalThread *internal)
+{
+ g_assert (internal);
+ return mono_native_thread_id_equals (mono_native_thread_id_get (), MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid));
+}
*/
#include "w32mutex.h"
-#include "w32mutex-utils.h"
#include <pthread.h>
#include "w32handle-namespace.h"
#include "mono/io-layer/io-layer.h"
+#include "mono/metadata/object-internals.h"
#include "mono/utils/mono-logger-internals.h"
#include "mono/utils/mono-threads.h"
#include "mono/utils/w32handle.h"
MonoW32HandleNamespace sharedns;
};
+static void
+thread_own_mutex (MonoInternalThread *internal, gpointer handle)
+{
+ mono_w32handle_ref (handle);
+
+ /* if we are not on the current thread, there is a
+ * race condition when allocating internal->owned_mutexes */
+ g_assert (mono_thread_internal_is_current (internal));
+
+ if (!internal->owned_mutexes)
+ internal->owned_mutexes = g_ptr_array_new ();
+
+ g_ptr_array_add (internal->owned_mutexes, handle);
+}
+
+static void
+thread_disown_mutex (MonoInternalThread *internal, gpointer handle)
+{
+ gboolean removed;
+
+ g_assert (mono_thread_internal_is_current (internal));
+
+ g_assert (internal->owned_mutexes);
+ removed = g_ptr_array_remove (internal->owned_mutexes, handle);
+ g_assert (removed);
+
+ mono_w32handle_unref (handle);
+}
+
static gboolean
mutex_handle_own (gpointer handle, MonoW32HandleType type, guint32 *statuscode)
{
return FALSE;
}
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: owning %s handle %p, tid %p, recursion %u",
- __func__, mono_w32handle_ops_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: owning %s handle %p, before: [tid: %p, recursion: %d], after: [tid: %p, recursion: %d], abandoned: %s",
+ __func__, mono_w32handle_ops_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion, (gpointer) pthread_self (), mutex_handle->recursion + 1, mutex_handle->abandoned ? "true" : "false");
+
+ if (mutex_handle->recursion != 0) {
+ g_assert (pthread_equal (pthread_self (), mutex_handle->tid));
+ mutex_handle->recursion++;
+ } else {
+ mutex_handle->tid = pthread_self ();
+ mutex_handle->recursion = 1;
- mono_thread_info_own_mutex (mono_thread_info_current (), handle);
+ thread_own_mutex (mono_thread_internal_current (), handle);
+ }
- mutex_handle->tid = pthread_self ();
- mutex_handle->recursion++;
if (mutex_handle->abandoned) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: mutex handle %p was abandoned", __func__, handle);
mutex_handle->abandoned = FALSE;
*statuscode = WAIT_ABANDONED_0;
}
__func__, mono_w32handle_ops_typename (type), handle, (gpointer) pthread_self ());
return TRUE;
} else {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: %s handle %p not owned by %p, but locked %d times by %p",
- __func__, mono_w32handle_ops_typename (type), handle, (gpointer) pthread_self (), mutex_handle->recursion, (gpointer) mutex_handle->tid);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: %s handle %p not owned by %p, tid: %p recursion: %d",
+ __func__, mono_w32handle_ops_typename (type), handle, (gpointer) pthread_self (), (gpointer) mutex_handle->tid, mutex_handle->recursion);
return FALSE;
}
}
return FALSE;
}
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: releasing %s handle %p",
- __func__, mono_w32handle_ops_typename (type), handle);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: releasing %s handle %p, tid: %p recursion: %d",
+ __func__, mono_w32handle_ops_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion);
thr_ret = mono_w32handle_lock_handle (handle);
g_assert (thr_ret == 0);
mutex_handle->recursion--;
if (mutex_handle->recursion == 0) {
- mono_thread_info_disown_mutex (mono_thread_info_current (), handle);
+ thread_disown_mutex (mono_thread_internal_current (), handle);
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unlocking %s handle %p",
- __func__, mono_w32handle_ops_typename (type), handle);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: unlocking %s handle %p, tid: %p recusion : %d",
+ __func__, mono_w32handle_ops_typename (type), handle, (gpointer) mutex_handle->tid, mutex_handle->recursion);
mutex_handle->tid = 0;
mono_w32handle_set_signal_state (handle, TRUE, FALSE);
}
void
-mono_w32mutex_abandon (gpointer handle, MonoNativeThreadId tid)
+mono_w32mutex_abandon (void)
{
- MonoW32HandleType type;
- MonoW32HandleMutex *mutex_handle;
- int thr_ret;
+ MonoInternalThread *internal;
- switch (type = mono_w32handle_get_type (handle)) {
- case MONO_W32HANDLE_MUTEX:
- case MONO_W32HANDLE_NAMEDMUTEX:
- break;
- default:
- g_assert_not_reached ();
- }
+ g_assert (mono_thread_internal_current_is_attached ());
- if (!mono_w32handle_lookup (handle, type, (gpointer *)&mutex_handle)) {
- g_warning ("%s: error looking up %s handle %p",
- __func__, mono_w32handle_ops_typename (type), handle);
+ internal = mono_thread_internal_current ();
+ g_assert (internal);
+
+ if (!internal->owned_mutexes)
return;
- }
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: abandon %s handle %p",
- __func__, mono_w32handle_ops_typename (type), handle);
+ while (internal->owned_mutexes->len) {
+ MonoW32HandleType type;
+ MonoW32HandleMutex *mutex_handle;
+ MonoNativeThreadId tid;
+ gpointer handle;
+ int thr_ret;
+
+ handle = g_ptr_array_index (internal->owned_mutexes, 0);
+
+ switch (type = mono_w32handle_get_type (handle)) {
+ case MONO_W32HANDLE_MUTEX:
+ case MONO_W32HANDLE_NAMEDMUTEX:
+ break;
+ default:
+ g_assert_not_reached ();
+ }
- thr_ret = mono_w32handle_lock_handle (handle);
- g_assert (thr_ret == 0);
+ if (!mono_w32handle_lookup (handle, type, (gpointer *)&mutex_handle)) {
+ g_error ("%s: error looking up %s handle %p",
+ __func__, mono_w32handle_ops_typename (type), handle);
+ }
+
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: abandoning %s handle %p",
+ __func__, mono_w32handle_ops_typename (type), handle);
+
+ tid = MONO_UINT_TO_NATIVE_THREAD_ID (internal->tid);
+
+ if (!pthread_equal (mutex_handle->tid, tid))
+ g_error ("%s: trying to release mutex %p acquired by thread %p from thread %p",
+ __func__, handle, (gpointer) mutex_handle->tid, (gpointer) tid);
+
+ thr_ret = mono_w32handle_lock_handle (handle);
+ g_assert (thr_ret == 0);
- if (pthread_equal (mutex_handle->tid, tid)) {
mutex_handle->recursion = 0;
mutex_handle->tid = 0;
mutex_handle->abandoned = TRUE;
mono_w32handle_set_signal_state (handle, TRUE, FALSE);
+ thread_disown_mutex (internal, handle);
+
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: abandoned %s handle %p",
__func__, mono_w32handle_ops_typename (type), handle);
+
+ thr_ret = mono_w32handle_unlock_handle (handle);
+ g_assert (thr_ret == 0);
}
- thr_ret = mono_w32handle_unlock_handle (handle);
- g_assert (thr_ret == 0);
+ g_ptr_array_free (internal->owned_mutexes, TRUE);
+ internal->owned_mutexes = NULL;
}
MonoW32HandleNamespace*
+++ /dev/null
-
-/* This is just a hack so we can call mono_w32mutex_abandon
- * from mono/utils/mono-threads-posix.c, without importing
- * the whole object.h
- * In the best of all world, mutex owning + disowning + abandoning
- * should be done in metadata/ */
-
-#ifndef _MONO_METADATA_W32MUTEX_UTILS_H_
-#define _MONO_METADATA_W32MUTEX_UTILS_H_
-
-#include <config.h>
-#include <glib.h>
-
-#include "mono/utils/mono-threads.h"
-
-void
-mono_w32mutex_abandon (gpointer handle, MonoNativeThreadId tid);
-
-#endif /* _MONO_METADATA_W32MUTEX_UTILS_H_ */
-
MonoW32HandleNamespace*
mono_w32mutex_get_namespace (MonoW32HandleNamedMutex *mutex);
+#ifndef HOST_WIN32
+void
+mono_w32mutex_abandon (void);
+#endif
+
#endif /* _MONO_METADATA_W32MUTEX_H_ */
gboolean gas_line_numbers;
/* Whenever to emit an object file directly from llc */
gboolean llvm_owriter;
+ gboolean llvm_owriter_supported;
MonoImageWriter *w;
MonoDwarfWriter *dwarf;
FILE *fp;
{
acfg->llc_args = g_string_new ("");
acfg->as_args = g_string_new ("");
+ acfg->llvm_owriter_supported = TRUE;
/*
* The prefix LLVM likes to put in front of symbol names on darwin.
#ifdef MONOTOUCH
acfg->global_symbols = TRUE;
#endif
+
+#ifdef TARGET_ANDROID
+ acfg->llvm_owriter_supported = FALSE;
+#endif
}
#ifdef TARGET_ARM64
wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
#else
// Default (linux)
- char *args = g_strdup_printf ("%s -shared -o %s %s %s %s", LD_OPTIONS,
- wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
- wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
-
- if (acfg->llvm) {
- command = g_strdup_printf ("clang++ %s", args);
+ if (acfg->aot_opts.tool_prefix) {
+ /* Cross compiling */
+ command = g_strdup_printf ("\"%sld\" %s -shared -o %s %s %s %s", tool_prefix, LD_OPTIONS,
+ wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
+ wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
} else {
- command = g_strdup_printf ("\"%sld\" %s", tool_prefix, args);
+ char *args = g_strdup_printf ("%s -shared -o %s %s %s %s", LD_OPTIONS,
+ wrap_path (tmp_outfile_name), wrap_path (llvm_ofile),
+ wrap_path (g_strdup_printf ("%s.o", acfg->tmpfname)), ld_flags);
+
+ if (acfg->llvm) {
+ command = g_strdup_printf ("clang++ %s", args);
+ } else {
+ command = g_strdup_printf ("\"%sld\" %s", tool_prefix, args);
+ }
+ g_free (args);
}
- g_free (args);
#endif
aot_printf (acfg, "Executing the native linker: %s\n", command);
aot_printerrf (acfg, "Compiling with LLVM and the asm-only option requires the llvm-outputfile= option.");
return 1;
}
-
- /*
- * Emit all LLVM code into a separate assembly/object file and link with it
- * normally.
- */
- if (!acfg->aot_opts.asm_only) {
- acfg->llvm_owriter = TRUE;
- } else if (acfg->aot_opts.llvm_outfile) {
- int len = strlen (acfg->aot_opts.llvm_outfile);
-
- if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
- acfg->llvm_owriter = TRUE;
- }
}
if (mono_aot_mode_is_full (&acfg->aot_opts))
arch_init (acfg);
+ if (mono_use_llvm || acfg->aot_opts.llvm) {
+
+ /*
+ * Emit all LLVM code into a separate assembly/object file and link with it
+ * normally.
+ */
+ if (!acfg->aot_opts.asm_only && acfg->llvm_owriter_supported) {
+ acfg->llvm_owriter = TRUE;
+ } else if (acfg->aot_opts.llvm_outfile) {
+ int len = strlen (acfg->aot_opts.llvm_outfile);
+
+ if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
+ acfg->llvm_owriter = TRUE;
+ }
+ }
+
if (acfg->llvm && acfg->thumb_mixed)
acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_LLVM_THUMB);
if (acfg->aot_opts.llvm_only)
break;
}
- /*
- * Special case: wrappers of shared generic methods.
- * This is needed because of the way mini_get_shared_method () works,
- * we could end up with multiple copies of the same wrapper.
- */
- if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
- method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
- MonoMethod *w1 = mono_marshal_method_from_wrapper (method);
- MonoMethod *w2 = mono_marshal_method_from_wrapper (m);
-
- if ((w1 == w2) || (w1->is_inflated && ((MonoMethodInflated *)w1)->declaring == w2)) {
- index = value;
- break;
- }
- }
- if (m && method->wrapper_type && method->wrapper_type == m->wrapper_type &&
- method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
- WrapperInfo *info1 = mono_marshal_get_wrapper_info (method);
- WrapperInfo *info2 = mono_marshal_get_wrapper_info (m);
-
- if (info1 && info2 && info1->subtype == info2->subtype && info1->d.delegate_invoke.method == info2->d.delegate_invoke.method) {
- index = value;
- break;
- }
- }
-
/* Methods decoded needlessly */
if (m) {
//printf ("%d %s %s %p\n", n_extra_decodes, mono_method_full_name (method, TRUE), mono_method_full_name (m, TRUE), orig_p);
#define HEADER_LENGTH 11
#define MAJOR_VERSION 2
-#define MINOR_VERSION 43
+#define MINOR_VERSION 44
typedef enum {
CMD_SET_VM = 1,
CMD_STACK_FRAME_GET_THIS = 2,
CMD_STACK_FRAME_SET_VALUES = 3,
CMD_STACK_FRAME_GET_DOMAIN = 4,
+ CMD_STACK_FRAME_SET_THIS = 5,
} CmdStackFrame;
typedef enum {
buffer_add_domainid (buf, frame->domain);
break;
}
+ case CMD_STACK_FRAME_SET_THIS: {
+ guint8 *val_buf;
+ MonoType *t;
+ MonoDebugVarInfo *var;
+
+ t = &frame->actual_method->klass->byval_arg;
+ /* Checked by the sender */
+ g_assert (MONO_TYPE_ISSTRUCT (t));
+ var = jit->this_var;
+ g_assert (var);
+
+ val_buf = (guint8 *)g_alloca (mono_class_instance_size (mono_class_from_mono_type (t)));
+ err = decode_value (t, frame->domain, val_buf, p, &p, end);
+ if (err != ERR_NONE)
+ return err;
+
+ set_var (&frame->actual_method->klass->this_arg, var, &frame->ctx, frame->domain, val_buf, frame->reg_locations, &tls->restore_state.ctx);
+ break;
+ }
default:
return ERR_NOT_IMPLEMENTED;
}
"GET_THIS",
"SET_VALUES",
"GET_DOMAIN",
+ "SET_THIS"
};
static const char* array_cmds_str[] = {
#ifdef HAVE_EXECVP
execvp (path->str, argv);
+ fprintf (stderr, "Error: Failed to switch to %s gc. mono-%s is not installed.\n", target_gc, target_gc);
#else
fprintf (stderr, "Error: --gc=<NAME> option not supported on this platform.\n");
#endif
}
}
+/*
+ * Macros used to generate intermediate representation macros
+ *
+ * The macros use a `MonoConfig` object as its context, and among other
+ * things it is used to associate instructions with the memory pool with
+ * it.
+ *
+ * The macros come in three variations with slightly different
+ * features, the patter is: NEW_OP, EMIT_NEW_OP, MONO_EMIT_NEW_OP,
+ * the differences are as follows:
+ *
+ * `NEW_OP`: these are the basic macros to setup an instruction that is
+ * passed as an argument.
+ *
+ * `EMIT_NEW_OP`: these macros in addition to creating the instruction
+ * add the instruction to the current basic block in the `MonoConfig`
+ * object passed. Usually these are used when further customization of
+ * the `inst` parameter is desired before the instruction is added to the
+ * MonoConfig current basic block.
+ *
+ * `MONO_EMIT_NEW_OP`: These variations of the instructions are used when
+ * you are merely interested in emitting the instruction into the `MonoConfig`
+ * parameter.
+ */
#undef MONO_INST_NEW
/*
* FIXME: zeroing out some fields is not needed with the new IR, but the old
* JIT code still uses the left and right fields, so it has to stay.
*/
+
+/*
+ * MONO_INST_NEW: create a new MonoInst instance that is allocated on the MonoConfig pool.
+ *
+ * @cfg: the MonoConfig object that will be used as the context for the
+ * instruction.
+ * @dest: this is the place where the instance of the `MonoInst` is stored.
+ * @op: the value that should be stored in the MonoInst.opcode field
+ *
+ * This initializes an empty MonoInst that has been nulled out, it is allocated
+ * from the memory pool associated with the MonoConfig, but it is not linked anywhere.
+ * the cil_code is set to the cfg->ip address.
+ */
#define MONO_INST_NEW(cfg,dest,op) do { \
(dest) = (MonoInst *)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoInst)); \
(dest)->inst_c0 = (dest)->inst_c1 = 0; \
+/*
+ * main.c: The main entry point for the mono executable
+ *
+ * The main entry point does a few things:
+ *
+ * * It probes whether the executable has a bundle appended
+ * at the end, and if so, registers the various bundled
+ * resources with Mono and executes the contained bundle
+ *
+ * * Parses the MONO_ENV_OPTIONS variable to treat the
+ * contents of the variable as command line arguments for
+ * the mono runtime
+ *
+ * * Launches Mono, by calling mono_main.
+ */
#include <config.h>
#include <fcntl.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/mono-config.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-dl.h>
#include "mini.h"
#ifdef HAVE_UNISTD_H
return mono_main (argc, argv);
}
+/*
+ * The Mono executable can initialize itself from a payload attached
+ * at the end of the main program. The payload contains the
+ * main assembly, one or more managed assemblies, configuration
+ * files and other assets that are used instead of launching a
+ * program from the command line.
+ *
+ * The startup sequence probes for a magical signature at the end of
+ * the executable, if the 16 characters "xmonkeysloveplay" are found,
+ * the code expects the 64-bits just before it to contain an offset
+ * within the executable with a directory of assets.
+ *
+ * All pointers in the file format are encoded as little-endian values
+ *
+ * The format of the file is thus:
+ *
+ * Location Content
+ * -------- -------
+ * lenght-16 Optional "xmonkeysloveplay", indicating that a
+ * bundled payload is contained in the executable.
+ * length-24 pointer to the directory in the file, address DIR
+ *
+ * DIR 32-bit value with the number of entries in the directory
+ * DIR+4 First directory entry.
+ *
+ * Each directory entry is made up of:
+ * 4-bytes uint32_t containing the size of a string (STR)
+ * STRING UTF8 encoded and \0 terminated string
+ * 8-bytes uint64_t offset in the file with the payload associated with STRING
+ * 4-bytes uint32_t size of the asset
+ *
+ * The following are the known directory entries, without the quotes:
+ * "assembly:NAME" An assembly with the name NAME, assembly is in the payload
+ * "config:NAME" A configuration file (usually file.dll.config) in the payload that is
+ * loaded as the config file for an assembly
+ * "systemconfig:" Treats as a Mono system configuration, payload contains the config file.
+ * "options:" The payload contains command line options to initialize Mono, as if you
+ had set them on MONO_ENV_OPTIONS
+ * "config_dir:DIR" Configures the MONO_PATH to point to point to DIR
+ * "machineconfig:" The payload contains the machine.config file to use at runtime
+ * "env:" Sets the environment variable to the value encoded in the payload
+ * payload contains: 1-byte lenght for the \0 terminated variable,
+ * followed by the value.
+ * "library:NAME" Bundled dynamic library NAME, payload contains the dynamic library
+ */
#define STREAM_INT(x) GUINT32_TO_LE((*(uint32_t*)x))
#define STREAM_LONG(x) GUINT64_TO_LE((*(uint64_t*)x))
return buffer;
}
+/* Did we initialize the temporary directory for dynamic libraries */
+static int bundle_save_library_initialized;
+
+/* List of bundled libraries we unpacked */
+static GSList *bundle_library_paths;
+
+/* Directory where we unpacked dynamic libraries */
+static char *bundled_dylibrary_directory;
+
+static void
+delete_bundled_libraries ()
+{
+ GSList *list;
+
+ for (list = bundle_library_paths; list != NULL; list = list->next){
+ unlink (list->data);
+ }
+ rmdir (bundled_dylibrary_directory);
+}
+
+static void
+bundle_save_library_initialize ()
+{
+ bundle_save_library_initialized = 1;
+ char *path = g_build_filename (g_get_tmp_dir (), "mono-bundle-XXXXXX");
+ bundled_dylibrary_directory = g_mkdtemp (path);
+ g_free (path);
+ if (bundled_dylibrary_directory == NULL)
+ return;
+ atexit (delete_bundled_libraries);
+}
+
+static void
+save_library (int fd, uint64_t offset, uint64_t size, const char *destfname)
+{
+ MonoDl *lib;
+ char *file, *buffer, *err;
+ if (!bundle_save_library_initialized)
+ bundle_save_library_initialize ();
+
+ file = g_build_filename (bundled_dylibrary_directory, destfname);
+ buffer = load_from_region (fd, offset, size);
+ g_file_set_contents (file, buffer, size, NULL);
+ lib = mono_dl_open (file, MONO_DL_LAZY, &err);
+ if (err != NULL){
+ fprintf (stderr, "Error loading shared library: %s\n", file);
+ exit (1);
+ }
+ mono_loader_register_module (destfname, lib);
+ bundle_library_paths = g_slist_append (bundle_library_paths, file);
+
+ g_free (buffer);
+}
+
static gboolean
probe_embedded (const char *program, int *ref_argc, char **ref_argv [])
{
uint8_t count = *data++;
char *value = data + count + 1;
g_setenv (data, value, FALSE);
+ } else if (strncmp (kind, "library:", strlen ("library:")) == 0){
+ save_library (fd, offset, item_size, kind + strlen ("library:"));
} else {
fprintf (stderr, "Unknown stream on embedded package: %s\n", kind);
exit (1);
}
}
g_array_append_val (assemblies, last);
-
+
mono_register_bundled_assemblies ((const MonoBundledAssembly **) assemblies->data);
new_argv = g_new (char *, (*ref_argc)+1);
for (j = 0; j < *ref_argc; j++)
return NULL;
} else if (cmethod->klass == mono_defaults.monitor_class) {
gboolean is_enter = FALSE;
+ gboolean is_v4 = FALSE;
- if (!strcmp (cmethod->name, "Enter") && mono_method_signature (cmethod)->param_count == 1)
+ if (!strcmp (cmethod->name, "Enter") && fsig->param_count == 2 && fsig->params [1]->byref) {
+ is_enter = TRUE;
+ is_v4 = TRUE;
+ }
+ if (!strcmp (cmethod->name, "Enter") && fsig->param_count == 1)
is_enter = TRUE;
if (is_enter) {
NEW_BBLOCK (cfg, end_bb);
- ins = mono_emit_jit_icall (cfg, (gpointer)mono_monitor_enter_fast, args);
+ ins = mono_emit_jit_icall (cfg, is_v4 ? (gpointer)mono_monitor_enter_v4_fast : (gpointer)mono_monitor_enter_fast, args);
MONO_EMIT_NEW_BIALU_IMM (cfg, OP_ICOMPARE_IMM, -1, ins->dreg, 0);
MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_IBNE_UN, end_bb);
- ins = mono_emit_jit_icall (cfg, (gpointer)mono_monitor_enter, args);
+ ins = mono_emit_jit_icall (cfg, is_v4 ? (gpointer)mono_monitor_enter_v4 : (gpointer)mono_monitor_enter, args);
MONO_START_BB (cfg, end_bb);
return ins;
}
{
switch (relocation) {
case MONO_R_ARM64_B:
- arm_b (code, target);
+ if (arm_is_bl_disp (code, target)) {
+ arm_b (code, target);
+ } else {
+ gpointer thunk;
+
+ thunk = create_thunk (cfg, domain, code, target);
+ g_assert (arm_is_bl_disp (code, thunk));
+ arm_b (code, thunk);
+ }
break;
case MONO_R_ARM64_BCC: {
int cond;
thunk = create_thunk (cfg, domain, code, target);
g_assert (arm_is_bl_disp (code, thunk));
- arm_bl (code, thunk);
+ arm_bl (code, thunk);
}
break;
default:
MonoGenericContext *context = mono_method_get_context (method);
MonoGenericInst *inst;
+ /*
+ * Instead of creating a shared version of the wrapper, create a shared version of the original
+ * method and construct a wrapper for it. Otherwise, we could end up with two copies of the
+ * same wrapper, breaking AOT which assumes wrappers are unique.
+ * FIXME: Add other cases.
+ */
+ if (method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
+ MonoMethod *wrapper = mono_marshal_method_from_wrapper (method);
+
+ return mono_marshal_get_synchronized_wrapper (mini_get_shared_method_full (wrapper, all_vt, is_gsharedvt));
+ }
+ if (method->wrapper_type == MONO_WRAPPER_DELEGATE_INVOKE) {
+ WrapperInfo *info = mono_marshal_get_wrapper_info (method);
+
+ if (info->subtype == WRAPPER_SUBTYPE_NONE)
+ return mono_marshal_get_delegate_invoke (mini_get_shared_method_full (info->d.delegate_invoke.method, all_vt, is_gsharedvt), NULL);
+ }
+
if (method->is_generic || (method->klass->generic_container && !method->is_inflated)) {
declaring_method = method;
} else {
if (callee_array_helper) {
add_static_rgctx_tramp = FALSE;
- /* FIXME: ji->from_aot is not set for llvm methods */
- if (ji && (ji->from_aot || mono_aot_only)) {
- /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
- if (!mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
- add_static_rgctx_tramp = TRUE;
- }
+ /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
+ if (ji && !mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
+ add_static_rgctx_tramp = TRUE;
}
if (mono_llvm_only)
FEATUREFUL_RUNTIME_TEST = test-appdomain-unload
endif
-check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-cattr-type-load test-reflection-load-with-context test_platform \
+check-local: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test-multi-netmodule test-cattr-type-load test-reflection-load-with-context test_platform \
test-console-output test-messages test-env-options test-unhandled-exception-2 $(FEATUREFUL_RUNTIME_TEST) test-process-stress rm-empty-logs
check-full: test-sgen check-local
check-parallel: compile-tests check-full
@echo "Testing load-exception.exe..."
@$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
+EXTRA_DIST += test-multi-netmodule-1-netmodule.cs test-multi-netmodule-2-dll1.cs test-multi-netmodule-3-dll2.cs test-multi-netmodule-4-exe.cs
+test-multi-netmodule:
+ @$(MCS) -t:module test-multi-netmodule-1-netmodule.cs
+ @$(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library test-multi-netmodule-2-dll1.cs
+ @$(MCS) -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library test-multi-netmodule-3-dll2.cs
+ @$(MCS) -r:test-multi-netmodule-2-dll1.dll test-multi-netmodule-4-exe.cs
+ $(RUNTIME) test-multi-netmodule-4-exe.exe > test-multi-netmodule-4-exe.exe.stdout 2> test-multi-netmodule-4-exe.exe.stderr
+
EXTRA_DIST += custom-attr-errors.cs custom-attr-errors-lib.cs
test-cattr-type-load: $(TEST_DRIVER_DEPEND) custom-attr-errors.cs custom-attr-errors-lib.cs
$(MCS) -D:WITH_MEMBERS /t:library $(srcdir)/custom-attr-errors-lib.cs
--- /dev/null
+// Compiler options: -t:module
+
+public class M1 {
+}
--- /dev/null
+// Compiler options: -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library
+
+public class M2 {
+ public M1 m1 = new M1();
+}
--- /dev/null
+// Compiler options: -addmodule:test-multi-netmodule-1-netmodule.netmodule -t:library
+
+public class M3 {
+ public M1 m1 = new M1();
+}
--- /dev/null
+// Compiler options: -r:test-multi-netmodule-2-dll1.dll
+
+using System;
+using System.Reflection;
+
+public class M4 {
+ public static int Main () {
+ M2 m2 = new M2();
+
+ // Expecting failure
+ try {
+ var DLL = Assembly.LoadFile(@"test-multi-netmodule-3-dll2.dll");
+ var m3Type = DLL.GetType("M3");
+ var m3 = Activator.CreateInstance(m3Type);
+ var m3m1Field = m3Type.GetField("m1");
+
+ Console.WriteLine("M3 assembly:" + m3Type.Assembly);
+ Console.WriteLine("M3.M1 assembly:" + m3m1Field.DeclaringType.Assembly);
+ } catch (System.TypeLoadException) {
+ return 0;
+ }
+
+ Console.WriteLine("M2 assembly:" + typeof (M2).Assembly);
+ Console.WriteLine("M2.M1 assembly:" + m2.m1.GetType().Assembly);
+
+ return 1;
+ }
+}
// For each queued image visit all directly referenced images
int inner_idx;
+ // 'files' and 'modules' semantically contain the same items but because of lazy loading we must check both
+ for (inner_idx = 0; !success && inner_idx < checking->file_count; inner_idx++)
+ {
+ CHECK_IMAGE_VISIT (checking->files[inner_idx]);
+ }
+
for (inner_idx = 0; !success && inner_idx < checking->module_count; inner_idx++)
{
CHECK_IMAGE_VISIT (checking->modules[inner_idx]);
for (inner_idx = 0; !success && inner_idx < checking->nreferences; inner_idx++)
{
- // References are lazy-loaded and thus allowed to be NULL.
- // If they are NULL, we don't care about them for this search, because they haven't impacted ref_count yet.
+ // Assembly references are lazy-loaded and thus allowed to be NULL.
+ // If they are NULL, we don't care about them for this search, because their images haven't impacted ref_count yet.
if (checking->references[inner_idx])
{
CHECK_IMAGE_VISIT (checking->references[inner_idx]->image);
if (to->images[to_idx] == mono_defaults.corlib)
seen = TRUE;
- // For each item in to->images, scan over from->images looking for it.
+ // For each item in to->images, scan over from->images seeking a path to it.
for (from_idx = 0; !seen && from_idx < from->nimages; from_idx++)
{
- if (to->images[to_idx] == from->images[from_idx])
+ if (check_image_may_reference_image (from->images[from_idx], to->images[to_idx]))
seen = TRUE;
}
return mono_process_get_data (GINT_TO_POINTER (mono_process_current_pid ()), MONO_PROCESS_FAULTS);
}
+
+// If cpu_load gets inlined on Windows then cpu_load_1min, cpu_load_5min and cpu_load_15min can be folded into a single function and that will
+// cause a failure when registering counters since the same function address will be used by all three functions. Preventing this method from being inlined
+// will make sure the registered callback functions remains unique.
+#ifdef _MSC_VER
+__declspec(noinline)
+#endif
static double
cpu_load (int kind)
{
#include <mono/utils/mono-threads-posix-signals.h>
#include <mono/utils/mono-coop-semaphore.h>
#include <mono/metadata/gc-internals.h>
-#include <mono/metadata/w32mutex-utils.h>
#include <mono/utils/w32handle.h>
#include <errno.h>
{
gpointer thread_handle;
- info->owned_mutexes = g_ptr_array_new ();
-
thread_handle = mono_w32handle_new (MONO_W32HANDLE_THREAD, NULL);
if (thread_handle == INVALID_HANDLE_VALUE)
g_error ("%s: failed to create handle", __func__);
void
mono_threads_platform_set_exited (MonoThreadInfo *info)
{
- gpointer mutex_handle;
- int i, thr_ret;
- pthread_t tid;
+ int thr_ret;
g_assert (info->handle);
-
if (mono_w32handle_issignalled (info->handle))
g_error ("%s: handle %p thread %p has already exited, it's handle is signalled", __func__, info->handle, mono_thread_info_get_tid (info));
if (mono_w32handle_get_type (info->handle) == MONO_W32HANDLE_UNUSED)
g_error ("%s: handle %p thread %p has already exited, it's handle type is 'unused'", __func__, info->handle, mono_thread_info_get_tid (info));
- tid = pthread_self ();
-
- for (i = 0; i < info->owned_mutexes->len; i++) {
- mutex_handle = g_ptr_array_index (info->owned_mutexes, i);
- mono_w32mutex_abandon (mutex_handle, tid);
- mono_thread_info_disown_mutex (info, mutex_handle);
- }
-
- g_ptr_array_free (info->owned_mutexes, TRUE);
-
thr_ret = mono_w32handle_lock_handle (info->handle);
g_assert (thr_ret == 0);
info->handle = NULL;
}
-void
-mono_threads_platform_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- mono_w32handle_ref (mutex_handle);
-
- g_ptr_array_add (info->owned_mutexes, mutex_handle);
-}
-
-void
-mono_threads_platform_disown_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- mono_w32handle_unref (mutex_handle);
-
- g_ptr_array_remove (info->owned_mutexes, mutex_handle);
-}
-
static const gchar* thread_typename (void)
{
return "Thread";
info->handle = NULL;
}
-void
-mono_threads_platform_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- g_assert_not_reached ();
-}
-
-void
-mono_threads_platform_disown_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- g_assert_not_reached ();
-}
-
void
mono_threads_platform_init (void)
{
//Thread initialization code
-static void mono_threads_unregister_current_thread (MonoThreadInfo *info);
-
static inline void
mono_hazard_pointer_clear_all (MonoThreadHazardPointers *hp, int retain)
{
gpointer gc_unsafe_stackdata;
MonoThreadInfo *info;
int small_id;
+ gboolean result;
info = (MonoThreadInfo *) arg;
g_assert (info);
mono_native_tls_set_value (thread_exited_key, GUINT_TO_POINTER (1));
- mono_threads_platform_unregister (info);
-
/*
* TLS destruction order is not reliable so small_id might be cleaned up
* before us.
*/
if (threads_callbacks.thread_unregister)
threads_callbacks.thread_unregister (info);
- mono_threads_unregister_current_thread (info);
+
+ mono_threads_platform_unregister (info);
+ result = mono_thread_info_remove (info);
+ g_assert (result);
mono_threads_transition_detach (info);
mono_thread_info_suspend_unlock ();
#endif
}
-/**
- * Removes the current thread from the thread list.
- * This must be called from the thread unregister callback and nowhere else.
- * The current thread must be passed as TLS might have already been cleaned up.
-*/
-static void
-mono_threads_unregister_current_thread (MonoThreadInfo *info)
-{
- gboolean result;
- g_assert (mono_thread_info_get_tid (info) == mono_native_thread_id_get ());
- result = mono_thread_info_remove (info);
- g_assert (result);
-}
-
MonoThreadInfo*
mono_thread_info_current_unchecked (void)
{
g_assert (mono_thread_info_is_current (info));
return mono_threads_platform_duplicate_handle (info);
}
-
-void
-mono_thread_info_own_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- mono_threads_platform_own_mutex (info, mutex_handle);
-}
-
-void
-mono_thread_info_disown_mutex (MonoThreadInfo *info, gpointer mutex_handle)
-{
- mono_threads_platform_disown_mutex (info, mutex_handle);
-}
/* Stack mark for targets that explicitly require one */
gpointer stack_mark;
-
- /* FIXME: move to MonoInternalThread */
- GPtrArray *owned_mutexes;
} MonoThreadInfo;
typedef struct {
HANDLE mono_threads_platform_open_thread_handle (HANDLE handle, MonoNativeThreadId tid);
void mono_threads_platform_close_thread_handle (HANDLE handle);
void mono_threads_platform_set_exited (THREAD_INFO_TYPE *info);
-void mono_threads_platform_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
-void mono_threads_platform_disown_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
gpointer mono_threads_platform_duplicate_handle (THREAD_INFO_TYPE *info);
void mono_threads_coop_begin_global_suspend (void);
gpointer
mono_thread_info_duplicate_handle (THREAD_INFO_TYPE *info);
-void
-mono_thread_info_own_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
-
-void
-mono_thread_info_disown_mutex (THREAD_INFO_TYPE *info, gpointer mutex_handle);
-
#endif /* __MONO_THREADS_H__ */
static gboolean
mono_w32handle_unref_core (gpointer handle, MonoW32HandleBase *handle_data, guint minimum)
{
+ MonoW32HandleType type;
guint old, new;
+ type = handle_data->type;
+
do {
old = handle_data->ref;
if (!(old >= minimum))
new = old - 1;
} while (InterlockedCompareExchange ((gint32*) &handle_data->ref, new, old) != old);
+ /* handle_data might contain invalid data from now on, if
+ * another thread is unref'ing this handle at the same time */
+
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_W32HANDLE, "%s: unref %s handle %p, ref: %d -> %d destroy: %s",
- __func__, mono_w32handle_ops_typename (handle_data->type), handle, old, new, new == 0 ? "true" : "false");
+ __func__, mono_w32handle_ops_typename (type), handle, old, new, new == 0 ? "true" : "false");
return new == 0;
}
mono_disasm_code_one
mono_dl_fallback_register
mono_dl_fallback_unregister
+mono_dl_open
mono_dllmap_insert
mono_domain_add_class_static_data
mono_domain_assembly_open
mono_ldtoken
mono_load_remote_field
mono_load_remote_field_new
+mono_loader_register_module
mono_lock_free_alloc
mono_lock_free_allocator_check_consistency
mono_lock_free_allocator_init_allocator
mono_disasm_code_one
mono_dl_fallback_register
mono_dl_fallback_unregister
+mono_dl_open
mono_dllmap_insert
mono_domain_add_class_static_data
mono_domain_assembly_open
mono_ldtoken
mono_load_remote_field
mono_load_remote_field_new
+mono_loader_register_module
mono_lock_free_alloc
mono_lock_free_allocator_check_consistency
mono_lock_free_allocator_init_allocator
<resources>System.Web.Http.WebHost.Properties.CommonWebApiResources,../../../external/aspnetwebstack/src/Common/CommonWebApiResources.resx System.Web.Http.WebHost.Properties.SRResources,../../../external/aspnetwebstack/src/System.Web.Http.WebHost/Properties/SRResources.resx</resources>
<response>System.Web.Http.WebHost.dll.sources</response>
</project>
- <project dir="class/Mono.Security.Providers.NewSystemSource" library="Mono.Security.Providers.NewSystemSource-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -d:SECURITY_DEP -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:MONO -d:FEATURE_PAL -d:MONO_FEATURE_NEW_TLS -d:MONO_FEATURE_NEW_SYSTEM_SOURCE -d:DISABLE_CAS_USE -d:MONO_SECURITY_ALIAS -r:./../../class/lib/net_4_x/System.dll -r:MonoSecurity=./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.NewSystemSource.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.NewSystemSource.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.NewSystemSource.dll.sources</response>
- </project>
- <project dir="class/Mono.Security.Providers.NewTls" library="Mono.Security.Providers.NewTls-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll -r:NewSystemSource=./../../class/lib/net_4_x/Mono.Security.Providers.NewSystemSource.dll</flags>
- <output>Mono.Security.Providers.NewTls.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.NewTls.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.NewTls.dll.sources</response>
- </project>
<project dir="class/System.Runtime.InteropServices.RuntimeInformation" library="System.Runtime.InteropServices.RuntimeInformation-net_4_x">
<boot>false</boot>
<flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/net_4_x/System.dll</flags>
<resources></resources>
<response>System.Xml.Serialization.dll.sources</response>
</project>
- <project dir="class/Mono.Security.Providers.DotNet" library="Mono.Security.Providers.DotNet-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.DotNet.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.DotNet.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.DotNet.dll.sources</response>
- </project>
- <project dir="class/Mono.Security.Providers.OldTls" library="Mono.Security.Providers.OldTls-net_4_x">
- <boot>false</boot>
- <flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -unsafe -nowarn:1030 -keyfile:../mono.pub -delaysign -d:SECURITY_DEP -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/Mono.Security.dll</flags>
- <output>Mono.Security.Providers.OldTls.dll</output>
- <built_sources></built_sources>
- <library_output>./../../class/lib/net_4_x/Mono.Security.Providers.OldTls.dll</library_output>
- <fx_version>4.5</fx_version>
- <profile>net_4_x</profile>
- <resources></resources>
- <response>Mono.Security.Providers.OldTls.dll.sources</response>
- </project>
<project dir="class/System.DirectoryServices.Protocols" library="System.DirectoryServices.Protocols-net_4_x">
<boot>false</boot>
<flags>/codepage:65001 -d:NET_4_0 -d:NET_4_5 -d:NET_4_6 -d:MONO -nowarn:1699 -nostdlib -r:./../../class/lib/net_4_x/mscorlib.dll -debug -optimize /noconfig -r:./../../class/lib/net_4_x/System.dll -r:./../../class/lib/net_4_x/System.DirectoryServices.dll -r:./../../class/lib/net_4_x/System.Xml.dll</flags>
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.WebHost-net_4_x", "mcs/class/System.Web.Http.WebHost/System.Web.Http.WebHost-net_4_x.csproj", "{2AF7E697-07BA-439E-89BF-076AEE4AE04C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.NewSystemSource-net_4_x", "mcs/class/Mono.Security.Providers.NewSystemSource/Mono.Security.Providers.NewSystemSource-net_4_x.csproj", "{0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.NewTls-net_4_x", "mcs/class/Mono.Security.Providers.NewTls/Mono.Security.Providers.NewTls-net_4_x.csproj", "{C8B8E524-BB3A-44E2-8C22-E3313E9F477C}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Framework-net_4_x", "mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_4_x.csproj", "{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Utilities-net_4_x", "mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_4_x.csproj", "{8E5728E0-CEAF-431F-963E-EB1DEE15C506}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Xml.Serialization-net_4_x", "mcs/class/System.Xml.Serialization/System.Xml.Serialization-net_4_x.csproj", "{2210873E-99FC-48A2-A261-D650BAE33A1C}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.DotNet-net_4_x", "mcs/class/Mono.Security.Providers.DotNet/Mono.Security.Providers.DotNet-net_4_x.csproj", "{391EDD2B-85AC-4FCA-B607-AAD6C51E6799}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Security.Providers.OldTls-net_4_x", "mcs/class/Mono.Security.Providers.OldTls/Mono.Security.Providers.OldTls-net_4_x.csproj", "{E485E885-59B1-4081-BC66-56AAAFD8771A}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.DirectoryServices.Protocols-net_4_x", "mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_4_x.csproj", "{EF08F249-31A1-4E62-8391-ECBA5227B686}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.VisualC-net_4_x", "mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_4_x.csproj", "{ACA2694D-9F07-4AE2-9171-9AB5DD1A8C18}"
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2AF7E697-07BA-439E-89BF-076AEE4AE04C}.Release|Any CPU.Build.0 = Release|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0BB4541F-9B1A-4CBC-BEB1-00B31B37F74E}.Release|Any CPU.Build.0 = Release|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C8B8E524-BB3A-44E2-8C22-E3313E9F477C}.Release|Any CPU.Build.0 = Release|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5E39A911-F4E6-4B4B-B8AC-111BB1DD80C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2210873E-99FC-48A2-A261-D650BAE33A1C}.Release|Any CPU.Build.0 = Release|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {391EDD2B-85AC-4FCA-B607-AAD6C51E6799}.Release|Any CPU.Build.0 = Release|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E485E885-59B1-4081-BC66-56AAAFD8771A}.Release|Any CPU.Build.0 = Release|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF08F249-31A1-4E62-8391-ECBA5227B686}.Release|Any CPU.ActiveCfg = Release|Any CPU
export CFLAGS="-ggdb3 -O2"
fi
-if [[ ${CI_TAGS} == *'coop-gc'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-cooperative-gc=yes"; export MONO_CHECK_MODE=gc,thread; fi
+if [[ ${CI_TAGS} == *'coop-gc'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-cooperative-gc=yes"; fi
+
+if [[ ${CI_TAGS} == *'checked-coop'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=gc,thread"; export MONO_CHECK_MODE=gc,thread; fi
+if [[ ${CI_TAGS} == *'checked-all'* ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --enable-checked-build=all"; export MONO_CHECK_MODE=all; fi
if [[ ${label} == 'osx-i386' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib --build=i386-apple-darwin11.2.0"; fi
if [[ ${label} == 'osx-amd64' ]]; then EXTRA_CONF_FLAGS="${EXTRA_CONF_FLAGS} --with-libgdiplus=/Library/Frameworks/Mono.framework/Versions/Current/lib/libgdiplus.dylib "; fi